release cli to the GitHub Release #6
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 cli to the GitHub Release | |
on: | |
workflow_dispatch: | |
inputs: | |
method: | |
description: | | |
Which number to increment in the semantic versioning. | |
Set 'major', 'minor', or 'patch'. | |
required: true | |
jobs: | |
release: | |
name: release | |
runs-on: ubuntu-latest | |
steps: | |
- name: check actor | |
if: github.actor != 'JunNishimura' | |
run: exit 1 | |
- name: check branch | |
if: github.ref != 'refs/heads/main' | |
run: exit 1 | |
- name: wait tests | |
id: test_result | |
uses: Sibz/[email protected] | |
with: | |
contexts: test-status | |
authToken: ${{ secrets.GITHUB_TOKEN }} | |
timeout: 30 | |
- name: check test result | |
if: steps.test_result.outputs.result != 'success' | |
run: | | |
echo "failed ${{ steps.test_result.outputs.failedCheckNames }}" | |
echo "failed ${{ steps.test_result.outputs.failedCheckStates }}" | |
exit 1 | |
- name: checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: bump-up semantic version | |
uses: kyoh86/[email protected] | |
with: | |
method: "${{ github.event.inputs.method }}" | |
- name: setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
cache: false | |
- name: run goreleaser | |
uses: goreleaser/goreleaser-action@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }} | |
with: | |
args: release --clean |