-
-
Notifications
You must be signed in to change notification settings - Fork 717
67 lines (55 loc) · 1.79 KB
/
publish.yaml
File metadata and controls
67 lines (55 loc) · 1.79 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
66
67
# ./.github/workflows/publish.yml
name: Publish
on:
push:
tags:
- v*.*.*
env:
NX_REJECT_UNKNOWN_LOCAL_CACHE: 0
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write # needed for provenance data generation
attestations: write
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 100
- run: jq '.packageManager' package.json | tr -d '"pnpm@'
id: package-manager-version
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ steps.package-manager-version.outputs.stdout }}
- uses: nrwl/nx-set-shas@v3
- uses: actions/setup-node@v4
with:
cache: "pnpm"
cache-dependency-path: "**/pnpm-lock.yaml"
node-version-file: ".nvmrc"
- name: Cache NX
uses: actions/cache@v4
with:
path: .nx/cache
key: nx-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-${{ github.sha }}
restore-keys: |
nx-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-
nx-${{ env.NX_BRANCH }}-
nx-
- run: sudo apt-get update && sudo apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev pkg-config
- name: Install Dependencies & Build
run: pnpm install && pnpm build
- name: Print Environment Info
run: pnpm exec nx report
- name: Setup NPM
run: echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
- name: Publish packages
run: pnpm exec nx release publish
env:
NPM_CONFIG_PROVENANCE: true
GITHUB_TOKEN: "${{ github.token }}"