From fb7e93aca264ec358e7e75e0651d432e189c3a42 Mon Sep 17 00:00:00 2001 From: Ravi Suhag Date: Thu, 13 Jun 2024 21:57:48 -0500 Subject: [PATCH] build: upgrade goreleaser to v2 --- .github/workflows/build.yml | 12 ++++------ .github/workflows/release.yml | 16 ++++++------- .goreleaser.yml | 43 ++++++++++++----------------------- 3 files changed, 27 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e33afb068..eb30af711 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,27 +10,25 @@ jobs: build: runs-on: ubuntu-latest steps: - # See https://goreleaser.com/ci/actions/#fetch-depthness - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - run: git fetch --force --tags - name: Set up Go uses: actions/setup-go@v3 with: - go-version: "1.20" + go-version: "stable" cache: true - check-latest: true - name: Get release tag id: get_version uses: battila7/get-version-action@v2 - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2.6.1 + uses: goreleaser/goreleaser-action@v6 with: distribution: goreleaser - version: latest - args: --snapshot --rm-dist + version: ~v2 + args: --snapshot --clean - name: Login to GitHub Packages Docker Registry uses: docker/login-action@v1 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7257cfbc3..79c1696ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,25 +3,23 @@ name: release on: push: tags: - - 'v*.*.*' + - "v*.*.*" workflow_dispatch: jobs: release: runs-on: ubuntu-latest steps: - # See https://goreleaser.com/ci/actions/#fetch-depthness - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - run: git fetch --force --tags - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: '^1.20' + go-version: "stable" cache: true - check-latest: true - name: Login to DockerHub uses: docker/login-action@v1 with: @@ -29,10 +27,10 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2.6.1 + uses: goreleaser/goreleaser-action@v6 with: distribution: goreleaser - version: latest - args: --rm-dist + version: ~v2 + args: release --clean env: GITHUB_TOKEN: ${{ secrets.GO_RELEASER_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index 52fb9695e..652151888 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,3 +1,5 @@ +version: 2 + project_name: meteor release: @@ -25,34 +27,19 @@ builds: - -X github.com/raystack/meteor/cmd.Version={{.Tag}} - -X github.com/raystack/meteor/cmd.BuildCommit={{.FullCommit}} - -X github.com/raystack/meteor/cmd.BuildDate={{.Date}} - goos: [linux] - goarch: [amd64, arm64] # skip goarch 386 and arm due to conflicts with "github.com/blastrain/vitess-sqlparser" library - env: - - CGO_ENABLED=0 - - main: ./main.go - id: "darwin" - binary: meteor - flags: [-a] - ldflags: - - -X github.com/raystack/meteor/cmd.Version={{.Tag}} - - -X github.com/raystack/meteor/cmd.BuildCommit={{.FullCommit}} - - -X github.com/raystack/meteor/cmd.BuildDate={{.Date}} - goos: [darwin] - goarch: [amd64, 386, arm, arm64] - env: - - CGO_ENABLED=0 - - main: ./main.go - id: "windows" - binary: meteor - flags: [-a] - ldflags: - - -X github.com/raystack/meteor/cmd.Version={{.Tag}} - - -X github.com/raystack/meteor/cmd.BuildCommit={{.FullCommit}} - - -X github.com/raystack/meteor/cmd.BuildDate={{.Date}} - goos: [windows] + goos: ["linux", "windows"] goarch: [amd64, arm64] # skip goarch 386 and arm due to conflicts with "github.com/blastrain/vitess-sqlparser" library env: - CGO_ENABLED=0 + ignore: # skip goarch 386 and arm due to conflicts with "github.com/blastrain/vitess-sqlparser" library + - goos: linux + goarch: 386 + - goos: linux + goarch: arm + - goos: windows + goarch: 386 + - goos: windows + goarch: arm archives: - id: "archives" @@ -91,7 +78,7 @@ scoops: - homepage: "https://github.com/raystack/meteor" description: "Metadata collection tool." license: Apache 2.0 - bucket: + repository: owner: raystack name: scoop-bucket @@ -99,11 +86,11 @@ brews: - name: meteor homepage: "https://github.com/raystack/meteor" description: "Metadata collection tool." - tap: + repository: owner: raystack name: homebrew-tap license: "Apache 2.0" - folder: Formula + directory: Formula dependencies: - name: git install: |-