-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (34 loc) · 1.12 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
name: NPM Publish
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.release.target_commitish }}
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: git config --global user.name "Michael Heap"
- run: git config --global user.email "[email protected]"
- run: npm version ${{ github.event.release.tag_name }}
- run: npm run build --if-present
- run: npm test --if-present
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: git push
env:
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: git tag -f ${{ github.event.release.tag_name }} ${{ github.event.release.target_commitish }}
env:
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: git push origin ${{ github.event.release.tag_name }} --force
env:
github-token: ${{ secrets.GITHUB_TOKEN }}