From b26f414d54eca600545484fe557260a7c7f73567 Mon Sep 17 00:00:00 2001 From: VeteranBV Date: Wed, 15 Jul 2026 03:16:49 +0000 Subject: [PATCH] ci: migrate goreleaser config to v2 and guard untagged release runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The manually dispatched release run surfaced two issues. GoReleaser v2.17 warns that the config is version: 0 (fatal in a future release); migrated it — version: 2 header, archives format/builds renamed to formats/ids — and validated with goreleaser check plus a full snapshot build of all six targets. And running the Release workflow directly at an untagged ref died with goreleaser's cryptic "git doesn't contain any tags"; a guard step now fails fast with a pointer to the Tag Release workflow instead. Also bumps checkout/setup-go/goreleaser-action to their current majors to clear the Node 20 deprecation warnings on every run. --- .github/workflows/ci.yml | 16 ++++++++-------- .github/workflows/release.yml | 12 +++++++++--- .github/workflows/tag-release.yml | 2 +- .goreleaser.yml | 6 ++++-- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5eac50f..e5a5af8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,9 +10,9 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: go-version: '1.22' - name: golangci-lint @@ -31,9 +31,9 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: go-version: '1.22' - name: Run tests @@ -46,9 +46,9 @@ jobs: benchmark: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: go-version: '1.22' - name: Run benchmarks @@ -74,9 +74,9 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: go-version: '1.22' - name: Build binary diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da6d7f3..3d13a0d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,9 +15,15 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 + - name: Ensure release commit is tagged + run: | + if ! git describe --exact-match --tags HEAD >/dev/null 2>&1; then + echo "::error::No tag at HEAD. Cut releases with the 'Tag Release' workflow; running 'Release' directly only works at a tag ref." + exit 1 + fi - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: go-version: '1.22' - name: Run Tests @@ -31,7 +37,7 @@ jobs: go install ./cmd/sysgreet sysgreet --disable - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v5 + uses: goreleaser/goreleaser-action@v6 with: version: "~> v2" args: release --clean diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 5b63ee3..cec74ec 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -20,7 +20,7 @@ jobs: tag: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: ref: main fetch-depth: 0 diff --git a/.goreleaser.yml b/.goreleaser.yml index 36af6ae..9d60196 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,3 +1,5 @@ +version: 2 + project_name: sysgreet before: @@ -19,8 +21,8 @@ builds: archives: - id: binary - builds: [sysgreet] - format: tar.gz + ids: [sysgreet] + formats: [tar.gz] files: - LICENSE - README.md