Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 74 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,98 @@ on:
permissions:
contents: write
jobs:
prepare:
name: Prepare
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
cache: true
- shell: bash
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- uses: actions/cache@v4
if: matrix.os == 'ubuntu-latest'
with:
path: dist/linux
key: linux-${{ env.sha_short }}${{ env.flags }}
- uses: actions/cache@v4
if: matrix.os == 'macos-latest'
with:
path: dist/darwin
key: darwin-${{ env.sha_short }}${{ env.flags }}
- uses: actions/cache@v4
if: matrix.os == 'windows-latest'
with:
path: dist/windows
key: windows-${{ env.sha_short }}${{ env.flags }}
enableCrossOsArchive: true
- name: Import GPG key
uses: crazy-max/[email protected]
id: import_gpg
with:
gpg_private_key: ${{ secrets.PLURAL_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PLURAL_GPG_KEY_PASSWORD }}
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
version: '~> v2'
args: release --clean --split
env:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
release:
name: Release
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
needs: prepare
steps:
- uses: jlumbroso/[email protected]
with:
tool-cache: false
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
- uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
cache: true
- shell: bash
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
path: dist/linux
key: linux-${{ env.sha_short }}${{ env.flags }}
- uses: actions/cache@v4
with:
path: dist/darwin
key: darwin-${{ env.sha_short }}${{ env.flags }}
- uses: actions/cache@v4
with:
path: dist/windows
key: windows-${{ env.sha_short }}${{ env.flags }}
enableCrossOsArchive: true
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
uses: crazy-max/ghaction-import-gpg@v6.3.0
id: import_gpg
with:
gpg_private_key: ${{ secrets.PLURAL_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PLURAL_GPG_KEY_PASSWORD }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811 # v5.1.0
- uses: goreleaser/goreleaser-action@v6
if: steps.cache.outputs.cache-hit != 'true' # do not run if cache hit
with:
args: release --clean
distribution: goreleaser-pro
version: '~> v2'
args: continue --merge
env:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
10 changes: 3 additions & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Visit https://goreleaser.com for documentation on how to customize this
# behavior.
version: 2
before:
hooks:
# this is just an example and not a requirement for provider building/publishing
- go mod tidy
builds:
- env:
Expand Down Expand Up @@ -30,7 +28,7 @@ builds:
goarch: '386'
binary: '{{ .ProjectName }}_v{{ .Version }}'
archives:
- format: zip
- formats: [ 'zip' ]
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
checksum:
extra_files:
Expand All @@ -54,7 +52,5 @@ release:
extra_files:
- glob: 'terraform-registry-manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
# If you want to manually examine the release before its live, uncomment this line:
# draft: true
changelog:
skip: true
disable: true
Loading