Skip to content
Merged
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
20 changes: 15 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,25 @@ on:
- main
pull_request:

permissions:
contents: read

jobs:
CI:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
package-manager-cache: false
- name: Setup Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Build react-native-app-clip
run: bun run build
run: bun install --frozen-lockfile
- name: Build and pack package
run: |
mkdir -p "$RUNNER_TEMP/npm-package"
npm pack --pack-destination "$RUNNER_TEMP/npm-package"
48 changes: 31 additions & 17 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,42 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Node.js Package
name: Stage npm release

on:
release:
types: [created]
types: [published]

permissions:
contents: read
id-token: write

jobs:
publish-npm:
stage-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install
- name: Build package
run: bun run build
- uses: actions/setup-node@v4
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "20.x"
node-version: "24"
registry-url: "https://registry.npmjs.org"
- run: npm publish
package-manager-cache: false
- name: Install npm with staged publishing support
run: npm install --global npm@11.21.1
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Verify release version
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
node -e 'const { version } = require("./package.json"); if (process.env.RELEASE_TAG !== "v" + version) throw new Error("Release tag must match package.json: v" + version);'
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build and pack package
run: |
mkdir -p "$RUNNER_TEMP/npm-package"
npm pack --pack-destination "$RUNNER_TEMP/npm-package"
- name: Stage tarball for manual approval
# The trusted publisher only needs the npm stage publish permission.
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_DIST_TAG: ${{ github.event.release.prerelease && 'next' || 'latest' }}
run: npm stage publish "$RUNNER_TEMP/npm-package/"*.tgz --access public --tag "$NPM_DIST_TAG"
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "react-native-app-clip",
"version": "0.9.2",
"packageManager": "bun@1.4.3",
"description": "Config plugin to add an App Clip to a React Native iOS app",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand All @@ -13,13 +14,13 @@
"app.plugin.js"
],
"scripts": {
"build": "expo-module build",
"build:plugin": "expo-module build plugin",
"build": "expo-module build && npm run build:plugin",
"build:plugin": "expo-module build plugin --force",
"clean": "expo-module clean",
"lint": "expo-module lint",
"test": "expo-module test",
"prepare": "expo-module prepare",
"prepublishOnly": "expo-module prepublishOnly",
"prepack": "expo-module clean && expo-module clean plugin && npm run build",
"expo-module": "expo-module",
"open:ios": "xed example/ios",
"open:android": "open -a \"Android Studio\" example/android"
Expand Down
Loading