-
Notifications
You must be signed in to change notification settings - Fork 7
41 lines (39 loc) · 1.18 KB
/
publish.yml
File metadata and controls
41 lines (39 loc) · 1.18 KB
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
name: Publish Latest
permissions:
contents: read
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'
jobs:
publish:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [22.18.0]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Set Tag env
run: echo "NPM_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- run: pnpm exec playwright install
- run: pnpm run test
- run: pnpm run build
- run: pnpm publish --no-git-checks --tag rc ./lib --access public
if: contains(env.NPM_TAG, 'rc')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: pnpm publish --no-git-checks --tag latest ./lib --access public
if: "!contains(env.NPM_TAG, 'rc')"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}