Repository navigation
65 lines (49 loc) · 1.65 KB
/
Copy pathrelease.yml
File metadata and controls
65 lines (49 loc) · 1.65 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
58
59
60
61
62
63
64
65
name: Test & Release
on: [push, pull_request]
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
tests:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '18', '20' ]
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- run: pnpm install
- run: pnpm build
- run: pnpm test:packages
- run: pnpm lint
- run: pnpm lint:attw
- run: pnpm lint:publint
# Catches `workspace:`-style ranges that would ship to the registry
# uninstallable. publint and attw both pass such a manifest.
- run: pnpm lint:manifests
release:
name: Release
if: ${{ github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'beta') }}
needs: tests
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: '22.14.0'
# @semantic-release/npm bundles its own `npm` dependency, but under pnpm's
# dependency isolation that copy isn't reachable via execa's `preferLocal` from
# other packages - it falls back to whatever `npm` is on PATH. That needs to be
# recent enough to support Trusted Publishers (OIDC), hence installing it here
# explicitly rather than relying on whatever Node bundles.
- run: npm install -g npm@11
- run: pnpm install
- run: pnpm release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}