Skip to content

Commit

Permalink
chore(deps): update all dependencies to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
twelvelabs committed Dec 21, 2024
1 parent 0935368 commit 2bfbaa8
Showing 12 changed files with 245 additions and 158 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -5,6 +5,14 @@

version: 2
updates:
- package-ecosystem: docker
directory: /
schedule:
interval: weekly
commit-message:
prefix: chore
include: scope

- package-ecosystem: github-actions
directory: /
schedule:
31 changes: 22 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
name: build

on:
@@ -8,28 +7,40 @@ on:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: read
packages: write # if pushing docker images

jobs:
test:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # pin@v4.1.1
uses: actions/checkout@v4
with:
fetch-depth: 0
# Need a PAT so that `make release-tag` will trigger the release workflow.
# See: https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
token: ${{ github.ref_name == 'main' && secrets.GH_PAT || secrets.GITHUB_TOKEN }}

- name: Cache Dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/golangci-lint
~/.npm
~/go/bin
/home/linuxbrew/.linuxbrew
key: ${{ runner.os }}-dependencies

- name: Set up Homebrew
uses: homebrew/actions/setup-homebrew@9e809e528c6aae1b87ed30f5d81fe75d0bfc6f38 # pin@master
uses: homebrew/actions/setup-homebrew@master

- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # pin@v5.0.0
uses: actions/setup-go@v5
with:
go-version-file: go.mod

@@ -46,10 +57,13 @@ jobs:
run: make test

- name: Coverage
uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # pin@v3.1.5
uses: codecov/codecov-action@v5
with:
files: coverage.out
token: ${{ secrets.CODECOV_TOKEN }}

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # pin@v6.1.0
uses: crazy-max/ghaction-import-gpg@v6
if: github.ref_name == 'main'
with:
gpg_private_key: ${{ secrets.GH_COMMIT_SIGNING_KEY }}
@@ -58,10 +72,9 @@ jobs:
git_user_signingkey: true
git_commit_gpgsign: true
git_tag_gpgsign: true
git_push_gpgsign: false

- name: Create release tag
# Change to support different release channels
# Versions from a non-main branch will look like: `v.0.0.0-branch-name`.
if: github.ref_name == 'main'
run: make release-tag
env:
33 changes: 28 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
name: release

on:
@@ -14,25 +13,49 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # pin@v4.1.1
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache Dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/golangci-lint
~/.npm
~/go/bin
/home/linuxbrew/.linuxbrew
key: ${{ runner.os }}-dependencies

- name: Set up Homebrew
uses: homebrew/actions/setup-homebrew@9e809e528c6aae1b87ed30f5d81fe75d0bfc6f38 # pin@master
uses: homebrew/actions/setup-homebrew@master

- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # pin@v5.0.0
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: make setup

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # pin@v6.1.0
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GH_COMMIT_SIGNING_KEY }}
passphrase: ${{ secrets.GH_COMMIT_SIGNING_PASS }}
31 changes: 17 additions & 14 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ linters:
- cyclop
- depguard
- dupl
- goerr113
- err113
- exhaustruct
- forbidigo
- forcetypeassert
@@ -16,27 +16,26 @@ linters:
- godox
- gofumpt
- gomnd
- govet
- ireturn
- mnd
- nlreturn
- paralleltest
- perfsprint
- recvcheck
- tagalign
- tagliatelle
- testifylint
- testpackage
- varnamelen
- wrapcheck
- wsl
# disabled because they spew warnings re: generics
- rowserrcheck
- wastedassign
# deprecated
- exhaustivestruct
- deadcode
- golint
- ifshort
- interfacer
- maligned
- nosnakecase
- scopelint
- structcheck
- varcheck
- execinquery
- exportloopref

linters-settings:
exhaustive:
@@ -48,13 +47,17 @@ linters-settings:
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/twelvelabs/schemadoc) # Custom section: groups all imports with the specified Prefix.

gomoddirectives:
replace-allow-list:
- github.com/imdario/mergo
goconst:
ignore-tests: true

lll:
line-length: 120

revive:
rules:
- name: unused-parameter
disabled: true

staticcheck:
checks:
- "all"
58 changes: 49 additions & 9 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: 2

project_name: schemadoc

before:
@@ -49,7 +51,7 @@ brews:
owner: twelvelabs
name: homebrew-tap
branch: main
folder: Formula
directory: Formula
homepage: "https://github.com/twelvelabs/schemadoc"
description: "Generate markdown documents from JSON schema files"
license: "MIT"
@@ -66,14 +68,6 @@ checksum:
name_template: "checksums.txt"
algorithm: sha256

# gomod:
# proxy: true

report_sizes: true

snapshot:
name_template: "{{ incpatch .Version }}-next" # cspell: disable-line

changelog:
use: github
sort: asc
@@ -86,3 +80,49 @@ changelog:
order: 10
- title: Other work
order: 99

dockers:
- image_templates:
- "ghcr.io/twelvelabs/{{ .ProjectName }}:{{ .Tag }}-amd64"
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/amd64"
goarch: amd64
use: buildx

- image_templates:
- "ghcr.io/twelvelabs/{{ .ProjectName }}:{{ .Tag }}-arm64"
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/arm64"
goarch: arm64
use: buildx

docker_manifests:
- name_template: "ghcr.io/twelvelabs/{{ .ProjectName }}:{{ .Tag }}"
image_templates:
- "ghcr.io/twelvelabs/{{ .ProjectName }}:{{ .Tag }}-amd64"
- "ghcr.io/twelvelabs/{{ .ProjectName }}:{{ .Tag }}-arm64"

- name_template: "ghcr.io/twelvelabs/{{ .ProjectName }}:latest"
image_templates:
- "ghcr.io/twelvelabs/{{ .ProjectName }}:{{ .Tag }}-amd64"
- "ghcr.io/twelvelabs/{{ .ProjectName }}:{{ .Tag }}-arm64"

gomod:
proxy: true

report_sizes: true

snapshot:
version_template: "{{ incpatch .Version }}-next" # cspell: disable-line
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alpine:3.21

COPY schemadoc /usr/local/bin/schemadoc

CMD ["/usr/local/bin/schemadoc"]
4 changes: 3 additions & 1 deletion bin/build.sh
Original file line number Diff line number Diff line change
@@ -7,7 +7,9 @@ goreleaser build --clean --snapshot --single-target
# used by install/uninstall scripts.
# Allows us to be resilient to config changes.

artifact_path=$(jq -r '.[0].path' dist/artifacts.json)
artifact_path=$(
jq -r '.[] | select(.type == "Binary") | .path' dist/artifacts.json
)
artifact_name=$(basename "${artifact_path}")
brew_prefix=$(brew --prefix)

1 change: 1 addition & 0 deletions cspell.yml
Original file line number Diff line number Diff line change
@@ -60,6 +60,7 @@ words:
- ifeq
- ifneq
- jsonschema
- linuxbrew
- mapset
- markdownlint
- minifier
Loading

0 comments on commit 2bfbaa8

Please sign in to comment.