-
Notifications
You must be signed in to change notification settings - Fork 15
39 lines (39 loc) · 1.23 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
name: Automatic Publish
on:
push:
branches:
- master
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
check-latest: true
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
# TODO: remove once rollup-plugin-dts releases a version including https://github.com/Swatinem/rollup-plugin-dts/pull/294
run: npm install -g npm && npm install --legacy-peer-deps
- name: Publish
run: |
if git log -1 --pretty=%B | grep "^release: [0-9]\+\.[0-9]\+\.[0-9]\+$";
then
npm publish --provenance --access public
elif git log -1 --pretty=%B | grep "^release: [0-9]\+\.[0-9]\+\.[0-9]\+";
then
npm publish --tag next --provenance --access public
else
echo "Not a release, skipping publish"
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}