Skip to content

Commit

Permalink
GitHub Action goreleaser-test - convert to a matrix (#942)
Browse files Browse the repository at this point in the history
github action goreleaser-test: convert to a matrix
  • Loading branch information
Nathan Sullivan authored Jan 4, 2023
1 parent a523551 commit 8ba5d6f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 119 deletions.
125 changes: 7 additions & 118 deletions .github/workflows/build-test-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,13 @@ jobs:
name: collect
path: bin/collect

goreleaser-test-darwin-amd64:
goreleaser-test:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') != true
strategy:
matrix:
goarch: [amd64, arm64]
goos: [darwin, linux, windows]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -212,123 +216,8 @@ jobs:
version: "v0.183.0"
args: build --rm-dist --snapshot --config deploy/.goreleaser.yaml --single-target
env:
GOARCH: amd64
GOOS: darwin

goreleaser-test-linux-amd64:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') != true
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Unshallow
run: git fetch --prune --unshallow

- uses: actions/setup-go@v3
with:
go-version: "1.19"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: "v0.183.0"
args: build --rm-dist --snapshot --config deploy/.goreleaser.yaml --single-target
env:
GOARCH: amd64
GOOS: linux

goreleaser-test-windows-amd64:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') != true
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Unshallow
run: git fetch --prune --unshallow

- uses: actions/setup-go@v3
with:
go-version: "1.19"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: "v0.183.0"
args: build --rm-dist --snapshot --config deploy/.goreleaser.yaml --single-target
env:
GOARCH: amd64
GOOS: windows

goreleaser-test-darwin-arm64:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') != true
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Unshallow
run: git fetch --prune --unshallow

- uses: actions/setup-go@v3
with:
go-version: "1.19"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: "v0.183.0"
args: build --rm-dist --snapshot --config deploy/.goreleaser.yaml --single-target
env:
GOARCH: arm64
GOOS: darwin

goreleaser-test-linux-arm64:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') != true
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Unshallow
run: git fetch --prune --unshallow

- uses: actions/setup-go@v3
with:
go-version: "1.19"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: "v0.183.0"
args: build --rm-dist --snapshot --config deploy/.goreleaser.yaml --single-target
env:
GOARCH: arm64
GOOS: linux

goreleaser-test-windows-arm64:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') != true
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Unshallow
run: git fetch --prune --unshallow

- uses: actions/setup-go@v3
with:
go-version: "1.19"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: "v0.183.0"
args: build --rm-dist --snapshot --config deploy/.goreleaser.yaml --single-target
env:
GOARCH: arm64
GOOS: windows
GOARCH: ${{ matrix.goarch }}
GOOS: ${{ matrix.goos }}

goreleaser:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion deploy/.goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ release:
builds:
- id: preflight
# NOTE: if you add any additional goos/goarch values, ensure you update ../.github/workflows/build-test-deploy.yaml
# with the respective goreleaser-test-* jobs
# specifically the matrix values for goreleaser-test
goos:
- linux
- darwin
Expand Down

0 comments on commit 8ba5d6f

Please sign in to comment.