Skip to content

Commit 6806cda

Browse files
authored
ci(release-please): combine npm publish workflow jobs to avoid file perm issues from zip files used by upload-artifact (#3108)
1 parent c7f4e6c commit 6806cda

File tree

1 file changed

+9
-35
lines changed

1 file changed

+9
-35
lines changed

.github/workflows/release-please.yml

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -64,50 +64,24 @@ jobs:
6464
git commit -m "chore: sync package-lock.json 'dependencies' key"
6565
git push
6666
67-
install-and-compile:
68-
needs: release-please
69-
# only if a release has been created
70-
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
71-
runs-on: ubuntu-latest
72-
steps:
73-
- name: Checkout Repository
74-
uses: actions/checkout@v5
75-
with:
76-
fetch-depth: 0
77-
- name: Rebuild Packages
78-
run: |
79-
npm ci
80-
npm run compile
81-
- name: Upload contents for publish
82-
uses: actions/upload-artifact@v4
83-
with:
84-
name: publish-cache-${{ github.run_number }}
85-
path: .
86-
include-hidden-files: true
87-
if-no-files-found: error
88-
retention-days: 10
89-
67+
# If releases have been created, then publish to npm.
9068
npm-publish:
91-
needs:
92-
- release-please
93-
- install-and-compile
94-
# only if a release has been created
69+
needs: release-please
9570
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
96-
runs-on: ubuntu-latest
9771
permissions:
9872
contents: read
99-
id-token: write # to generate npm provenance statements
73+
id-token: write # needed for OIDC and provenance
74+
runs-on: ubuntu-latest
10075
environment: npm-publish-environment
10176
steps:
102-
- name: Setup Node
103-
uses: actions/setup-node@v5
77+
- uses: actions/checkout@v5
78+
- uses: actions/setup-node@v5
10479
with:
80+
# Require npm 11.5.1 or later for https://docs.npmjs.com/trusted-publishers.
10581
node-version: 24
10682
registry-url: 'https://registry.npmjs.org'
107-
- name: Download contents for publish
108-
uses: actions/download-artifact@v5
109-
with:
110-
name: publish-cache-${{ github.run_number }}
83+
- run: npm ci
84+
- run: npm run compile
11185
# Release Please has already incremented versions and published tags, so we just
11286
# need to publish all unpublished versions to npm here
11387
# See: https://github.com/lerna/lerna/tree/main/libs/commands/publish#bump-from-package

0 commit comments

Comments
 (0)