-
Notifications
You must be signed in to change notification settings - Fork 2.2k
57 lines (46 loc) · 1.41 KB
/
publish.yml
File metadata and controls
57 lines (46 loc) · 1.41 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Publish
on:
workflow_dispatch:
inputs:
version:
description: 'Version to publish (e.g., 0.1.1, 0.2.0, 1.0.0)'
required: true
type: string
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: voidzero-dev/setup-vp@v1
with:
node-version: 25
registry-url: 'https://registry.npmjs.org'
- run: vp check
- run: vpr typecheck
- run: vpr eslint
- run: vp pack
- run: vp build
- name: Install Playwright Browsers
run: vpx playwright install chromium firefox
- run: vp test
timeout-minutes: 4
- name: Update version
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
vp env exec npm version ${{ inputs.version }}
# https://docs.npmjs.com/trusted-publishers
- name: Publish to npm
run: vp env exec npm publish --tag latest
- name: Push tag
run: git push origin v${{ inputs.version }}
- name: Create GitHub Release
run: gh release create v${{ inputs.version }} --title "v${{ inputs.version }}" --generate-notes
env:
GH_TOKEN: ${{ github.token }}