Skip to content

Commit e4556e8

Browse files
committed
ci: add bump version workflow
1 parent 864f718 commit e4556e8

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/bump-version.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Bump version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Semver type of new version (major / minor / patch)'
8+
required: true
9+
type: choice
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
- prerelease --preid=beta
15+
- prerelease --preid=rc
16+
17+
permissions:
18+
contents: write
19+
20+
jobs:
21+
bump-version:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Check out source
25+
uses: actions/checkout@v4
26+
with:
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version-file: '.nvmrc'
33+
34+
- name: Setup Git
35+
run: |
36+
git config user.name 'github-actions[bot]'
37+
git config user.email 'github-actions[bot]@users.noreply.github.com'
38+
39+
- name: Bump version
40+
run: npm version ${{ github.event.inputs.version }}
41+
42+
- name: Push latest version
43+
run: git push origin main --follow-tags

0 commit comments

Comments
 (0)