-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: simplify release workflow by removing unnecessary steps and upda…
…ting actions
- Loading branch information
Showing
1 changed file
with
18 additions
and
26 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 |
---|---|---|
@@ -1,38 +1,30 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
tags: | ||
- "v*.*.*" | ||
pull_request: | ||
types: | ||
- labeled | ||
- "v*" | ||
|
||
jobs: | ||
release: | ||
if: github.event.action != 'labeled' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # これがないとリリースを作成できない | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# チェックアウト | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Changelog を正しく動作させるために必要 | ||
|
||
# Bump version on merging Pull Requests with specific labels. | ||
# (bump:major,bump:minor,bump:patch) | ||
- id: bumpr | ||
if: "!startsWith(github.ref, 'refs/tags/')" | ||
uses: haya14busa/action-bumpr@v1 | ||
# Go をセットアップ | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: go.mod | ||
cache: true | ||
|
||
# Update corresponding major and minor tag. | ||
# e.g. Update v1 and v1.2 when releasing v1.2.3 | ||
- uses: haya14busa/action-update-semver@v1 | ||
if: "!steps.bumpr.outputs.skip" | ||
# リリース | ||
- uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
tag: ${{ steps.bumpr.outputs.next_version }} | ||
release-check: | ||
if: github.event.action == 'labeled' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Post bumpr status comment | ||
uses: haya14busa/action-bumpr@v1 | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 自動で生成されるシークレット |