-
Notifications
You must be signed in to change notification settings - Fork 17
47 lines (40 loc) · 1.24 KB
/
publish.yml
File metadata and controls
47 lines (40 loc) · 1.24 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
name: Publish
# Rules that triggers the workflows
on:
release:
types:
- created
workflow_dispatch:
permissions:
contents: read
packages: write
id-token: write # needed for provenance data generation
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Build
run: pnpm primitives:build
- name: Build Schematics
run: pnpm primitives:build:schematics
- name: Publish package 📦
run: |
VERSION="$(node -p "require('./packages/primitives/package.json').version")"
if [[ "$VERSION" == *-* ]]; then
# Prerelease (e.g. 1.0.0-beta.0) -> publish under its identifier dist-tag (beta/rc/alpha),
# never "latest", so `npm i @radix-ng/primitives` keeps resolving the stable release.
TAG="$(printf '%s' "$VERSION" | sed -E 's/^[0-9.]+-([0-9A-Za-z]+).*/\1/')"
else
TAG="latest"
fi
echo "Publishing $VERSION under dist-tag: $TAG"
npx nx release publish --tag "$TAG"
shell: bash
env:
NPM_CONFIG_PROVENANCE: true