Repository navigation
41 lines (38 loc) · 1.63 KB
/
Copy pathrelease.yml
File metadata and controls
41 lines (38 loc) · 1.63 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: Release packages
# Publishes @luxalgo/journal-core and @luxalgo/journal-importers to npm via
# trusted publishing (OIDC), no NPM_TOKEN secret. Run it manually from the
# Actions tab after bumping the package versions; tags never publish, so
# cutting a GitHub Release is always safe.
#
# One-time setup per package on npmjs.com (Package Settings -> Trusted
# Publisher -> GitHub Actions): org "LuxAlgo", repo "trade-journal",
# workflow filename "release.yml", and check "Allow npm publish".
# Note: OIDC cannot create a brand-new package (npm/cli#8544), so the first
# version of each package must be published once with credentials before
# the trusted publisher can be attached.
on:
workflow_dispatch:
permissions:
contents: read
id-token: write # npm provenance (OIDC)
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
# pnpm version comes from the packageManager field in package.json
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
registry-url: https://registry.npmjs.org
- run: pnpm install --frozen-lockfile
- run: pnpm typecheck
- run: pnpm test
- run: pnpm -r --filter "./packages/*" build
# pnpm rewrites workspace:* to the real version in the published tarball
# and applies each package's publishConfig (dist entry points). Auth and
# provenance come from the OIDC exchange (id-token: write above); no
# static token must be present or npm may fall back to token auth.
- run: pnpm -r --filter "./packages/*" publish --access public --no-git-checks