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
45 changes: 31 additions & 14 deletions .github/workflows/prebuilds.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
name: Generate prebuilds
name: Build, test, and release prebuilds

# This workflow builds nodejs-mobile prebuilds for an npm-published native
# module across all standard targets, tests them on an Android emulator and
# iOS simulator, and publishes a GitHub Release with the artifacts.

on:
workflow_dispatch:
inputs:
module_version:
description: "Module version"
module_name:
description: "npm module name"
required: true
type: string
default: "crc-native"
module_version:
description: "Exact version or dist-tag"
required: false
default: "latest"
type: string
publish_release:
Expand All @@ -16,20 +25,28 @@ on:

jobs:
build:
strategy:
matrix:
platform: [android]
arch: [arm64, x64, arm]
uses: digidem/nodejs-mobile-bare-prebuilds/.github/workflows/prebuild.yml@main
uses: digidem/nodejs-mobile-bare-prebuilds/.github/workflows/prebuild-all.yml@v2
with:
module_name: "crc-native"
module_name: ${{ inputs.module_name }}
module_version: ${{ inputs.module_version }}
platform: ${{ matrix.platform }}
arch: ${{ matrix.arch }}

test-android:
needs: build
uses: digidem/nodejs-mobile-bare-prebuilds/.github/workflows/test-android.yml@v2
with:
module_spec: ${{ needs.build.outputs.module_spec }}

test-ios:
needs: build
uses: digidem/nodejs-mobile-bare-prebuilds/.github/workflows/test-ios.yml@v2
with:
module_spec: ${{ needs.build.outputs.module_spec }}

release:
if: ${{ inputs.publish_release }}
needs: build
uses: digidem/nodejs-mobile-bare-prebuilds/.github/workflows/release.yml@main
needs: [ build, test-android, test-ios ]
permissions:
contents: write
uses: digidem/nodejs-mobile-bare-prebuilds/.github/workflows/release.yml@v2
with:
module_version: ${{ needs.build.outputs.module_version }}
module_spec: ${{ needs.build.outputs.module_spec }}
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
# crc-native-nodejs-mobile

[NodeJS Mobile](https://github.com/nodejs-mobile/nodejs-mobile) prebuilds for [`crc-native`](https://github.com/holepunchto/crc-native)
[NodeJS Mobile](https://github.com/nodejs-mobile/nodejs-mobile) prebuilds for
[`crc-native`](https://github.com/holepunchto/crc-native)

## Working locally

### Requirements

- Node 18
- Android NDK (CI uses version 27.2.12479018)
- Android NDK
- (optional) exported `ANDROID_NDK_HOME` environment variable

### General steps

Should be clear enough to follow the [reusable workflow steps](https://github.com/digidem/nodejs-mobile-bare-prebuilds/blob/main/.github/workflows/prebuild.yml) but in summary:
Should be clear enough to follow the
[reusable workflow steps](https://github.com/digidem/nodejs-mobile-bare-prebuilds/blob/main/.github/workflows/prebuild.yml)
but in summary:

1. Download the npm tarball package and unzip e.g.
```
npm pack crc-native@latest | xargs tar -zxvf
```
```
npm pack crc-native@latest | xargs tar -zxvf
```
2. Navigate to unzipped directory:
```
cd package
Expand All @@ -26,7 +28,8 @@ Should be clear enough to follow the [reusable workflow steps](https://github.co
```
npm install
```
4. Install [patched `cmake-napi`](https://github.com/digidem/cmake-napi-nodejs-mobile):
4. Install
[patched `cmake-napi`](https://github.com/digidem/cmake-napi-nodejs-mobile):
```
npm install cmake-napi@github:digidem/cmake-napi-nodejs-mobile
```
Expand All @@ -43,13 +46,17 @@ Should be clear enough to follow the [reusable workflow steps](https://github.co

## Creating a release

1. Navigate to the [Generate Prebuilds workflow](https://github.com/digidem/crc-native-nodejs-mobile/actions/workflows/prebuilds.yml)
2. Manually dispatch the worflow with the version you want to build, ensuring that "Publish Release" is checked.
1. Navigate to the
[Generate Prebuilds workflow](https://github.com/digidem/crc-native-nodejs-mobile/actions/workflows/prebuilds.yml)
2. Manually dispatch the worflow with the version you want to build, ensuring
that "Publish Release" is checked.

## Contributing

We welcome contributions to this repository. If you have an idea for a new feature or have found a bug, please open an issue or submit a pull request.
We welcome contributions to this repository. If you have an idea for a new
feature or have found a bug, please open an issue or submit a pull request.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file
for more details.
Loading