Skip to content

Commit b8c4324

Browse files
Merge pull request #12 from the-markup/add-github-oidc-publish-workflow
update publish workflow
2 parents 766d779 + f96a004 commit b8c4324

1 file changed

Lines changed: 19 additions & 23 deletions

File tree

.github/workflows/publish.yml

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,25 @@
1-
name: Publish
1+
name: publish
22

33
on:
44
release:
55
types: [published]
6-
jobs:
7-
test:
8-
runs-on: ubuntu-latest
96

10-
steps:
11-
- uses: actions/checkout@v3
12-
- uses: actions/setup-node@v3
13-
with:
14-
node-version: "lts/hydrogen"
15-
- run: npm install
16-
- run: npm run build
17-
- run: npm run test
7+
permissions:
8+
id-token: write # Required for OIDC
9+
contents: read
1810

19-
publish-npm:
20-
needs: test
21-
runs-on: ubuntu-latest
22-
steps:
23-
- uses: actions/checkout@v3
24-
- uses: actions/setup-node@v3
25-
with:
26-
node-version: "lts/hydrogen"
27-
registry-url: https://registry.npmjs.org/
28-
- run: npm ci
29-
- run: npm publish
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: "lts/hydrogen"
19+
registry-url: https://registry.npmjs.org
20+
- name: Update npm
21+
run: npm install -g npm@latest
22+
- run: npm ci
23+
- run: npm run build --if-present
24+
- run: npm test
25+
- run: npm publish

0 commit comments

Comments
 (0)