Skip to content

Commit

Permalink
ci(release): adds semantic-release support
Browse files Browse the repository at this point in the history
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
greenkiwi committed Feb 23, 2022
1 parent 49a08be commit ea35012
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit ea35012

Please sign in to comment.