-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(release): adds semantic-release support
This shifts the release workflow to run after a successful CI run. It then generates a new semantic version and then runs the go-releaser on that version.
- Loading branch information
Showing
1 changed file
with
17 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,15 +11,20 @@ | |
# | ||
name: release | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
workflow_run: | ||
types: ["completed"] | ||
workflows: ["CI"] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Unshallow | ||
run: git fetch --prune --unshallow | ||
- name: Set up Go | ||
|
@@ -33,6 +38,15 @@ jobs: | |
# These secrets will need to be configured for the repository: | ||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | ||
PASSPHRASE: ${{ secrets.PASSPHRASE }} | ||
- uses: go-semantic-release/action@v1 | ||
id: release | ||
with: | ||
github-token: ${{ inputs.github-token }} | ||
- name: Fetch Tags | ||
shell: bash | ||
run: | | ||
git fetch --tags | ||
git clean -fd | ||
- name: Run GoReleaser | ||
uses: goreleaser/[email protected] | ||
with: | ||
|