-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor goreleaser-ci jobs to own workflow file
- Loading branch information
Showing
2 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
archives: | ||
- files: | ||
# Ensure only built binary is archived | ||
- 'none*' | ||
format: zip | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' | ||
before: | ||
hooks: | ||
- 'go mod download' | ||
builds: | ||
# Check and build binary for 32-bit architecture (FreeBSD/ARM) | ||
- id: 32-bit-arch | ||
# Binary naming only required for Terraform CLI 0.12 | ||
binary: '{{ .ProjectName }}_v{{ .Version }}_x5' | ||
env: | ||
- CGO_ENABLED=0 | ||
flags: | ||
- -trimpath | ||
goos: | ||
- freebsd | ||
goarch: | ||
- arm | ||
ldflags: | ||
- -s -w -X version.ProviderVersion={{.Version}} | ||
mod_timestamp: '{{ .CommitTimestamp }}' | ||
snapshot: | ||
name_template: "{{ .Tag }}-next" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Continuous integration handling for GoReleaser | ||
name: GoReleaser CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- 'release/**' | ||
pull_request: | ||
paths: | ||
- .github/workflows/goreleaser-ci.yml | ||
- .goreleaser.yml | ||
- .go-version | ||
- go.sum | ||
- main.go | ||
- internal/** | ||
- names/** | ||
- providerlint/** | ||
- skaff/** | ||
- tools/** | ||
|
||
jobs: | ||
changes: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
goreleaser: ${{ steps.filter.outputs.goreleaser }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
filters: | | ||
goreleaser: | ||
- '.github/workflows/goreleaser-ci.yml' | ||
- '.goreleaser.yml' | ||
check: | ||
needs: changes | ||
if: ${{ needs.changes.outputs.goreleaser == 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: go.mod | ||
- uses: actions/cache@v2 | ||
continue-on-error: true | ||
timeout-minutes: 2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} | ||
- name: goreleaser check | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
args: check | ||
build-32-bit: | ||
# Run a single compiler check for 32-bit architecture (FreeBSD/ARM) | ||
# Ref: https://github.com/hashicorp/terraform-provider-aws/issues/8988 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: go.mod | ||
- uses: actions/cache@v2 | ||
continue-on-error: true | ||
timeout-minutes: 2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} | ||
- name: goreleaser build | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
args: build --config .github/goreleaser-cross-compiler-test.yml --id 32-bit-arch --snapshot |