Skip to content

Commit 4163f69

Browse files
authored
ci: setup release (#15)
1 parent 3a77195 commit 4163f69

File tree

2 files changed

+88
-65
lines changed

2 files changed

+88
-65
lines changed

.github/workflows/release.yaml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,43 @@ jobs:
1111
release:
1212
name: Release
1313
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
id-token: write
1417
steps:
18+
- uses: navikt/github-app-token-generator@v1
19+
id: get-token
20+
with:
21+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
22+
app-id: ${{ secrets.APP_ID }}
1523
- name: Checkout Repo
1624
uses: actions/checkout@v3
1725

18-
- name: Setup Node.js 20
26+
- name: Setup Node.js 22
1927
uses: actions/setup-node@v3
2028
with:
21-
node-version: 20
29+
node-version: 22
2230

2331
- uses: pnpm/action-setup@v4
2432

2533
- name: Install Dependencies
2634
run: pnpm install
2735

28-
- name: Create Release Pull Request
36+
- name: Build Packages
37+
run: pnpm build
38+
39+
- name: publint
40+
run: pnpm lint:publint
41+
42+
- name: Create Release Pull Request or Publish to npm
43+
id: changesets
2944
uses: changesets/action@v1
45+
with:
46+
version: pnpm changeset version
47+
publish: pnpm run publish
48+
commit: "ci: release"
49+
title: "ci: release"
3050
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
GITHUB_TOKEN: ${{ steps.get-token.outputs.token }}
52+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
53+
NPM_CONFIG_PROVENANCE: true

package.json

Lines changed: 62 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,64 @@
11
{
2-
"name": "cdn-cache-control",
3-
"version": "1.2.0",
4-
"description": "Easy, opinionated CDN cache header handling",
5-
"homepage": "https://github.com/ascorbic/cdn-cache-control",
6-
"repository": "ascorbic/cdn-cache-control",
7-
"main": "dist/index.js",
8-
"type": "module",
9-
"types": "dist/index.d.ts",
10-
"files": [
11-
"dist",
12-
"src"
13-
],
14-
"exports": {
15-
".": {
16-
"deno": "./src/index.ts",
17-
"import": {
18-
"types": "./dist/index.d.ts",
19-
"default": "./dist/index.js"
20-
},
21-
"require": {
22-
"types": "./dist/index.d.cts",
23-
"default": "./dist/index.cjs"
24-
}
25-
}
26-
},
27-
"tsup": {
28-
"entry": [
29-
"src/index.ts"
30-
],
31-
"splitting": false,
32-
"sourcemap": true,
33-
"clean": true,
34-
"dts": true,
35-
"format": [
36-
"esm",
37-
"cjs"
38-
]
39-
},
40-
"scripts": {
41-
"build": "tsup",
42-
"lint:types": "attw --pack .",
43-
"lint:package": "publint",
44-
"lint:prettier": "prettier --check src",
45-
"lint": "pnpm run '/^lint:.*/'",
46-
"test": "pnpm build && node --test",
47-
"tsdoc": "tsdoc --src=src/index.ts && prettier --write README.md"
48-
},
49-
"keywords": [],
50-
"author": "Matt Kane <[email protected]>",
51-
"license": "MIT",
52-
"devDependencies": {
53-
"@arethetypeswrong/cli": "^0.15.3",
54-
"@changesets/cli": "^2.27.7",
55-
"@types/node": "^20.14.2",
56-
"prettier": "^3.3.1",
57-
"publint": "^0.2.8",
58-
"tsdoc-markdown": "^0.6.0",
59-
"tsup": "^8.1.0",
60-
"typescript": "^5.5.3"
61-
},
62-
"packageManager": "[email protected]+sha1.bb42032ff80dba5f9245bc1b03470d2fa0b7fb2f"
2+
"name": "cdn-cache-control",
3+
"version": "1.2.0",
4+
"description": "Easy, opinionated CDN cache header handling",
5+
"homepage": "https://github.com/ascorbic/cdn-cache-control",
6+
"repository": "ascorbic/cdn-cache-control",
7+
"main": "dist/index.js",
8+
"type": "module",
9+
"types": "dist/index.d.ts",
10+
"files": [
11+
"dist",
12+
"src"
13+
],
14+
"exports": {
15+
".": {
16+
"deno": "./src/index.ts",
17+
"import": {
18+
"types": "./dist/index.d.ts",
19+
"default": "./dist/index.js"
20+
},
21+
"require": {
22+
"types": "./dist/index.d.cts",
23+
"default": "./dist/index.cjs"
24+
}
25+
}
26+
},
27+
"tsup": {
28+
"entry": [
29+
"src/index.ts"
30+
],
31+
"splitting": false,
32+
"sourcemap": true,
33+
"clean": true,
34+
"dts": true,
35+
"format": [
36+
"esm",
37+
"cjs"
38+
]
39+
},
40+
"scripts": {
41+
"build": "tsup",
42+
"lint:types": "attw --pack .",
43+
"lint:package": "publint",
44+
"lint:prettier": "prettier --check src",
45+
"publish": "changeset publish && npx jsr publish",
46+
"lint": "pnpm run '/^lint:.*/'",
47+
"test": "pnpm build && node --test",
48+
"tsdoc": "tsdoc --src=src/index.ts && prettier --write README.md"
49+
},
50+
"keywords": [],
51+
"author": "Matt Kane <[email protected]>",
52+
"license": "MIT",
53+
"devDependencies": {
54+
"@arethetypeswrong/cli": "^0.15.3",
55+
"@changesets/cli": "^2.27.7",
56+
"@types/node": "^20.14.2",
57+
"prettier": "^3.3.1",
58+
"publint": "^0.2.8",
59+
"tsdoc-markdown": "^0.6.0",
60+
"tsup": "^8.1.0",
61+
"typescript": "^5.5.3"
62+
},
63+
"packageManager": "[email protected]+sha1.bb42032ff80dba5f9245bc1b03470d2fa0b7fb2f"
6364
}

0 commit comments

Comments
 (0)