-
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.
ci: set up workflows which generate changelog, trigger GitHub's relea…
…se and save rc to the artifacts (#42)
- Loading branch information
Showing
4 changed files
with
142 additions
and
8 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
required: false | ||
description: 'Next version ( NOTE: Switch the branch to "release"!)' | ||
type: choice | ||
default: minor | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
if: github.ref == "refs/heads/release" | ||
steps: | ||
- name: git config | ||
env: | ||
GPT_USER: ${{ secrets.GPT_USER }} | ||
run: | | ||
git config --global user.name $GPT_USER | ||
git config --global pull.rebase false | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GPT }} | ||
- id: changelog | ||
name: Generate CHANGELOG | ||
uses: reearth/changelog-action@main | ||
with: | ||
version: ${{ github.event.inputs.version }} | ||
repo: ${{ github.repository }} | ||
latest: CHANGELOG_latest.md | ||
- name: Upload latest CHANGELOG | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: changelog-${{ steps.changelog.outputs.version }} | ||
path: CHANGELOG_latest.md | ||
- name: Commit & push to release | ||
env: | ||
TAG: ${{ steps.changelog.outputs.version }} | ||
run: | | ||
rm CHANGELOG_latest.md | ||
git add CHANGELOG.md | ||
git commit -am "$TAG" | ||
git tag $TAG | ||
git push --atomic origin release $TAG | ||
- name: Commit & push to main | ||
run: git switch main && git cherry-pick release && git push |
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,26 @@ | ||
name: Stage | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
stage: | ||
name: Stage | ||
runs-on: ubuntu-latest | ||
if: github.ref == "refs/heads/main" | ||
steps: | ||
- uses: git config | ||
env: | ||
GPT_USER: ${{ secrets.GPT_USER }} | ||
run: | ||
git config --global user.name $GPT_USER | ||
git config --global pull.rebase false | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GPT }} | ||
- name: Checkout release branch | ||
run: git switch release || git switch -c release | ||
- name: Merge main branch to release branch | ||
run: git merge -X theirs main | ||
- name: Git push | ||
run: git push origin release |