Skip to content

Commit 5e68ae0

Browse files
chore: setup OIDC publishing
1 parent 1f919ad commit 5e68ae0

3 files changed

Lines changed: 42 additions & 19 deletions

File tree

.github/workflows/main.yml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,24 @@
11
name: CI
22

3-
on: [push, pull_request_target]
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- "**"
8+
push:
9+
branches:
10+
- main
411

512
jobs:
613
build_test:
714
name: Build & Test
815
runs-on: ubuntu-latest
916
steps:
10-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
1119
with:
12-
fetch-depth: 1
13-
- uses: actions/setup-node@v1
14-
with:
15-
node-version: "14.x"
16-
- name: Cache node modules
17-
uses: actions/cache@v1
18-
env:
19-
cache-name: cache-node-modules
20-
with:
21-
path: ~/.npm
22-
# This uses the same name as the build-action so we can share the caches.
23-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
24-
restore-keys: |
25-
${{ runner.os }}-build-${{ env.cache-name }}-
26-
${{ runner.os }}-build-
27-
${{ runner.os }}-
28-
- run: yarn
20+
node-version-file: "package.json"
21+
- run: yarn install
2922
- name: test
3023
run: |
3124
yarn build

.github/workflows/release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Release
2+
on:
3+
push:
4+
tags: ["v*"]
5+
workflow_dispatch:
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
environment: npm-publish # ties to the protected env above
11+
permissions:
12+
contents: read
13+
id-token: write # required for OIDC
14+
steps:
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
17+
with:
18+
node-version-file: "package.json"
19+
registry-url: "https://registry.npmjs.org"
20+
- run: yarn install
21+
- run: yarn build
22+
- run: yarn test
23+
- run: npm publish

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
"./package.json": "./package.json",
1515
"./": "./"
1616
},
17+
"publishConfig": {
18+
"access": "public",
19+
"provenance": true
20+
},
21+
"engines": {
22+
"node": ">=24"
23+
},
1724
"repository": {
1825
"type": "git",
1926
"url": "https://github.com/marvinhagemeister/errorstacks.git"

0 commit comments

Comments
 (0)