diff --git a/.copier-answers.yml b/.copier-answers.yml index 70f0bb0..54cc59a 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,6 +1,6 @@ --- # Changes here will be overwritten by Copier -_commit: v2.4.4 +_commit: v2.5.1 _src_path: gh:remerge/template is_golang_library: true project_id: go-server @@ -8,7 +8,6 @@ project_license: private project_name: Go Server Framework project_owner: core project_type: default -run_workflows_for_all_branches: false use_ansible: false use_consul: false use_golang: true diff --git a/.github/workflows/go-lib.yml b/.github/workflows/go-lib.yml index c6434af..5018475 100644 --- a/.github/workflows/go-lib.yml +++ b/.github/workflows/go-lib.yml @@ -7,18 +7,19 @@ on: branches: [main, master, production] permissions: - actions: read - checks: read + actions: none + checks: none contents: read - deployments: read - issues: read - discussions: read - packages: read - pages: read - pull-requests: read - repository-projects: read - security-events: read - statuses: read + deployments: none + discussions: none + id-token: none + issues: none + packages: none + pages: none + pull-requests: none + repository-projects: none + security-events: none + statuses: none jobs: go-checks: diff --git a/.github/workflows/go-optional.yml b/.github/workflows/go-optional.yml index 0382eb3..dbbc24d 100644 --- a/.github/workflows/go-optional.yml +++ b/.github/workflows/go-optional.yml @@ -5,7 +5,20 @@ on: schedule: - cron: "30 0 * * 0" -permissions: read-all +permissions: + actions: none + checks: none + contents: read + deployments: none + discussions: none + id-token: none + issues: none + packages: none + pages: none + pull-requests: none + repository-projects: none + security-events: none + statuses: none jobs: go-modules: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index a33c82a..e162fc6 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -6,7 +6,20 @@ on: push: branches: [main, master] -permissions: read-all +permissions: + actions: none + checks: none + contents: read + deployments: none + discussions: none + id-token: none + issues: none + packages: none + pages: none + pull-requests: none + repository-projects: none + security-events: none + statuses: none jobs: pre-commit: @@ -14,12 +27,11 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - run: echo "GO_VERSION=$(grep '^go ' < go.mod | awk '{print $2}')" >> "$GITHUB_ENV" - - name: Setup Go uses: actions/setup-go@v4 with: - go-version: ${{ env.GO_VERSION }} + go-version: "stable" + - uses: webfactory/ssh-agent@v0.6.0 with: ssh-private-key: "${{ secrets.DEPLOY_USER_SSH_KEY }}" diff --git a/.gitignore b/.gitignore index c1730cf..b783ef0 100644 --- a/.gitignore +++ b/.gitignore @@ -573,3 +573,6 @@ id_* # only. !*.tfvars !*.tfvars.json + +# Ignore direnv files +.direnv/ diff --git a/go.mk b/go.mk index 7b57018..3577b87 100644 --- a/go.mk +++ b/go.mk @@ -1,3 +1,5 @@ +GO_VERSION := 1.21 + SHADOW_LINTER := golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow SHADOW_LINTER_VERSION := v0.13.0 @@ -10,8 +12,8 @@ REVIVE_LINTER := github.com/mgechev/revive .PHONY: go-update go-update:: ## update Go modules - go get -u -x - go mod tidy + @go get -u -x ./... 2>&1 | grep -vP '^(#|mkdir|cd|\d\.\d\d\ds #)' || : + @go mod tidy -v -x -go $(GO_VERSION) update:: go-update .PHONY: go-build @@ -255,8 +257,7 @@ endif divert: .check-dependencies .nomad-env .input-validation @mkdir -p .build - @docker build --build-arg \ - "GO_VERSION=$$(grep '^go ' < go.mod | awk '{print $$2}')" \ + @docker build \ --build-arg "CI_COMMIT=$(TASK_IMAGE)" \ --build-arg "CI_REPO=$(PROJECT_REPO)" \ --build-arg "CI_REPO=$(DEV_WHOAMI)" \ diff --git a/go.mod b/go.mod index 7047045..d08f847 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/remerge/go-server -go 1.20 +go 1.21 require ( github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475