-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (42 loc) · 1.25 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
name: Publish
on:
push:
tags:
- '*.*.*'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.11'
- run: npm i
- run: |
npm run build
cp README.md packages/playground/
- run: |
TAG='latest'
PRERELEASE=false
if [[ $GITHUB_REF_NAME =~ 'alpha' || $GITHUB_REF_NAME =~ 'beta' || $GITHUB_REF_NAME =~ 'rc' ]]; then
TAG='next'
PRERELEASE=true
fi
echo "NPM_TAG=$PRERELEASE" >> $GITHUB_ENV
echo "IS_PRERELEASE=$PRERELEASE" >> $GITHUB_ENV
- uses: JS-DevTools/npm-publish@v3
with:
provenance: true
package: packages/playground/
tag: ${{ env.NPM_TAG }}
token: ${{ secrets.NPM_TOKEN }}
- uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref }}
name: v${{ github.ref_name }}
body: Please refer to [CHANGELOG.md](https://github.com/studiometa/playground/blob/${{ github.ref_name }}/CHANGELOG.md) for details.
draft: false
prerelease: ${{ env.IS_PRERELEASE }}