-
-
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.
ci: create release related workflows and config files
- Loading branch information
1 parent
eed15dc
commit 61983c6
Showing
3 changed files
with
123 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,54 @@ | ||
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuration-options | ||
|
||
changelog: | ||
exclude: | ||
labels: | ||
- release | ||
|
||
categories: | ||
- title: 🚀 Features | ||
labels: | ||
- feat | ||
|
||
- title: 🐛 Bug Fixes | ||
labels: | ||
- fix | ||
|
||
- title: ⚡ Performance | ||
labels: | ||
- perf | ||
|
||
- title: ♻️ Refactoring | ||
labels: | ||
- rafactor | ||
- rename | ||
- remove | ||
|
||
- title: 🧪 Tests | ||
labels: | ||
- test | ||
|
||
- title: ⬆️ Dependency Updates | ||
labels: | ||
- dependencies | ||
|
||
- title: 🔄 Continuous Integration | ||
labels: | ||
- build | ||
- ci | ||
|
||
- title: 🧰 Maintenance | ||
labels: | ||
- '*' | ||
exclude: | ||
labels: | ||
- feat | ||
- fix | ||
- perf | ||
- refactor | ||
- rename | ||
- remove | ||
- test | ||
- dependencies | ||
- build | ||
- ci |
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,68 @@ | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
type: | ||
description: Select the type of version bump | ||
required: true | ||
type: choice | ||
default: patch | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
|
||
jobs: | ||
bump: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- name: Set up checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: .nvmrc | ||
cache: npm | ||
|
||
- name: Set up cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
|
||
- name: Set up node_modules | ||
run: npm ci | ||
|
||
- name: Set up environment variables | ||
run: | | ||
echo "SHORT_SHA=${GITHUB_SHA:0:7}" >> $GITHUB_ENV | ||
echo "OLD_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV | ||
- name: Bump | ||
run: | | ||
git config --global user.name 'github-actions' | ||
git config --global user.email '[email protected]' | ||
git switch -c release-${{ inputs.type }}-${{ env.SHORT_SHA }} | ||
npm version ${{ inputs.type }} -m "release(${{ inputs.type }}): v%s" | ||
- name: Set up environment variables | ||
run: echo "NEW_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV | ||
|
||
- name: Push | ||
run: git push --set-upstream origin release-${{ inputs.type }}-${{ env.SHORT_SHA }} | ||
|
||
- name: Create pull request | ||
run: | | ||
gh api \ | ||
--method POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
/repos/${{ github.repository }}/pulls \ | ||
-f "title=release(${{ inputs.type }}): v${{ env.NEW_VERSION }}" \ | ||
-f "body=Bump \`${{ github.repository }}\` from v${{ env.OLD_VERSION }} to v${{ env.NEW_VERSION }} :tada:" \ | ||
-f "head=${{ github.repository_owner }}:release-${{ inputs.type }}-${{ env.SHORT_SHA }}" \ | ||
-f "base=main" |
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,6 @@ | ||
{ | ||
"private": true, | ||
"version": "0.0.0", | ||
"scripts": { | ||
"prepare": "husky", | ||
"dev": "next dev", | ||
|