Skip to content

Commit d7c41cb

Browse files
authored
fix: auto bump
1 parent cd43501 commit d7c41cb

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

.github/workflows/version-bump.yml

+17-7
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,32 @@ jobs:
1919
node-version: '16'
2020

2121
- name: Install dependencies
22-
run: npm install
22+
run: yarn install
2323

24-
- name: Bump version and push
24+
- name: Bump version
25+
run: |
26+
yarn version --patch --no-commit-hooks --no-git-tag-version
27+
28+
- name: Get new version
29+
id: new_version
30+
run: echo "NEW_VERSION=$(node -p -e \"require('./package.json').version\")" >> $GITHUB_ENV
31+
32+
- name: Commit and push changes
2533
run: |
2634
git config user.name "github-actions[bot]"
2735
git config user.email "github-actions[bot]@users.noreply.github.com"
28-
npm version patch -m "Bump version to %s [skip ci]"
36+
git add package.json yarn.lock
37+
git commit -m "Bump version to ${{ env.NEW_VERSION }} [skip ci]"
38+
git tag "v${{ env.NEW_VERSION }}"
2939
git push --follow-tags
3040
3141
- name: Create a pull request for the new version
3242
uses: peter-evans/create-pull-request@v5
3343
with:
3444
branch: bump-version
35-
commit-message: "Bump version to ${{ steps.bump.outputs.new-version }}"
36-
title: "Bump version to ${{ steps.bump.outputs.new-version }}"
37-
body: "This PR bumps the package version to ${{ steps.bump.outputs.new-version }}."
45+
commit-message: "Bump version to ${{ env.NEW_VERSION }}"
46+
title: "Bump version to ${{ env.NEW_VERSION }}"
47+
body: "This PR bumps the package version to ${{ env.NEW_VERSION }}."
3848
labels: version-bump
3949

4050
notify-users:
@@ -44,4 +54,4 @@ jobs:
4454
- name: Send notification to users
4555
run: |
4656
echo "Sending notification to users about the new version..."
47-
# You can customize this step to send notifications through email, Slack, or other channels.
57+
# Customize this step to send notifications through email, Slack, or other channels.

0 commit comments

Comments
 (0)