@@ -26,37 +26,32 @@ jobs:
2626 runs-on : ubuntu-latest
2727
2828 steps :
29- - name : Ensure this workflow runs from main
30- if : github.ref_name != 'main'
29+ - name : Ensure publish runs from main
30+ if : github.event.inputs.mode == 'publish' && github. ref_name != 'main'
3131 run : |
32- echo "This workflow must be dispatched from the main branch."
32+ echo "Publishing must be dispatched from the main branch. Use dry-run mode to test from other branches ."
3333 exit 1
3434
3535 - name : Checkout repository
36- uses : actions/checkout@v4
36+ uses : actions/checkout@v6
3737 with :
3838 fetch-depth : 0
3939 ssh-key : ${{ secrets.RELEASE_DEPLOY_KEY }}
4040
41- - name : Setup pnpm
42- uses : pnpm/action- setup@v4
41+ - name : Setup Bun
42+ uses : oven-sh/ setup-bun@v2
4343
4444 - name : Setup Node.js
4545 uses : actions/setup-node@v6
4646 with :
47- node-version : ' 24'
48- cache : pnpm
47+ node-version : " 24"
4948 registry-url : https://registry.npmjs.org
5049
5150 - name : Verify trusted publishing runtime requirements
52- run : |
53- node --version
54- npm --version
55- node -e "const [major, minor] = process.versions.node.split('.').map(Number); if (major < 22 || (major === 22 && minor < 14)) process.exit(1)"
56- node -e "const version = require('child_process').execSync('npm --version', { encoding: 'utf8' }).trim().split('.').map(Number); if (version[0] < 11 || (version[0] === 11 && version[1] < 5) || (version[0] === 11 && version[1] === 5 && version[2] < 1)) process.exit(1)"
51+ run : node .github/scripts/verify-trusted-publishing-runtime.mjs
5752
5853 - name : Install dependencies
59- run : pnpm install --frozen-lockfile --ignore-scripts
54+ run : bun install --frozen-lockfile
6055
6156 - name : Install Rust toolchain
6257 uses : dtolnay/rust-toolchain@v1
@@ -75,29 +70,28 @@ jobs:
7570 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
7671
7772 - name : Ensure release plans exist
78- run : |
79- shopt -s nullglob
80- plans=(.nx/version-plans/*.md)
81- if [ ${#plans[@]} -eq 0 ]; then
82- echo "No release plans were found in .nx/version-plans."
83- exit 1
84- fi
73+ run : bash .github/scripts/ensure-release-plans-exist.sh
8574
8675 - name : Dry-run release
87- run : pnpm nx release --dry-run --preid alpha
76+ if : github.event.inputs.mode == 'dry-run'
77+ run : npx nx release --dry-run --preid alpha
8878 env :
8979 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
9080
9181 - name : Create release commit and tags
9282 if : github.event.inputs.mode == 'publish'
93- run : pnpm nx release --skip-publish --preid alpha
83+ run : npx nx release --skip-publish --preid alpha
9484 env :
9585 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
9686
87+ - name : Force Nx publish executor to npm for OIDC
88+ if : github.event.inputs.mode == 'publish'
89+ run : node .github/scripts/force-nx-publish-package-manager-npm.cjs
90+
9791 - name : Push release commit and tags
9892 if : github.event.inputs.mode == 'publish'
9993 run : git push origin HEAD:main --follow-tags
10094
10195 - name : Publish packages to npm
10296 if : github.event.inputs.mode == 'publish'
103- run : pnpm nx release publish
97+ run : npx nx release publish
0 commit comments