-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (46 loc) · 1.8 KB
/
Copy pathrelease.yml
File metadata and controls
48 lines (46 loc) · 1.8 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
name: release
# Mirror of ModernRelay/omnigraph-ts: bump packages/cli's version, push a
# matching `vX.Y.Z` tag, and this publishes @modernrelay/notebook to npm.
# Requires an `NPM_TOKEN` repo secret with publish rights to the @modernrelay scope.
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # npm provenance
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
registry-url: 'https://registry.npmjs.org'
- run: pnpm install --frozen-lockfile
# Build the whole workspace so the CLI's bundle can resolve every
# @modernrelay/notebook-* lib's dist + the web SPA it copies into web-dist/.
- run: pnpm -r build
- run: pnpm -r typecheck
- run: pnpm -r test
# Fail before publishing if the pushed tag doesn't name the version in
# packages/cli — otherwise a `vX.Y.Z` tag would publish whatever version
# is in package.json under that tag's provenance.
- name: Verify tag matches packages/cli version
working-directory: packages/cli
run: |
PKG_VERSION="$(node -p "require('./package.json').version")"
TAG_VERSION="${GITHUB_REF_NAME#v}"
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
echo "::error::tag ${GITHUB_REF_NAME} does not match packages/cli version ${PKG_VERSION}"
exit 1
fi
echo "publishing @modernrelay/notebook@${PKG_VERSION} (tag ${GITHUB_REF_NAME})"
- name: Publish @modernrelay/notebook
working-directory: packages/cli
run: pnpm publish --no-git-checks --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}