Skip to content

Commit 0fc8183

Browse files
authored
chore: configure npm trusted publishing (#26)
1 parent 0208eb0 commit 0fc8183

File tree

3 files changed

+76
-16
lines changed

3 files changed

+76
-16
lines changed

.github/workflows/ci.yaml

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: CI
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
branches:
@@ -12,48 +15,94 @@ on:
1215
jobs:
1316
biome:
1417
runs-on: ubuntu-24.04
18+
timeout-minutes: 15
19+
permissions:
20+
contents: read
1521
steps:
1622
- name: Checkout your repository using git
17-
uses: actions/checkout@v4
23+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
24+
with:
25+
persist-credentials: false
1826
- name: Setup toolchain
19-
uses: jdx/mise-action@v2
27+
uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1
2028
- name: Install dependencies
2129
run: bun install --frozen-lockfile
2230
- name: Check using Biome
2331
run: bun run ci
2432

2533
tsc:
2634
runs-on: ubuntu-24.04
35+
timeout-minutes: 15
36+
permissions:
37+
contents: read
2738
steps:
2839
- name: Checkout your repository using git
29-
uses: actions/checkout@v4
40+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
41+
with:
42+
persist-credentials: false
3043
- name: Setup toolchain
31-
uses: jdx/mise-action@v2
44+
uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1
3245
- name: Install dependencies
3346
run: bun install --frozen-lockfile
3447
- name: Check using tsc
3548
run: bun run tsc
3649

3750
test:
3851
runs-on: ubuntu-24.04
52+
timeout-minutes: 15
53+
permissions:
54+
contents: read
3955
steps:
4056
- name: Checkout your repository using git
41-
uses: actions/checkout@v4
57+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
58+
with:
59+
persist-credentials: false
4260
- name: Setup toolchain
43-
uses: jdx/mise-action@v2
61+
uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1
4462
- name: Install dependencies
4563
run: bun install --frozen-lockfile
4664
- name: Test
4765
run: bun run test
4866

4967
build:
5068
runs-on: ubuntu-24.04
69+
timeout-minutes: 15
70+
permissions:
71+
contents: read
5172
steps:
5273
- name: Checkout your repository using git
53-
uses: actions/checkout@v4
74+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
75+
with:
76+
persist-credentials: false
5477
- name: Setup toolchain
55-
uses: jdx/mise-action@v2
78+
uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1
5679
- name: Install dependencies
5780
run: bun install --frozen-lockfile
5881
- name: Build
5982
run: bun run build
83+
84+
github-actions:
85+
runs-on: ubuntu-24.04
86+
timeout-minutes: 15
87+
permissions:
88+
contents: read
89+
strategy:
90+
matrix:
91+
task: ["actionlint", "ghalint", "zizmor"]
92+
fail-fast: false
93+
steps:
94+
- name: Checkout your repository using git
95+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
96+
with:
97+
persist-credentials: false
98+
- name: Setup toolchain
99+
uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1
100+
- name: Run actionlint
101+
if: matrix.task == 'actionlint'
102+
run: actionlint
103+
- name: Run ghalint
104+
if: matrix.task == 'ghalint'
105+
run: ghalint run
106+
- name: Run zizmor
107+
if: matrix.task == 'zizmor'
108+
run: zizmor .

.github/workflows/publish.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,27 @@ name: Publish package to npmjs
22
on:
33
release:
44
types: [published]
5+
permissions:
6+
id-token: write
7+
contents: read
58
jobs:
69
build:
710
runs-on: ubuntu-latest
11+
timeout-minutes: 15
12+
permissions:
13+
id-token: write
14+
contents: read
815
steps:
9-
- uses: actions/checkout@v4
10-
- uses: actions/setup-node@v4
16+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
17+
with:
18+
persist-credentials: false
19+
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
1120
with:
1221
node-version-file: ".tool-versions"
1322
registry-url: "https://registry.npmjs.org"
14-
- uses: oven-sh/setup-bun@v2
23+
- uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
1524
with:
1625
bun-version-file: ".tool-versions"
1726
- run: bun install --frozen-lockfile
1827
- run: npm run build
19-
- run: npm publish
20-
env:
21-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
28+
- run: npm publish --provenance

.tool-versions

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
bun 1.2.13
2-
nodejs 24.12.0
1+
bun 1.2.13
2+
nodejs 24.12.0
3+
pinact 3.2.0
4+
zizmor 1.18.0
5+
actionlint 1.7.9
6+
ghalint 1.5.3

0 commit comments

Comments
 (0)