Repository navigation
56 lines (56 loc) · 1.66 KB
/
Copy pathrelease.yml
File metadata and controls
56 lines (56 loc) · 1.66 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
name: Check and release npm package
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
inputs:
publish:
description: Publish the checked version to npm
type: boolean
default: false
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['18', '20', '22', '24']
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm run typecheck
- run: npm run build
- run: python3 .ci/check.py
- run: node test/require_check.cjs
- run: npm pack
- run: tar -tzf transcriptdock-0.1.0.tgz
publish:
if: github.event_name == 'workflow_dispatch' && inputs.publish && github.ref == 'refs/heads/main'
needs: test
runs-on: ubuntu-latest
environment: npm
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
# Trusted publishing (OIDC) needs npm 11.5.1 or newer.
- run: npm install --global npm@11.21.1
- run: npm ci
- run: npm run build
- run: python3 .ci/check.py
- run: npm publish --provenance --access public