-
Notifications
You must be signed in to change notification settings - Fork 72
46 lines (44 loc) · 1.38 KB
/
version-bump.yml
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
name: Bump and release NPM Version
on:
push:
branches:
- master
# file paths to consider in the event. Optional; defaults to all.
paths-ignore:
- 'package.json'
- 'package-lock.json'
jobs:
build:
runs-on: ubuntu-latest
outputs:
nodeVersion: ${{ steps.bump_version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20'
- name: bump version
id: bump_version
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
echo "::set-output name=version::$(echo $(node -p "require('./package.json').version.trim()"))"
npm version patch
git push
release:
runs-on: ubuntu-latest
needs: build
steps:
- name: draft release
id: draft_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ needs.build.outputs.nodeVersion }}
release_name: Release ${{ needs.build.outputs.nodeVersion }}
body: |
Releasing version ${{ needs.build.outputs.nodeVersion }} to NPM
draft: true
prerelease: false