|
1 | | -name: 🏷️ Lerna Publish NPM Latest |
| 1 | +name: 🏷️ Release to NPM |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | workflow_dispatch: |
@@ -30,36 +30,24 @@ jobs: |
30 | 30 | uses: actions/checkout@v4 |
31 | 31 | with: |
32 | 32 | fetch-depth: 0 |
33 | | - token: ${{ secrets.GITHUB_TOKEN }} |
34 | 33 |
|
35 | 34 | - if: ${{ github.event.pull_request.merged != true && contains('["ghiscoding"]', github.actor) != true }} |
36 | 35 | name: Exit early when current actor is not allowed to push new release |
37 | 36 | run: | |
38 | 37 | echo "Error: Your GitHub username (${{ github.actor }}) is not on the allowed list of admins for this workflow" |
39 | 38 | exit 1 |
40 | 39 |
|
41 | | - - name: Set NodeJS |
42 | | - uses: actions/setup-node@v4 |
43 | | - with: |
44 | | - registry-url: 'https://registry.npmjs.org/' |
45 | | - node-version: 22 |
46 | | - |
47 | 40 | - name: Install pnpm |
48 | 41 | uses: pnpm/action-setup@v3 |
49 | 42 | with: |
50 | 43 | version: 10 |
51 | 44 | run_install: false |
52 | 45 |
|
53 | | - - name: Get pnpm store directory |
54 | | - run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV |
55 | | - |
56 | | - - name: Setup pnpm cache |
57 | | - uses: actions/cache@v4 |
| 46 | + - name: Set NodeJS |
| 47 | + uses: actions/setup-node@v4 |
58 | 48 | with: |
59 | | - path: ${{ env.STORE_PATH }} |
60 | | - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
61 | | - restore-keys: | |
62 | | - ${{ runner.os }}-pnpm-store- |
| 49 | + registry-url: 'https://registry.npmjs.org/' |
| 50 | + node-version: 24 |
63 | 51 |
|
64 | 52 | - name: Run pnpm install dependencies |
65 | 53 | run: pnpm install |
@@ -94,30 +82,15 @@ jobs: |
94 | 82 | - name: Lerna Version 🏷️ |
95 | 83 | env: |
96 | 84 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
97 | | - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
98 | | - NPM_CONFIG_PROVENANCE: true |
99 | 85 | run: | |
100 | 86 | git config --global user.name "${{ github.actor }}" |
101 | 87 | git config --global user.email "${{ github.actor }}@users.noreply.github.com" |
102 | | - pnpm whoami |
103 | 88 | pnpm exec ${{ env.LERNA_VERSION_QUERY }} |
104 | 89 |
|
105 | | - - name: OTP |
106 | | - if: ${{ inputs.dryrun != true }} |
107 | | - uses: step-security/wait-for-secrets@v1 |
108 | | - id: wait-for-secrets |
109 | | - with: |
110 | | - secrets: | |
111 | | - OTP: |
112 | | - name: 'OTP to publish package' |
113 | | - description: 'OTP from authenticator app' |
114 | | -
|
115 | 90 | - name: Lerna Publish 📦 |
116 | 91 | if: ${{ inputs.dryrun != true }} |
117 | 92 | env: |
118 | 93 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
119 | | - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
120 | | - NPM_CONFIG_PROVENANCE: true |
121 | 94 | run: | |
122 | 95 | pnpm exec lerna publish from-package --force-publish --yes --otp ${{ steps.wait-for-secrets.outputs.OTP }} |
123 | 96 |
|
|
0 commit comments