-
Notifications
You must be signed in to change notification settings - Fork 24
36 lines (33 loc) · 1.27 KB
/
publish-reporter-to-npm.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
name: Publish REPORTER
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}
- uses: actions/setup-node@v4
with:
node-version: 16
- run: npm i
- run: git config --global user.name "GitHub CD bot"
- run: git config --global user.email "github-cd-bot@example.com"
- run: npm version ${{ github.event.release.tag_name }}
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
# use "beta" tag if relevant, otherwise use "latest"
tag: ${{ contains(github.event.release.tag_name, 'beta') && 'beta' || 'latest' }}
- name: update Chagelog.md with autogenerated release notes
run: |
echo "\n\n\n## Release ${{ github.event.release.tag_name }}\n\n" >> Changelog.md
echo "${{ github.event.release.body }}" >> Changelog.md
if: contains(github.event.release.tag_name, 'beta') == false
- name: commit version to package.json (only for not beta release)
run: git push
if: contains(github.event.release.tag_name, 'beta') == false
env:
github-token: ${{ secrets.GITHUB_TOKEN }}