Skip to content

Commit cebf211

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

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/bump-version.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
jobs:
18+
bump-version:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out source
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version-file: '.nvmrc'
28+
29+
- name: Setup Git
30+
run: |
31+
git config user.name 'github-actions[bot]'
32+
git config user.email 'github-actions[bot]@users.noreply.github.com'
33+
34+
- name: Bump version
35+
run: npm version ${{ github.event.inputs.version }}
36+
37+
- name: Push latest version
38+
run: git push origin main --follow-tags

0 commit comments

Comments
 (0)