-
-
Notifications
You must be signed in to change notification settings - Fork 739
77 lines (66 loc) · 2.42 KB
/
publish.yaml
File metadata and controls
77 lines (66 loc) · 2.42 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
68
69
70
71
72
73
74
75
76
77
# ./.github/workflows/publish.yml
name: Publish
on:
push:
tags:
- v*.*.*
- v*.*.*-*
workflow_dispatch:
inputs:
version:
description: "Version tag to publish (e.g., v0.x.x-hotfix)"
required: true
type: string
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN: ${{ secrets.NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN }}
NX_SELF_HOSTED_REMOTE_CACHE_SERVER: ${{ secrets.NX_SELF_HOSTED_REMOTE_CACHE_SERVER }}
pnpm_config_store_dir: ./node_modules/.pnpm-store
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
ref: ${{ inputs.version }}
fetch-depth: 100
persist-credentials: false
- name: Display version being published
run: |
echo "Publishing version: ${INPUTS_VERSION}"
env:
INPUTS_VERSION: ${{ inputs.version }}
- run: jq '.packageManager' package.json | tr -d '"pnpm@'
id: package-manager-version
- name: Install pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
with:
version: ${{ steps.package-manager-version.outputs.stdout }}
- uses: nrwl/nx-set-shas@afb73a62d26e41464e9254689e1fd6122ee683c1 # v5
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 # zizmor: ignore[cache-poisoning]
with:
# No pnpm cache -- correctness over speed for publish workflows
node-version-file: ".nvmrc"
- name: Cache NX
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
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-
lookup-only: true
- name: Install Dependencies & Build
run: pnpm install && pnpm build
- name: Print Environment Info
run: pnpm exec nx report
- name: Publish packages
# Ensure npm 11.5.1 or later for trusted publishing
run: npm install -g npm@latest && pnpm exec nx release publish --access public