Skip to content

Commit bcc9c14

Browse files
authored
Setup trusted publishing to NPM (#99)
1 parent 94d190b commit bcc9c14

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ inputs:
44
node-version:
55
description: The version of Node.js to install
66
required: true
7-
default: 20.16.0
7+
default: 23.7.0
8+
registry-url:
9+
description: Optional registry to set up for auth
810

911
runs:
1012
using: composite
@@ -16,6 +18,7 @@ runs:
1618
with:
1719
cache: pnpm
1820
node-version: ${{ inputs.node-version }}
21+
registry-url: ${{ inputs.registry-url }}
1922
- name: Install dependencies
2023
shell: bash
2124
run: pnpm install

.github/workflows/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ jobs:
2323
- uses: actions/checkout@v4
2424
- name: Install dependencies
2525
uses: ./.github/actions/setup
26+
with:
27+
registry-url: "https://registry.npmjs.org"
28+
- name: Upgrade npm for OIDC support
29+
run: npm install -g npm@latest
2630
- name: Create Release Pull Request or Publish
2731
id: changesets
2832
uses: changesets/action@v1
@@ -31,4 +35,3 @@ jobs:
3135
publish: pnpm changeset-publish
3236
env:
3337
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
destination: ./_site
3232
- name: Upload pages artifact
3333
if: github.repository_owner == 'Effect-Ts' && github.event_name == 'push' && github.ref == 'refs/heads/main'
34-
uses: actions/upload-pages-artifact@v2
34+
uses: actions/upload-pages-artifact@v3
3535

3636
deploy:
3737
if: github.repository_owner == 'Effect-Ts' && github.event_name == 'push' && github.ref == 'refs/heads/main'
@@ -48,4 +48,4 @@ jobs:
4848
steps:
4949
- name: Deploy to GitHub Pages
5050
id: deployment
51-
uses: actions/deploy-pages@v2
51+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)