Skip to content

Commit 8c65353

Browse files
Copilotchrisribe
andcommitted
Add GitHub Actions workflow for auto-version bumping on main branch
Co-authored-by: chrisribe <1999791+chrisribe@users.noreply.github.com>
1 parent 62f0b1f commit 8c65353

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Auto Version Bump
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '**.md'
9+
- 'docs/**'
10+
- '.github/**'
11+
12+
jobs:
13+
bump-version:
14+
runs-on: ubuntu-latest
15+
16+
# Skip if commit message contains [skip-version] or is from the bot itself
17+
if: "!contains(github.event.head_commit.message, '[skip-version]') && github.event.head_commit.author.name != 'github-actions[bot]'"
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
with:
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
fetch-depth: 0
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '20'
30+
cache: 'npm'
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Bump version and build
36+
run: npm run build:release
37+
38+
- name: Configure git
39+
run: |
40+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
41+
git config --local user.name "github-actions[bot]"
42+
43+
- name: Commit version bump
44+
run: |
45+
git add package.json
46+
git commit -m "chore: bump version [skip-version]" || echo "No changes to commit"
47+
48+
- name: Push changes
49+
run: git push
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)