Skip to content

Commit c96b0c9

Browse files
ethicnologyyukibtc
andcommitted
ci: precompile binaries
Closes #3 Co-authored-by: Yuki Kishimoto <[email protected]> Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent 3ff1543 commit c96b0c9

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
on:
2+
push:
3+
branches: [ master ] # TODO: trigger manually or on tag
4+
5+
name: Precompile Binaries
6+
jobs:
7+
Precompile:
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
os:
13+
- ubuntu-20.04
14+
- macOS-latest
15+
- windows-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
20+
- name: Setup Dart
21+
uses: dart-lang/setup-dart@v1
22+
23+
- name: Set up Android SDK
24+
if: (matrix.os == 'ubuntu-20.04')
25+
uses: android-actions/setup-android@v2
26+
27+
- name: Install specific NDK
28+
if: (matrix.os == 'ubuntu-20.04')
29+
run: sdkmanager --install "ndk;25.1.8937393"
30+
31+
- name: Precompile
32+
if: (matrix.os == 'macOS-latest') || (matrix.os == 'windows-latest')
33+
run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=rust-nostr/nostr-sdk-flutter
34+
working-directory: cargokit/build_tool
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
PRIVATE_KEY: ${{ secrets.CARGOKIT_PRIVATE_KEY }}
38+
39+
- name: Precompile (with Android)
40+
if: (matrix.os == 'ubuntu-20.04')
41+
run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=rust-nostr/nostr-sdk-flutter --android-sdk-location=/usr/local/lib/android/sdk --android-ndk-version=25.1.8937393 --android-min-sdk-version=23
42+
working-directory: cargokit/build_tool
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
PRIVATE_KEY: ${{ secrets.CARGOKIT_PRIVATE_KEY }}

cargokit_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ verbose_logging: true
55
# and deployed precompiled binaries, these will be by default used whenever Rustup
66
# is not installed. With `use_precompiled_binaries` set to false, the build will
77
# instead be aborted prompting user to install Rustup.
8-
use_precompiled_binaries: false
8+
use_precompiled_binaries: true

rust/cargokit.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
cargo:
2+
debug:
3+
toolchain: stable
4+
release:
5+
toolchain: nightly
6+
extra_flags:
7+
- -Z
8+
- build-std=panic_abort,std
9+
10+
precompiled_binaries:
11+
# Uri prefix used when downloading precompiled binaries.
12+
url_prefix: https://github.com/rust-nostr/nostr-sdk-flutter/releases/download/precompiled_
13+
# Public key for verifying downloaded precompiled binaries.
14+
public_key: 25555d3af4d3d625b65b3ac917a9dfbe9caa8e450698dcef936ad6a047f0efa6

0 commit comments

Comments
 (0)