Skip to content

Commit 340141d

Browse files
committed
test: oidc
1 parent e0065e9 commit 340141d

File tree

2 files changed

+72
-79
lines changed

2 files changed

+72
-79
lines changed

.github/workflows/publish.yml

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,60 @@
1-
name: Publish Package
1+
# https://docs.npmjs.com/trusted-publishers#supported-cicd-providers
2+
3+
name: Publish package to NPM
24

35
on:
46
workflow_dispatch:
57

68
permissions:
79
id-token: write # Required for OIDC
810
contents: read
9-
11+
1012
jobs:
1113
publish:
14+
name: Publish package to NPM
1215
runs-on: ubuntu-latest
16+
1317
steps:
14-
- uses: actions/checkout@v4
18+
- name: Check out repository
19+
uses: actions/checkout@v6
20+
with:
21+
fetch-depth: 0
22+
persist-credentials: false
1523

1624
- name: Set up pnpm
1725
uses: pnpm/action-setup@v4
1826
with:
1927
version: 10
20-
- uses: actions/setup-node@v4
28+
run_install: false
29+
30+
- name: Set up Node.js
31+
uses: actions/setup-node@v6
2132
with:
22-
node-version: '24'
33+
node-version-file: .node-version
2334
registry-url: 'https://registry.npmjs.org'
24-
- run: pnpm install
25-
- run: npm test
26-
- run: npm publish
35+
cache: pnpm
36+
37+
- name: Restore cache
38+
id: dependencies-cache
39+
uses: actions/cache@v5
40+
with:
41+
path: |
42+
**/node_modules
43+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
44+
restore-keys: |
45+
${{ runner.os }}-pnpm-
46+
47+
- name: Install Dependencies 🔧
48+
if: steps.dependencies-cache.outputs.cache-hit != 'true'
49+
run: |
50+
pnpm install
51+
52+
- name: Build ☕️
53+
run: |
54+
pnpm build
55+
56+
- name: Publish to NPM
57+
run: |
58+
npm publish
59+
# env:
60+
# NPM_CONFIG_PROVENANCE: true

.github/workflows/release.yml

Lines changed: 30 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -12,77 +12,36 @@ permissions:
1212
name: release-please
1313

1414
jobs:
15-
release:
16-
runs-on: ubuntu-latest
17-
outputs:
18-
release-published: ${{ steps.release.outputs.release_created }}
19-
steps:
20-
- name: Release please
21-
uses: googleapis/release-please-action@v4
22-
id: release
23-
with:
24-
# this assumes that you have created a personal access token
25-
# (PAT) and configured it as a GitHub action secret named
26-
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
27-
token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
28-
# this is a built-in strategy in release-please, see "Action Inputs"
29-
# for more options
30-
release-type: node
31-
# create a release from a path other than the repository's root
32-
# path: pkg/cmd
33-
# The short ref name of the branch or tag that triggered
34-
# the workflow run. For example, `main` or `1.x`
35-
# target-branch: ${{ github.ref_name }}
15+
# release:
16+
# runs-on: ubuntu-latest
17+
# outputs:
18+
# release-published: ${{ steps.release.outputs.release_created }}
19+
# steps:
20+
# - name: Release please
21+
# uses: googleapis/release-please-action@v4
22+
# id: release
23+
# with:
24+
# # this assumes that you have created a personal access token
25+
# # (PAT) and configured it as a GitHub action secret named
26+
# # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
27+
# token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
28+
# # this is a built-in strategy in release-please, see "Action Inputs"
29+
# # for more options
30+
# release-type: node
31+
# # create a release from a path other than the repository's root
32+
# # path: pkg/cmd
33+
# # The short ref name of the branch or tag that triggered
34+
# # the workflow run. For example, `main` or `1.x`
35+
# # target-branch: ${{ github.ref_name }}
3636

37-
# If true, do not attempt to create releases.
38-
# This is useful if splitting release tagging from PR creation.
39-
# skip-github-release: true
37+
# # If true, do not attempt to create releases.
38+
# # This is useful if splitting release tagging from PR creation.
39+
# # skip-github-release: true
4040

4141
publish:
42-
runs-on: ubuntu-latest
43-
if: needs.release.outputs.release-published
44-
needs: release
45-
steps:
46-
- name: Check out repository
47-
uses: actions/checkout@v6
48-
with:
49-
fetch-depth: 0
50-
persist-credentials: false
51-
52-
- name: Set up pnpm
53-
uses: pnpm/action-setup@v4
54-
with:
55-
version: 10
56-
run_install: false
57-
58-
- name: Set up Node.js
59-
uses: actions/setup-node@v6
60-
with:
61-
node-version-file: .node-version
62-
registry-url: https://registry.npmjs.org/
63-
cache: pnpm
64-
65-
- name: Restore cache
66-
id: dependencies-cache
67-
uses: actions/cache@v5
68-
with:
69-
path: |
70-
**/node_modules
71-
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
72-
restore-keys: |
73-
${{ runner.os }}-pnpm-
74-
75-
- name: Install Dependencies 🔧
76-
if: steps.dependencies-cache.outputs.cache-hit != 'true'
77-
run: |
78-
pnpm install
79-
80-
- name: Build ☕️
81-
run: |
82-
pnpm build
83-
84-
- name: Publish to NPM
85-
run: |
86-
npm publish
87-
env:
88-
NPM_CONFIG_PROVENANCE: true
42+
# if: needs.release.outputs.release-published
43+
permissions:
44+
id-token: write # Required for OIDC
45+
contents: read
46+
# needs: release
47+
uses: ./.github/workflows/publish.yml

0 commit comments

Comments
 (0)