-
Notifications
You must be signed in to change notification settings - Fork 5
37 lines (37 loc) · 1.18 KB
/
release.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
name: Github Release
on:
pull_request:
types: [closed]
branch: main
jobs:
release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.AUTH_TOKEN }}
- uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- name: Set up git user for release
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
- run: npm run release
- name: Push changes
run: git push --follow-tags origin main
- run: npm run build
- run: npm run test
- name: Get version from package-lock.json
id: get_version
run: echo "::set-output name=version::$(node -p "require('./package-lock.json').version")"
- name: Create Release
uses: actions/create-release@master
env:
GITHUB_TOKEN: ${{ secrets.AUTH_TOKEN }}
with:
tag_name: "v${{ steps.get_version.outputs.version }}"
release_name: "v${{ steps.get_version.outputs.version }}"