Skip to content

Commit

Permalink
fix: release pipeline (#104)
Browse files Browse the repository at this point in the history
* change actions/checkout to v4
* change actions/setup-go to v5
* change go-version to v1.22
* change goreleaser/goreleaser-action to v6
* add "version: 2" to .goreleaser.yml
* remove darwin from .goreleaser.yml, because we import
longhorn/go-common-libs which uses unix.CLONE_NEWNET

Signed-off-by: PoAn Yang <[email protected]>
  • Loading branch information
FrankYang0529 authored Sep 18, 2024
1 parent 55ee9e6 commit 0e169a9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
34 changes: 15 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# This GitHub action can publish assets for release when a tag is created.
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
#
# This uses an action (hashicorp/ghaction-import-gpg) that assumes you set your
# This uses an action (hashicorp/ghaction-import-gpg) that assumes you set your
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
# secret. If you would rather own your own GPG handling, please fork this action
# or use an alternative one for key handling.
#
# You will need to pass the `--batch` flag to `gpg` in your signing step
# You will need to pass the `--batch` flag to `gpg` in your signing step
# in `goreleaser` to indicate this is being used in a non-interactive mode.
#
name: release
Expand All @@ -18,31 +18,27 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Set up Go
uses: actions/setup-go@v3
- name: Checkout
uses: actions/checkout@v4
with:
go-version: '1.20'
-
name: Import GPG key
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
# These secrets will need to be configured for the repository:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --rm-dist
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
# GitHub sets this automatically
Expand Down
9 changes: 2 additions & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,5 +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
Expand All @@ -17,7 +18,6 @@ builds:
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
goos:
- linux
- darwin
goarch:
- amd64
- arm64
Expand All @@ -31,7 +31,7 @@ checksum:
signs:
- artifacts: checksum
args:
# if you are using this in a GitHub action or some other automated pipeline, you
# if you are using this in a GitHub action or some other automated pipeline, you
# need to pass the batch flag to indicate its not interactive.
- "--batch"
- "--local-user"
Expand All @@ -40,8 +40,3 @@ signs:
- "${signature}"
- "--detach-sign"
- "${artifact}"
release:
# If you want to manually examine the release before its live, uncomment this line:
# draft: true
changelog:
skip: true

0 comments on commit 0e169a9

Please sign in to comment.