Skip to content

Commit fbf459e

Browse files
authored
ci: setup trusted publishing (#91)
1 parent b6674d5 commit fbf459e

File tree

6 files changed

+307
-475
lines changed

6 files changed

+307
-475
lines changed

.github/workflows/publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write
14+
environment: Release
15+
steps:
16+
- uses: actions/checkout@v6
17+
18+
- uses: pnpm/action-setup@v4
19+
20+
- name: Set node version to 22
21+
uses: actions/setup-node@v6
22+
with:
23+
node-version: 22
24+
registry-url: https://registry.npmjs.org/
25+
# disable cache, to avoid cache poisoning (https://docs.zizmor.sh/audits/#cache-poisoning)
26+
package-manager-cache: false
27+
cache: "pnpm"
28+
29+
- name: Disallow installation scripts
30+
run: yq '.onlyBuiltDependencies = []' -i pnpm-workspace.yaml
31+
32+
- name: Install deps
33+
run: pnpm install
34+
env:
35+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
36+
37+
- name: Publish package
38+
run: npm i -g npm@^11.5.2 && pnpm run ci-publish ${{ github.ref_name }}

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"test": "vitest run",
2929
"format": "prettier --write --cache .",
3030
"release": "tsx -C import scripts/release.ts",
31-
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
31+
"ci-publish": "tsx scripts/publishCI.ts"
3232
},
3333
"engines": {
3434
"node": "^18.0.0 || ^20.0.0 || >=22.0.0"
@@ -47,14 +47,11 @@
4747
},
4848
"devDependencies": {
4949
"@types/node": "^24.10.4",
50-
"conventional-changelog-cli": "^5.0.0",
51-
"enquirer": "^2.4.1",
50+
"@vitejs/release-scripts": "^1.6.0",
5251
"execa": "^9.6.1",
53-
"minimist": "^1.2.8",
5452
"node-forge": "^1.3.3",
5553
"picocolors": "^1.1.1",
5654
"prettier": "^3.7.4",
57-
"semver": "^7.7.3",
5855
"tsx": "^4.21.0",
5956
"typescript": "^5.9.3",
6057
"unbuild": "^3.6.1",

0 commit comments

Comments
 (0)