From bade1de79298dfbb5b8c7e1638e2d51fd2c6e9c0 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 25 Jul 2026 19:04:52 -0700 Subject: [PATCH] ci(goreleaser): migrate release config to goreleaser v2 goreleaser v1 is EOL; v2 is the current supported major line, so move the release pipeline over before adding any further release changes. This is a purely mechanical syntax migration with no behavioral intent beyond staying on a supported version. .goreleaser.yaml: - add top-level `version: 2` (required by goreleaser v2) - rename `blobs[].folder` to `blobs[].directory` - rename `snapshot.name_template` to `snapshot.version_template` - rename `nightly.name_template` to `nightly.version_template` (goreleaser-pro only block) .gitea/workflows/release-tag.yml and release-nightly.yml: - bump the goreleaser-action `version` pin from `~> v1` to `~> v2` All other keys (force_token, gitea_urls, builds.no_unique_dist_dir, checksum.extra_files, signs, release.extra_files, etc.) are valid as-is under v2 and are left untouched. `goreleaser check` still reports `DEPRECATED: archives.format should not be used anymore`. This predates this change and is orthogonal to the v1->v2 migration, so it is intentionally left unfixed here. Verified locally with goreleaser v2 OSS (2.11.2): - `goreleaser check -f .goreleaser.yaml` fails with `field nightly not found in type config.Project`, as expected since `nightly` is a goreleaser-pro-only key and the local binary is OSS. - copied the config to a scratch file with the `nightly:` block stripped and ran `goreleaser check -f ` from inside this worktree: `configuration is valid, but uses deprecated properties` (only the pre-existing archives.format warning). Scratch file was deleted afterwards and was never committed. - using the same scratch file, ran a real build smoke test: `SDK_VERSION=$(go list -f '{{.Version}}' -m gitea.dev/sdk) goreleaser build --snapshot --clean --single-target -f `, which succeeded end-to-end including the xz and checksum post hooks; `dist/` (git-ignored) was removed afterwards. - validated .goreleaser.yaml, release-tag.yml and release-nightly.yml with python3's yaml.safe_load. --- Generated by Codet --- .gitea/workflows/release-nightly.yml | 2 +- .gitea/workflows/release-tag.yml | 2 +- .goreleaser.yaml | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/release-nightly.yml b/.gitea/workflows/release-nightly.yml index 046aa7d7..d1e7290b 100644 --- a/.gitea/workflows/release-nightly.yml +++ b/.gitea/workflows/release-nightly.yml @@ -28,7 +28,7 @@ jobs: uses: goreleaser/goreleaser-action@v7 with: distribution: goreleaser-pro - version: "~> v1" + version: "~> v2" args: release --nightly env: SDK_VERSION: ${{ steps.sdk_version.outputs.version }} diff --git a/.gitea/workflows/release-tag.yml b/.gitea/workflows/release-tag.yml index 476ccd60..c3049f46 100644 --- a/.gitea/workflows/release-tag.yml +++ b/.gitea/workflows/release-tag.yml @@ -29,7 +29,7 @@ jobs: uses: goreleaser/goreleaser-action@v7 with: distribution: goreleaser-pro - version: "~> v1" + version: "~> v2" args: release env: SDK_VERSION: ${{ steps.sdk_version.outputs.version }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 35546017..84043d21 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,3 +1,5 @@ +version: 2 + before: hooks: - go mod tidy @@ -79,7 +81,7 @@ blobs: provider: s3 bucket: "{{ .Env.S3_BUCKET }}" region: "{{ .Env.S3_REGION }}" - folder: "tea/{{.Version}}" + directory: "tea/{{.Version}}" extra_files: - glob: ./**.xz - glob: ./**.sha256 @@ -104,10 +106,10 @@ signs: args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"] snapshot: - name_template: "{{ .Branch }}-devel" + version_template: "{{ .Branch }}-devel" nightly: - name_template: "{{ .Branch }}" + version_template: "{{ .Branch }}" gitea_urls: api: https://gitea.com/api/v1