-
Notifications
You must be signed in to change notification settings - Fork 13
43 lines (35 loc) · 1.05 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
name: publish
on:
push:
tags:
- "*"
jobs:
publish:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- id: dist-tag
uses: actions/github-script@v7
with:
result-encoding: string
script: |
return /^refs\/tags\/v\d+\.\d+\.\d+$/.test(context.ref) ? "latest" : "next"
- name: npm publish
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ~/.npmrc
npm whoami
npm ci
npm run bootstrap
npm publish --access=public --tag ${{ steps.dist-tag.outputs.result }} --workspace="packages/prisma-fabbrica"
if: contains(github.ref, 'tags/v')
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
CI: true