fix: goreleaser tag race condition (#188)
Signed-off-by: matttrach <matt.trachier@suse.com>
This commit is contained in:
parent
d7c83ba1ea
commit
bd0cb43401
|
|
@ -74,7 +74,7 @@ jobs:
|
||||||
- name: Run GoReleaser
|
- name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 https://github.com/goreleaser/goreleaser-action
|
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 https://github.com/goreleaser/goreleaser-action
|
||||||
with:
|
with:
|
||||||
args: release --clean
|
args: release --clean --config .goreleaser_rc.yml
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GPG_KEY_ID: ${{ env.GPG_KEY_ID }}
|
GPG_KEY_ID: ${{ env.GPG_KEY_ID }}
|
||||||
|
|
|
||||||
|
|
@ -129,9 +129,9 @@ jobs:
|
||||||
echo "${GPG_KEY}" | gpg --import --batch > /dev/null || { echo "Failed to import GPG key"; exit 1; }
|
echo "${GPG_KEY}" | gpg --import --batch > /dev/null || { echo "Failed to import GPG key"; exit 1; }
|
||||||
- name: Run GoReleaser
|
- name: Run GoReleaser
|
||||||
if: steps.release-please.outputs.version
|
if: steps.release-please.outputs.version
|
||||||
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
|
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 https://github.com/goreleaser/goreleaser-action
|
||||||
with:
|
with:
|
||||||
args: release --clean
|
args: release --clean --config .goreleaser.yml
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GPG_KEY_ID: ${{ env.GPG_KEY_ID }}
|
GPG_KEY_ID: ${{ env.GPG_KEY_ID }}
|
||||||
|
|
|
||||||
|
|
@ -6,27 +6,33 @@ version: 2
|
||||||
before:
|
before:
|
||||||
hooks:
|
hooks:
|
||||||
- go mod tidy
|
- go mod tidy
|
||||||
|
git:
|
||||||
|
ignore_tags:
|
||||||
|
- "*rc*"
|
||||||
builds:
|
builds:
|
||||||
- env:
|
- binary: '{{ .ProjectName }}_v{{ .Version }}'
|
||||||
# goreleaser does not work with CGO, it could also complicate
|
env:
|
||||||
# usage by users in CI/CD systems like HCP Terraform where
|
# goreleaser does not work with CGO, it could also complicate
|
||||||
# they are unable to install libraries.
|
# usage by users in CI/CD systems like HCP Terraform where
|
||||||
- CGO_ENABLED=0
|
# they are unable to install libraries.
|
||||||
mod_timestamp: '{{ .CommitTimestamp }}'
|
- CGO_ENABLED=0
|
||||||
flags:
|
mod_timestamp: '{{ .CommitTimestamp }}'
|
||||||
- -trimpath
|
flags:
|
||||||
ldflags:
|
- -trimpath
|
||||||
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
|
ldflags:
|
||||||
goos:
|
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
|
||||||
- freebsd
|
goos:
|
||||||
- windows
|
- freebsd
|
||||||
- linux
|
- windows
|
||||||
- darwin
|
- linux
|
||||||
goarch:
|
- darwin
|
||||||
- amd64
|
goarch:
|
||||||
- arm
|
- amd64
|
||||||
- arm64
|
- arm
|
||||||
binary: '{{ .ProjectName }}_v{{ .Version }}'
|
- arm64
|
||||||
|
ignore:
|
||||||
|
- goos: windows
|
||||||
|
goarch: arm
|
||||||
archives:
|
archives:
|
||||||
- formats: [ 'zip' ]
|
- formats: [ 'zip' ]
|
||||||
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
|
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
|
||||||
|
|
||||||
|
# https://goreleaser.com for documentation
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
before:
|
||||||
|
hooks:
|
||||||
|
- go mod tidy
|
||||||
|
builds:
|
||||||
|
- binary: '{{ .ProjectName }}_v{{ .Version }}'
|
||||||
|
env:
|
||||||
|
# goreleaser does not work with CGO, it could also complicate
|
||||||
|
# usage by users in CI/CD systems like HCP Terraform where
|
||||||
|
# they are unable to install libraries.
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
mod_timestamp: '{{ .CommitTimestamp }}'
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
ldflags:
|
||||||
|
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
|
||||||
|
goos:
|
||||||
|
- freebsd
|
||||||
|
- windows
|
||||||
|
- linux
|
||||||
|
- darwin
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
- arm
|
||||||
|
- arm64
|
||||||
|
ignore:
|
||||||
|
- goos: windows
|
||||||
|
goarch: arm
|
||||||
|
archives:
|
||||||
|
- formats: [ 'zip' ]
|
||||||
|
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
|
||||||
|
checksum:
|
||||||
|
extra_files:
|
||||||
|
- glob: 'terraform-registry-manifest.json'
|
||||||
|
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
|
||||||
|
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
|
||||||
|
algorithm: sha256
|
||||||
|
signs:
|
||||||
|
- artifacts: checksum
|
||||||
|
args:
|
||||||
|
- "--detach-sig"
|
||||||
|
- "--pinentry-mode"
|
||||||
|
- "loopback"
|
||||||
|
- "--passphrase"
|
||||||
|
- "{{ .Env.GPG_PASSPHRASE }}"
|
||||||
|
- "--local-user"
|
||||||
|
- "{{ .Env.GPG_KEY_ID }}"
|
||||||
|
- "--output"
|
||||||
|
- "${signature}"
|
||||||
|
- "--sign"
|
||||||
|
- "${artifact}"
|
||||||
|
release:
|
||||||
|
extra_files:
|
||||||
|
- glob: 'terraform-registry-manifest.json'
|
||||||
|
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
|
||||||
|
prerelease: auto
|
||||||
|
changelog:
|
||||||
|
disable: true
|
||||||
Loading…
Reference in New Issue