-
Notifications
You must be signed in to change notification settings - Fork 7
38 lines (31 loc) · 925 Bytes
/
push.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
name: Publish
on: push
jobs:
build:
name: Publish to npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org/'
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Install dependencies
run: ./init.sh
- name: Run tests
run: npm run test
- name: Build
run: npm run build
- name: Dry-run release
run: npm run release:dryrun
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Release
run: npm run release
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}