-
Notifications
You must be signed in to change notification settings - Fork 20
36 lines (30 loc) · 989 Bytes
/
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
name: NPM publish
on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
jobs:
test:
uses: ./.github/workflows/core.yml
secrets:
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
release:
needs: test
runs-on: ubuntu-latest
env:
IS_SNAPSHOT: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: "16.x"
cache: yarn
- if: ${{ fromJSON(env.IS_SNAPSHOT) }}
run: yarn workspaces foreach version 0.0.0-snapshot.$(git rev-parse --short HEAD)
- run: yarn install --immutable
- run: yarn build
- run: yarn config set npmAuthToken ${{ secrets.NPM_TOKEN }}
- run: yarn workspaces foreach --no-private npm publish --tolerate-republish --access public ${{ fromJSON(env.IS_SNAPSHOT) && '--tag snapshot' || '' }}