Skip to content
Merged
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
42 changes: 14 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: Cross-Platform Release
name: Cross-Platform Release (TESTING)

permissions:
contents: write

on:
push:
tags:
- "v*"
branches:
- "ci/9-test-android-ndk-linking"
workflow_dispatch:

jobs:
publish:
name: Build for ${{ matrix.asset_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
Expand Down Expand Up @@ -59,12 +61,12 @@ jobs:
target: aarch64-linux-android
binary_name: rstf
asset_name: rstf-android-arm64
use_cross: false
use_cross: true
- os: ubuntu-latest
target: x86_64-linux-android
binary_name: rstf
asset_name: rstf-android-amd64
use_cross: false
use_cross: true

steps:
- name: Checkout code
Expand All @@ -84,16 +86,6 @@ jobs:
if: contains(matrix.target, 'musl')
run: sudo apt-get update && sudo apt-get install -y musl-tools

- name: Install Android NDK
if: contains(matrix.target, 'android')
uses: android-actions/setup-android@v3
with:
packages: 'ndk;25.2.9519653'

- name: Install cargo-ndk
if: contains(matrix.target, 'android')
run: cargo install cargo-ndk

- name: Setup Cross
if: matrix.use_cross
run: |
Expand All @@ -104,15 +96,8 @@ jobs:
- name: Build
shell: bash
run: |
TARGET="${{ matrix.target }}"
if [[ "$TARGET" == *"android"* ]]; then
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/25.2.9519653

cargo ndk -t $TARGET -p 24 build --release
else
BUILD_CMD=${{ matrix.use_cross && 'cross' || 'cargo' }}
$BUILD_CMD build --release --target $TARGET
fi
BUILD_CMD=${{ matrix.use_cross && 'cross' || 'cargo' }}
$BUILD_CMD build --release --target ${{ matrix.target }}

- name: Post-process binary
shell: bash
Expand All @@ -123,8 +108,9 @@ jobs:
fi
mv "$BIN_PATH" "${{ matrix.asset_name }}"

- name: Release
uses: softprops/action-gh-release@v2
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
files: ${{ matrix.asset_name }}
fail_on_unmatched_files: true
name: binary-${{ matrix.asset_name }}
path: ${{ matrix.asset_name }}
retention-days: 1