-
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.
Merge pull request #8 from odanado/main
Release new version: v0.2.0
- Loading branch information
Showing
8 changed files
with
239 additions
and
15 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,88 @@ | ||
name: Check Release | ||
on: | ||
pull_request: | ||
branches: | ||
- release/cli | ||
types: | ||
- labeled | ||
- unlabeled | ||
- synchronize | ||
- opened | ||
|
||
jobs: | ||
check-label: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
level: ${{ steps.release-label.outputs.level }} | ||
steps: | ||
- uses: actions-ecosystem/action-release-label@v1 | ||
id: release-label | ||
with: | ||
label_prefix: "bump:" | ||
|
||
find-comment: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
steps: | ||
- name: Find Comment | ||
uses: peter-evans/find-comment@v3 | ||
id: fc | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
comment-author: "github-actions[bot]" | ||
body-includes: "🤖 **Check Release**" | ||
|
||
notify-new-version: | ||
runs-on: ubuntu-latest | ||
needs: [check-label, find-comment] | ||
if: ${{ needs.check-label.outputs.level != null }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions-ecosystem/action-get-latest-tag@v1 | ||
id: get-latest-tag | ||
- uses: actions-ecosystem/action-bump-semver@v1 | ||
id: bump-semver | ||
with: | ||
current_version: ${{ steps.get-latest-tag.outputs.tag }} | ||
level: ${{needs.check-label.outputs.level }} | ||
|
||
- name: Create or update comment | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
comment-id: ${{ needs.find-comment.outputs.comment-id }} | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
🤖 **Check Release** | ||
If you merge this pull request, the version of the CLI tool will be released. | ||
- Current Version: ${{ steps.get-latest-tag.outputs.tag }} | ||
- New Version: ${{ steps.bump-semver.outputs.new_version }} | ||
edit-mode: replace | ||
|
||
- name: Update title of pull request | ||
run: | | ||
gh pr edit ${{ github.event.pull_request.number }} --title "Release new version: ${{ steps.bump-semver.outputs.new_version }}" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
notify-please-add-label: | ||
runs-on: ubuntu-latest | ||
needs: [check-label, find-comment] | ||
if: ${{ needs.check-label.outputs.level == null }} | ||
steps: | ||
- name: Create or update comment | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
comment-id: ${{ needs.find-comment.outputs.comment-id }} | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
🤖 **Check Release** | ||
You forgot to add a label to bump the version. | ||
Please add a label `bump:patch`, `bump:minor`, or `bump:major` to this pull request. | ||
edit-mode: replace | ||
|
||
- name: Update title of pull request | ||
run: | | ||
gh pr edit ${{ github.event.pull_request.number }} --title "Release new version" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,28 @@ | ||
name: Create Release Pull Request | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
create-release-pr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: stable | ||
- name: Build | ||
run: go build -v ./... | ||
|
||
- uses: actions/create-github-app-token@v1 | ||
id: app-token | ||
with: | ||
app-id: ${{ vars.APP_ID }} | ||
private-key: ${{ secrets.PRIVATE_KEY }} | ||
|
||
- run: ./git-pr-release-go --from main --to release/cli | ||
env: | ||
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} |
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,48 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- release/cli | ||
|
||
jobs: | ||
get-release-level: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
value: ${{ steps.release-label.outputs.level }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions-ecosystem/action-get-merged-pull-request@v1 | ||
id: get-merged-pull-request | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: actions-ecosystem/action-release-label@v1 | ||
id: release-label | ||
with: | ||
labels: ${{ steps.get-merged-pull-request.outputs.labels }} | ||
label_prefix: "bump:" | ||
|
||
goreleaser: | ||
runs-on: ubuntu-latest | ||
needs: [get-release-level] | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: stable | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
version: ${{ needs.get-release-level.outputs.value }} | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,5 +1,18 @@ | ||
Release {{date}} | ||
# PRs | ||
|
||
{{#pull_requests}} | ||
- #{{number}} | ||
{{/pull_requests}} | ||
{{^pull_requests}} | ||
Nothing. | ||
{{/pull_requests}} | ||
|
||
# Commits | ||
|
||
{{#commits}} | ||
- {{commit.message}}: {{sha}} | ||
{{/commits}} | ||
{{^commits}} | ||
Nothing. | ||
{{/commits}} |
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
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
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
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