Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
required: true
type: string
default: next
publish:
description: Publish to npm (off packs the tarball as an artifact only)
required: true
type: boolean
default: true
push:
tags:
- 'v*'
Expand Down Expand Up @@ -126,7 +131,7 @@ jobs:
- name: Install Node with the npm registry
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: 22
node-version: 24
registry-url: https://registry.npmjs.org

- name: Download the iOS artifacts
Expand Down Expand Up @@ -200,10 +205,16 @@ jobs:
exit 1
fi

- name: List the tarball contents
run: npm pack --dry-run 2>&1 | tee pack-dry-run.log
- name: Pack the tarball
run: npm pack 2>&1 | tee pack.log

- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --provenance --access public --tag "${{ steps.dist.outputs.tag }}"
- name: Upload the tarball
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: npm-tarball
path: kilocode-react-native-ssh-*.tgz
retention-days: 7

- name: Publish through npm trusted publishing
if: github.event_name == 'push' || inputs.publish
run: npm publish ./kilocode-react-native-ssh-*.tgz --access public --tag "${{ steps.dist.outputs.tag }}"
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,17 @@ runs on a `v*` tag or by hand with a `dist-tag` input (default `next`):
1. macOS runs `scripts/build-ios.sh` and uploads `ios/`.
2. Linux runs `scripts/build-android.sh` and uploads the jniLibs and the Kotlin
bindings.
3. One job downloads both into the checkout, runs `npm run build`, lists
`npm pack --dry-run`, asserts the xcframework slices, both `.so` files, the
Kotlin and Swift bindings and the compiled `build/` are present, then runs
`npm publish --provenance --access public --tag <tag>`.

The publish job needs an `NPM_TOKEN` secret with write access to `@kilocode` and
`id-token: write` for the provenance attestation. A tag must equal the
3. One job downloads both into the checkout, runs `npm run build`, asserts the
xcframework slices, both `.so` files, the Kotlin and Swift bindings and the
compiled `build/` are present, packs the tarball, uploads it as the
`npm-tarball` artifact and publishes it with
`npm publish --access public --tag <tag>`.

Publishing uses npm trusted publishing: the job's `id-token: write` permission
lets npm exchange a GitHub OIDC token for a short-lived publish credential and
attach a provenance attestation, so no npm token is stored. The package's
trusted publisher on npmjs.com names this repository and `release.yml`. A manual
run with `publish` off only packs the tarball. A tag must equal the
`package.json` version with a `v` prefix; a tag containing a hyphen publishes
under `next`, any other tag under `latest`.

Expand Down
Loading