-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (45 loc) · 1.33 KB
/
publish.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
47
48
49
50
51
52
53
54
55
56
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: Publish
on:
release:
types: [created]
jobs:
publish-npm:
runs-on: 'ubuntu-latest'
steps:
- name: Checkout
uses: 'actions/[email protected]'
with:
ref: master
- name: Node setup
uses: 'actions/[email protected]'
with:
node-version: 16
registry-url: 'https://registry.npmjs.org/'
- name: Git configuration
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions"
- name: Installation
run: 'npm ci'
- name: Build
run: 'npm run build'
- name: Determine new version
run: |
echo "$GITHUB_REF"
IFS='/' read -ra PARTS <<< "$GITHUB_REF"
NEW_VERSION="${PARTS[2]}"
echo "$NEW_VERSION"
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
- name: Bump version
run: |
npm version ${{ env.NEW_VERSION }}
git status
- name: Commit and push
run: |
git status
git push
- name: Publish
run: 'npm publish'
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}