Release #1
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
--- | |
name: Release | |
on: workflow_dispatch | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
tag: | |
name: Tag | |
runs-on: ubuntu-latest | |
permissions: | |
# NOTE: necessary to apply the git tag. | |
contents: write | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
with: | |
# Using this to pick up the latest tag. | |
fetch-depth: 0 | |
- name: Get next version | |
id: semver | |
uses: ietf-tools/semver-action@v1 | |
with: | |
token: ${{ github.token }} | |
branch: main | |
- name: Push new version tag | |
uses: rickstaa/action-create-tag@v1 | |
if: ${{ contains(github.ref, 'main') }} # only push tags if on main branch. | |
with: | |
tag: ${{ steps.semver.outputs.next }} | |
tag_exists_error: false | |
force_push_tag: true | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: [tag] | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.21' | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ github.token }} |