-
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.
chore: bump version (major, minor, patch) 자동화 스크립트 작성
- Loading branch information
1 parent
1754f72
commit b60a8d9
Showing
3 changed files
with
109 additions
and
3 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,46 @@ | ||
name: Bump Version (Major) | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
NODE_VERSION: 22 | ||
NPM_REGISTRY: https://registry.npmjs.org/ | ||
|
||
jobs: | ||
bump-version: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Code Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: SetUp Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{env.NODE_VERSION}} | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- name: Get GitHub User Info | ||
id: user_info | ||
run: | | ||
# GitHub API를 사용하여 트리거한 사용자의 이메일과 이름 가져오기 | ||
user_name="${{ github.actor }}" | ||
user_email=$(curl -s https://api.github.com/users/${{ github.actor }} | jq -r '.email') | ||
if [ -z "$user_email" ] || [ "$user_email" = "null" ]; then | ||
user_email="${{ github.actor }}@users.noreply.github.com" | ||
fi | ||
echo "user_name=$user_name" >> $GITHUB_ENV | ||
echo "user_email=$user_email" >> $GITHUB_ENV | ||
- name: Bump Version (Major) | ||
run: | | ||
git config --global user.email "${{ env.user_email }}" | ||
git config --global user.name "${{ env.user_name }}" | ||
npm version major | ||
git push origin main --tag |
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,46 @@ | ||
name: Bump Version (Minor) | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
NODE_VERSION: 22 | ||
NPM_REGISTRY: https://registry.npmjs.org/ | ||
|
||
jobs: | ||
bump-version: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Code Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: SetUp Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{env.NODE_VERSION}} | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- name: Get GitHub User Info | ||
id: user_info | ||
run: | | ||
# GitHub API를 사용하여 트리거한 사용자의 이메일과 이름 가져오기 | ||
user_name="${{ github.actor }}" | ||
user_email=$(curl -s https://api.github.com/users/${{ github.actor }} | jq -r '.email') | ||
if [ -z "$user_email" ] || [ "$user_email" = "null" ]; then | ||
user_email="${{ github.actor }}@users.noreply.github.com" | ||
fi | ||
echo "user_name=$user_name" >> $GITHUB_ENV | ||
echo "user_email=$user_email" >> $GITHUB_ENV | ||
- name: Bump Version (Minor) | ||
run: | | ||
git config --global user.email "${{ env.user_email }}" | ||
git config --global user.name "${{ env.user_name }}" | ||
npm version minor | ||
git push origin main --tag |
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 |
---|---|---|
|
@@ -24,9 +24,23 @@ jobs: | |
node-version: ${{env.NODE_VERSION}} | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- name: Get GitHub User Info | ||
id: user_info | ||
run: | | ||
# GitHub API를 사용하여 트리거한 사용자의 이메일과 이름 가져오기 | ||
user_name="${{ github.actor }}" | ||
user_email=$(curl -s https://api.github.com/users/${{ github.actor }} | jq -r '.email') | ||
if [ -z "$user_email" ] || [ "$user_email" = "null" ]; then | ||
user_email="${{ github.actor }}@users.noreply.github.com" | ||
fi | ||
echo "user_name=$user_name" >> $GITHUB_ENV | ||
echo "user_email=$user_email" >> $GITHUB_ENV | ||
- name: Bump Version (Patch) | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "principes-getp" | ||
git config --global user.email "${{ env.user_email }}" | ||
git config --global user.name "${{ env.user_name }}" | ||
npm version patch | ||
git push origin main | ||
git push origin main --tag |