-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add release workflow to GitHub Actions (#55)
- Loading branch information
1 parent
03d547b
commit dbe14fc
Showing
1 changed file
with
55 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
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@v3 | ||
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@v3 | ||
with: | ||
go-version-file: go.mod | ||
cache: true | ||
- name: run goreleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }} | ||
with: | ||
args: release --rm-dist |