Release binary to the GitHub Release #9
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 binary to the GitHub Release | |
on: | |
workflow_dispatch: | |
inputs: | |
method: | |
description: | | |
Which number to increment in the semantic versioning. | |
required: true | |
type: choice | |
options: | |
- major | |
- minor | |
- patch | |
jobs: | |
release-binary: | |
name: Release Binary | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check Actor | |
if: github.actor != 'kyoh86' | |
run: exit 1 | |
- name: Check Branch | |
if: github.ref != 'refs/heads/main' | |
run: exit 1 | |
- name: Wait commit status | |
uses: cloudposse/github-action-wait-commit-status@main | |
with: | |
repository: ${{ github.repository }} | |
sha: ${{ github.sha }} | |
status: releasable | |
token: ${{ github.token }} | |
check-retry-count: 5 | |
check-retry-interval: 20 | |
- name: Checkout Sources | |
uses: actions/checkout@v4 | |
- name: Bump-up Semantic Version | |
uses: kyoh86/git-vertag-action@v1 | |
with: | |
# method: "major", "minor" or "patch" to update tag with semver | |
method: "${{ github.event.inputs.method }}" | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23 | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v6 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }} | |
with: | |
version: ~> v2 | |
args: release --clean |