From e277746f6f210a18c58408cf739b7ff8ff976d21 Mon Sep 17 00:00:00 2001 From: Rafael Barash Date: Thu, 5 Sep 2024 12:08:47 -0600 Subject: [PATCH 1/4] update goreleaser github action based on github marketplace docs. --- .github/workflows/release.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1b8b8596..159cd0d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,15 +8,19 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Unshallow - run: git fetch --prune --unshallow - - uses: actions/setup-go@v1 + - name: Checkout + uses: actions/checkout@v4 with: - go-version: 1.21.x - - uses: goreleaser/goreleaser-action@v2 + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v5 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 with: - version: latest - args: release --rm-dist + # either 'goreleaser' (default) or 'goreleaser-pro' + distribution: goreleaser + # 'latest', 'nightly', or a semver + version: '~> v2' + args: release --clean env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN } From 32dfcb907a0f2bbe81b19d525d1289117111bf10 Mon Sep 17 00:00:00 2001 From: Rafael Barash Date: Thu, 5 Sep 2024 12:22:16 -0600 Subject: [PATCH 2/4] attempt to add goreleaser build test --- .github/workflows/release.yml | 2 -- .github/workflows/test.yml | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 159cd0d0..4cce248e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,9 +17,7 @@ jobs: - name: Run GoReleaser uses: goreleaser/goreleaser-action@v6 with: - # either 'goreleaser' (default) or 'goreleaser-pro' distribution: goreleaser - # 'latest', 'nightly', or a semver version: '~> v2' args: release --clean env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 53484cfc..bb28df2e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,7 @@ on: [push, pull_request] name: Test jobs: - test: + go-test: strategy: matrix: go-version: [1.21, 1.x] # Test 1.21 and tip @@ -34,3 +34,16 @@ jobs: run: | go test -timeout 10s -v -tags=windows ./... go test -race -timeout 10s -v -tags=windows ./... + goreleaser-test: + runs-on: ubuntu-latest + steps: + - name: Set up Go + uses: actions/setup-go@v5 + - name: Build GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: '~> v2' + args: build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From dc1ce5498647ef76fdc7bf076e3ef8909fdc37a6 Mon Sep 17 00:00:00 2001 From: Rafael Barash Date: Thu, 5 Sep 2024 12:23:23 -0600 Subject: [PATCH 3/4] add checkout step to goreleaser test --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bb28df2e..1940b17d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,6 +37,10 @@ jobs: goreleaser-test: runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Go uses: actions/setup-go@v5 - name: Build GoReleaser From eef0eb69974333c22d274cd8545dd9631e6defcd Mon Sep 17 00:00:00 2001 From: Rafael Barash Date: Thu, 5 Sep 2024 12:29:39 -0600 Subject: [PATCH 4/4] update test command with --snapshot --clean flags so it can succeed without "tag not made against commit" failure --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1940b17d..eb7ded7f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,6 +48,6 @@ jobs: with: distribution: goreleaser version: '~> v2' - args: build + args: build --snapshot --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}