-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.55 KB
/
version-bump.yaml
File metadata and controls
56 lines (46 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Version Bump
on:
push:
branches:
- main
jobs:
version-bump:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to get all tags
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Configure Git
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Bump version and push tag
id: bump_version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: patch
release_branches: main
dry_run: false
- name: Update package.json with new version
run: |
npm version ${{ steps.bump_version.outputs.new_tag }} --no-git-tag-version
- name: Commit version bump
run: |
git add package.json
git commit -m "chore: bump version to ${{ steps.bump_version.outputs.new_tag }}"
git push
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.bump_version.outputs.new_tag }}
name: Release ${{ steps.bump_version.outputs.new_tag }}
body: ${{ steps.bump_version.outputs.changelog }}
generateReleaseNotes: true