Skip to content

Commit b2f127c

Browse files
committed
chore: fix npm-publish dependencies and add provenance
1 parent 9afaf00 commit b2f127c

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

.github/workflows/release-please.yml

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,41 @@ on:
44
push:
55
branches:
66
- main
7-
pull_request:
7+
workflow_dispatch:
88

99
jobs:
1010
release-please:
1111
outputs:
12-
pr: ${{ steps.release.outputs.pr }}
12+
release_created: ${{ steps.release.outputs.release_created }}
1313
permissions:
1414
contents: write # to create release commit (googleapis/release-please-action)
1515
pull-requests: write # to create release PR (googleapis/release-please-action)
16-
if: github.event_name == 'push'
1716
runs-on: ubuntu-latest
1817
steps:
19-
- uses: googleapis/release-please-action@v4
20-
id: release
21-
# Standard Conventional Commits: `feat` and `fix`
22-
# node-gyp subdirectories: `bin`, `gyp`, `lib`, `src`, `test`
23-
# node-gyp subcommands: `build`, `clean`, `configure`, `install`, `list`, `rebuild`, `remove`
24-
# Core abstract category: `deps`
25-
# Languages/platforms: `python`, `lin`, `linux`, `mac`, `macos`, `win`, `window`, `zos`
26-
# Documentation: `doc`, `docs`, `readme`
27-
# Standard Conventional Commits: `chore` (under "Miscellaneous")
28-
# Miscellaneous abstract categories: `refactor`, `ci`, `meta`
29-
30-
test:
31-
name: Release Test
32-
needs: [ release-please ]
33-
if: needs.release-please.outputs.pr || startsWith(github.head_ref, 'release-please--')
34-
uses: ./.github/workflows/tests.yml
18+
- uses: googleapis/release-please-action@v4
19+
id: release
20+
# Standard Conventional Commits: `feat` and `fix`
21+
# node-gyp subdirectories: `bin`, `gyp`, `lib`, `src`, `test`
22+
# node-gyp subcommands: `build`, `clean`, `configure`, `install`, `list`, `rebuild`, `remove`
23+
# Core abstract category: `deps`
24+
# Languages/platforms: `python`, `lin`, `linux`, `mac`, `macos`, `win`, `window`, `zos`
25+
# Documentation: `doc`, `docs`, `readme`
26+
# Standard Conventional Commits: `chore` (under "Miscellaneous")
27+
# Miscellaneous abstract categories: `refactor`, `ci`, `meta`
3528

3629
npm-publish:
3730
needs: release-please
3831
if: ${{ needs.release-please.outputs.release_created }}
3932
runs-on: ubuntu-latest
33+
permissions:
34+
contents: read
35+
id-token: write # to generate npm provenance statements
4036
steps:
4137
- uses: actions/checkout@v4
4238
- uses: actions/setup-node@v4
4339
with:
4440
node-version: lts/*
4541
registry-url: 'https://registry.npmjs.org'
46-
- run: npm publish --access public
42+
- run: npm publish --provenance --access public
4743
env:
4844
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v4
2121
- run: pip install --user ruff
22-
- run: ruff check --output-format=github --select="E,F,PLC,PLE,UP,W,YTT" --ignore="E721,PLC1901,S101,UP031" --target-version=py38 .
22+
# Excluding `/gyp` directory as it is been checked in https://github.com/nodejs/gyp-next/ already
23+
- run: ruff check --output-format=github --extend-exclude=gyp --select="E,F,PLC,PLE,UP,W,YTT" --ignore="E721,PLC1901,S101,UP031" --target-version=py38 .
2324

2425
lint-js:
2526
name: Lint JS

0 commit comments

Comments
 (0)