Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,25 @@

name: Node.js CI
env:
NODE_VERSION: "20.x"
NODE_VERSION: "24"

on: [push]

permissions:
# Required for OIDC token for NPM Trusted Publishers.
# See https://docs.github.com/en/actions/concepts/security/openid-connect
# and https://docs.npmjs.com/trusted-publishers.
id-token: write
contents: read

jobs:
lint:
name: ✅ Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 #4.3.1
- name: Setup Node
uses: actions/setup-node@v4
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 #v6.2.0
with:
node-version: ${{env.NODE_VERSION}}
- run: npm ci
Expand All @@ -23,9 +30,9 @@ jobs:
name: Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 #4.3.1
- name: Setup Node
uses: actions/setup-node@v4
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 #v6.2.0
with:
node-version: ${{env.NODE_VERSION}}
- run: npm ci
Expand All @@ -34,9 +41,9 @@ jobs:
name: Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 #4.3.1
- name: Setup Node
uses: actions/setup-node@v4
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 #v6.2.0
with:
node-version: ${{env.NODE_VERSION}}
- run: npm ci
Expand All @@ -49,8 +56,8 @@ jobs:
needs: [lint, typeCheck, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 #4.3.1
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 #v6.2.0
with:
node-version: ${{env.NODE_VERSION}}
- run: npm ci
Expand All @@ -70,13 +77,12 @@ jobs:
needs: [lint, typeCheck, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 #4.3.1
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 #v6.2.0
with:
node-version: ${{env.NODE_VERSION}}
registry-url: https://registry.npmjs.org/
package-manager-cache: false # Do not cache when publishing to prevent cache pollution attacks
- run: npm ci
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- run: npm publish --provenance # Provenance required for Trusted Publishers
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to update the package.json with the repository URL if it's not already in there

Loading