-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH Actions CI and release improvements (#89)
- Make sure bin directory exists prior to attempting binary fetches - Bump versions of goreleaser and krew-release-bot - Share goreleaser workflow for PRs, branch pushes, and tags, but with configuration based on event type Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
- Loading branch information
1 parent
019ce08
commit 641f976
Showing
5 changed files
with
28 additions
and
17 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
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 |
---|---|---|
@@ -1,28 +1,40 @@ | ||
name: release | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: | ||
- 'v*.*.*' | ||
pull_request: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
goreleaser: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: Set the release related variables | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
run: | | ||
echo RELEASE_ARGS="--clean" >> $GITHUB_ENV | ||
echo ENABLE_RELEASE_PIPELINE=true >> $GITHUB_ENV | ||
- name: Run GoReleaser | ||
run: make release | ||
env: | ||
RELEASE_ARGS: release --rm-dist | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
- name: Update new version in krew-index | ||
uses: rajatjindal/krew-release-bot@v0.0.38 | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
uses: rajatjindal/krew-release-bot@v0.0.46 |
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 |
---|---|---|
|
@@ -36,3 +36,6 @@ archives: | |
format: tar.gz | ||
files: | ||
- LICENSE | ||
|
||
release: | ||
disable: '{{ ne .Env.ENABLE_RELEASE_PIPELINE "true" }}' |
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
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