From 53d968927cc52a8d180c98d3e109fffb19cb44fb Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Sat, 15 Jun 2024 21:43:34 -0400 Subject: [PATCH] feat: goreleaser-action v6 (#4670) Signed-off-by: Rui Chen --- .github/workflows/release.yml | 16 +++------------- .goreleaser.yml | 32 ++++++++++++++++++++++---------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e8809347..0267d712e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,13 +19,15 @@ jobs: go-version-file: go.mod - name: Run GoReleaser for stable release - uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811 # v5 + uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6 if: (!contains(github.ref, 'pre')) with: version: v1.16.2 # You can pass flags to goreleaser via GORELEASER_ARGS # --clean will save you deleting the dist dir args: release --clean + distribution: goreleaser # or 'goreleaser-pro' + version: "~> v2" # or 'latest', 'nightly', semver env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -41,18 +43,6 @@ jobs: env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: Run GoReleaser for pre-release - uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811 # v5 - if: contains(github.ref, 'pre') - with: - version: v1.16.2 - # You can pass flags to goreleaser via GORELEASER_ARGS - # --clean will save you deleting the dist dir - args: release --clean --release-notes=tmp-CHANGELOG.md - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GORELEASER_CURRENT_TAG: ${{ steps.changelog.outputs.RELEASE_TAG }} - homebrew: name: "Bump Homebrew formula" runs-on: ubuntu-22.04 diff --git a/.goreleaser.yml b/.goreleaser.yml index b937a3da0..1771e428d 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,15 +1,27 @@ +version: 2 + env: - CGO_ENABLED=0 + builds: - - targets: - - darwin_amd64 - - darwin_arm64 - - linux_386 - - linux_amd64 - - linux_arm - - linux_arm64 - - windows_386 - - windows_amd64 + - id: atlantis + + targets: + - darwin_amd64 + - darwin_arm64 + - linux_386 + - linux_amd64 + - linux_arm + - linux_arm64 + - windows_386 + - windows_amd64 + + flags: + - -trimpath + + ldflags: + - -s -w + - -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} archives: - id: zip @@ -19,7 +31,7 @@ archives: - none* checksum: - name_template: 'checksums.txt' + name_template: "checksums.txt" changelog: skip: true