Skip to content
Open
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
15 changes: 9 additions & 6 deletions .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cd bdk-ffi/
git fetch --all
git checkout <tag>
cd ..
just apply-submodule-patches
just submodule-apply-patch
just clean
just build-tarball
cd tests/
Expand All @@ -30,15 +30,18 @@ just pod-install
just run-ios
```

- [ ] Create the tag
- [ ] Build the tarball
- [ ] Sign the artifact
- [ ] Create the release on GitHub
- [ ] Let people know!
- [ ] Bump the version in `package.json` and merge it
- [ ] Create and push the signed tag, pointing at the commit with the bumped
version (the workflow fails if the tag and `package.json` disagree).
This triggers the release workflow, which builds the binaries, creates
the GitHub Release with checksums, and publishes to npm

```shell
git tag v1.1.0 --sign --edit
git push upstream v1.1.0
```

- [ ] Verify the release workflow succeeded (GitHub Release assets + npm)
- [ ] Let people know!

- [ ] Bump the `next` version on `master`
30 changes: 6 additions & 24 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,18 @@
name: Setup
description: Setup Node.js and install dependencies
description: Setup Node.js, pnpm, and install dependencies

runs:
using: composite
steps:
- name: Setup pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9

- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: .nvmrc

- name: Restore dependencies
id: yarn-cache
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
**/node_modules
.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
${{ runner.os }}-yarn-
cache: pnpm

- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
run: pnpm install --frozen-lockfile --ignore-scripts
shell: bash

- name: Cache dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
**/node_modules
.yarn/install-state.gz
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}
154 changes: 50 additions & 104 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ name: CI
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
merge_group:
types:
- checks_requested

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
Expand All @@ -21,133 +25,75 @@ jobs:
uses: ./.github/actions/setup

- name: Lint files
run: yarn lint

- name: Typecheck files
run: yarn typecheck
run: pnpm lint

test:
build-android:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive

- name: Setup
uses: ./.github/actions/setup

- name: Run unit tests
run: yarn test --maxWorkers=2 --coverage

build-library:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install just
run: sudo apt-get update && sudo apt-get install -y just

- name: Setup
uses: ./.github/actions/setup
- name: Apply bdk-ffi patches
run: just submodule-apply-patch

- name: Build package
run: yarn prepare
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@1fbea72663f6d4c03efaab13560c8a24cfd2a7cc # v1.9.0
with:
toolchain: 1.91.1
target: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android

build-android:
runs-on: ubuntu-latest
env:
TURBO_CACHE_DIR: .turbo/android
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Cache Rust build
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: bdk-ffi/bdk-ffi

- name: Setup
uses: ./.github/actions/setup
- name: Install cargo-ndk
run: cargo install cargo-ndk

- name: Cache turborepo for Android
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-android-

- name: Check turborepo cache for Android
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status")

if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Install JDK
if: env.turbo_cache_hit != 1
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: 'zulu'
java-version: '17'
- name: Build Android binaries and generate bindings
run: pnpm ubrn:android --config ubrn.config.yaml

- name: Finalize Android SDK
if: env.turbo_cache_hit != 1
run: |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
- name: Typecheck files
run: pnpm typecheck

- name: Cache Gradle
if: env.turbo_cache_hit != 1
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
~/.gradle/wrapper
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Build example for Android
env:
JAVA_OPTS: "-XX:MaxHeapSize=6g"
run: |
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
- name: Build package
run: pnpm prepare

build-ios:
runs-on: macos-latest
env:
XCODE_VERSION: 16.2
TURBO_CACHE_DIR: .turbo/ios
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive

- name: Setup
uses: ./.github/actions/setup

- name: Cache turborepo for iOS
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
- name: Install just
run: brew install just

- name: Apply bdk-ffi patches
run: just submodule-apply-patch

- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@1fbea72663f6d4c03efaab13560c8a24cfd2a7cc # v1.9.0
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-ios-

- name: Check turborepo cache for iOS
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status")

if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Use appropriate Xcode version
if: env.turbo_cache_hit != 1
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
toolchain: 1.91.1
target: aarch64-apple-ios,aarch64-apple-ios-sim,x86_64-apple-ios

- name: Cache Rust build
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
xcode-version: ${{ env.XCODE_VERSION }}

- name: Install cocoapods
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
run: |
cd example
bundle install
bundle exec pod repo update --verbose
bundle exec pod install --project-directory=ios

- name: Build example for iOS
run: |
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
workspaces: bdk-ffi/bdk-ffi

- name: Build iOS binaries and generate bindings
run: pnpm ubrn:ios --config ubrn.config.yaml
Loading
Loading