Skip to content

Commit cd43501

Browse files
authored
feat: add auto version bump
1 parent 81f8ddc commit cd43501

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/version-bump.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Version Bump and Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
bump-version:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: '16'
20+
21+
- name: Install dependencies
22+
run: npm install
23+
24+
- name: Bump version and push
25+
run: |
26+
git config user.name "github-actions[bot]"
27+
git config user.email "github-actions[bot]@users.noreply.github.com"
28+
npm version patch -m "Bump version to %s [skip ci]"
29+
git push --follow-tags
30+
31+
- name: Create a pull request for the new version
32+
uses: peter-evans/create-pull-request@v5
33+
with:
34+
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 }}."
38+
labels: version-bump
39+
40+
notify-users:
41+
needs: bump-version
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Send notification to users
45+
run: |
46+
echo "Sending notification to users about the new version..."
47+
# You can customize this step to send notifications through email, Slack, or other channels.

0 commit comments

Comments
 (0)