Skip to content

programmatic video rendering framework that is actually fast

ci: Publish @fframes/editor with npm trusted publishing (#143)

Dmitriy Kovalenko69b5ada9f043
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 3522d354..41878510 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -195,6 +195,10 @@ jobs:
name: Publish nightly release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
+ # npm trusted publishing: the job proves its identity to npm with an OIDC token instead of a secret
+ permissions:
+ contents: read
+ id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -207,15 +211,16 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
- always-auth: true
- node-version: 23
+ # Node 24 ships npm 11.5+, the first npm that can publish through trusted publishing
+ node-version: 24
+ registry-url: https://registry.npmjs.org
cache: "pnpm"
- name: Install frontend deps
run: pnpm install --frozen-lockfile --prefer-offline
- uses: actions-rust-lang/setup-rust-toolchain@v1
- with:
+ with:
toolchain: stable
cache: true
cache-key: "v3-rust"
@@ -224,7 +229,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
git fetch --tags
bash release.sh "$(git describe --tags $(git rev-list --tags --max-count=1)).rc-$(printf "%02d" $(git rev-list --count $(git describe --tags --abbrev=0)..HEAD))"
diff --git a/fframes-editor/package.json b/fframes-editor/package.json
index 74fc7ea2..a6c16583 100644
--- a/fframes-editor/package.json
+++ b/fframes-editor/package.json
@@ -6,6 +6,11 @@
"rescript"
],
"author": "Dmitriy Kovalenko <[email protected]>",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/dmtrKovalenko/fframes.git",
+ "directory": "fframes-editor"
+ },
"license": "MIT",
"main": "./dist/fframes-editor.js",
"types": "./src/fframes-editor.tsx",
diff --git a/release.sh b/release.sh
index f8fc9ff3..b0ef2148 100644
--- a/release.sh
+++ b/release.sh
@@ -29,4 +29,5 @@ done
cd fframes-editor
pnpm build:prod
pnpm version "$VERSION" --no-git-tag-version
-pnpm publish --access public --no-git-checks
+# npm itself: it authenticates with the job's OIDC token (trusted publishing) and attaches provenance
+npm publish --access public