Skip to content

Commit

Permalink
Bump GitHub Actions
Browse files Browse the repository at this point in the history
Make workflow more similar to what is used by
https://github.com/CloudKarafka/terraform-provider-cloudkarafka

- use .go-version in actions
- actions/setup-go@v4 caches by default

Close #179
  • Loading branch information
dentarg committed Jul 17, 2023
1 parent 5edfdff commit 00f4368
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 26 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
go-version-file: .go-version
- name: Build for single target with GoReleaser
uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 # v4.3.0
with:
Expand Down
34 changes: 10 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,21 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Read go version
id: go-version
run: |
content=`cat ./.go-version`
echo "::set-output name=content::$content"
-
name: Set up Go
uses: actions/setup-go@v2
- uses: actions/checkout@v3
with:
# TODO: Replace with go-version-from-file when it is supported
# https://github.com/actions/setup-go/pull/62
go-version: ${{ steps.go-version.outputs.content }}
-
name: Import GPG key
# Allow goreleaser to access older tag information.
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: .go-version
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5.0.0
uses: crazy-max/ghaction-import-gpg@72b6676b71ab476b77e676928516f6982eef7a41 # v5.3.0
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 # v4.3.0
with:
version: latest
args: release --rm-dist
Expand Down

0 comments on commit 00f4368

Please sign in to comment.