zip loadable extensions so people do not need to rename them #71
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: publish | |
on: | |
push: | |
tags: | |
- "v*" | |
- "prebuild-test.*" | |
jobs: | |
prebuild: | |
name: Prebuild for ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
library_name: crsqlite.so | |
artifact_name: crsqlite.zip | |
asset_name: crsqlite-linux-x86_64.zip | |
- os: macos-latest | |
library_name: crsqlite.dylib | |
artifact_name: crsqlite.zip | |
asset_name: crsqlite-darwin-x86_64.zip | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Load .env file | |
uses: xom9ikk/dotenv@v2 | |
with: | |
path: ./ | |
- name: Build | |
run: | | |
cd core | |
make loadable | |
zip dist/crsqlite.zip dist/${{ matrix.library_name }} | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: core/dist/${{ matrix.artifact_name }} | |
asset_name: ${{ matrix.asset_name }} | |
tag: ${{ github.ref }} | |
# we can probably collapse all these into the prebuild job | |
prebuild-macos-arm: | |
name: Prebuild for macos arm | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
library_name: crsqlite.dylib | |
artifact_name: crsqlite.zip | |
asset_name: crsqlite-darwin-aarch64.zip | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Rust Nightly | |
run: | | |
rustup toolchain install nightly-2023-10-05 | |
rustup target add aarch64-apple-darwin --toolchain nightly-2023-10-05 | |
- name: Build MacOS Arm dylib | |
run: | | |
cd core | |
export CI_MAYBE_TARGET="aarch64-apple-darwin" && make loadable | |
zip dist/crsqlite.zip dist/${{ matrix.library_name }} | |
- name: Upload macos dylib to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: core/dist/${{ matrix.artifact_name }} | |
asset_name: ${{ matrix.asset_name }} | |
tag: ${{ github.ref }} | |
- name: Build all ios dynamic | |
run: | | |
cd core | |
./all-ios-loadable.sh | |
- name: Upload framework to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: core/dist/crsqlite-ios-dylib.xcframework.tar.gz | |
asset_name: crsqlite-ios-dylib.xcframework.tar.gz | |
tag: ${{ github.ref }} | |
prebuild-linux-arm: | |
name: Prebuild for linux arm | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
library_name: crsqlite.so | |
artifact_name: crsqlite.zip | |
asset_name: crsqlite-linux-aarch64.zip | |
steps: | |
- name: Install toolchain | |
run: | | |
sudo apt update && sudo apt install -y gcc make gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Rust Nightly | |
run: | | |
rustup toolchain install nightly-2023-10-05 | |
rustup target add aarch64-unknown-linux-gnu --toolchain nightly-2023-10-05 | |
rustup component add rust-src --toolchain nightly-2023-10-05-x86_64-unknown-linux-gnu | |
- name: Build | |
run: | | |
cd core | |
export CI_MAYBE_TARGET="aarch64-unknown-linux-gnu" && export CI_GCC="aarch64-linux-gnu-gcc" && make loadable | |
zip dist/crsqlite.zip dist/${{ matrix.library_name }} | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: core/dist/${{ matrix.artifact_name }} | |
asset_name: ${{ matrix.asset_name }} | |
tag: ${{ github.ref }} | |
prebuild-windows-x86_64: | |
name: Prebuild for Windows x86_64 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
library_name: crsqlite.dll | |
artifact_name: crsqlite.zip | |
asset_name: crsqlite-win-x86_64.zip | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Rust Nightly | |
run: | | |
rustup toolchain install nightly-2023-10-05 | |
rustup target add x86_64-pc-windows-gnu --toolchain nightly-2023-10-05 | |
rustup component add rust-src --toolchain nightly-2023-10-05-x86_64-unknown-linux-gnu | |
- name: mingw-w64 | |
run: | | |
sudo apt update && sudo apt install -y mingw-w64 | |
- name: Build | |
run: | | |
cd core | |
export CI_MAYBE_TARGET="x86_64-pc-windows-gnu" && export CI_GCC="x86_64-w64-mingw32-gcc" && make loadable | |
zip dist/crsqlite.zip dist/${{ matrix.library_name }} | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: core/dist/${{ matrix.artifact_name }} | |
asset_name: ${{ matrix.asset_name }} | |
tag: ${{ github.ref }} | |
prebuild-windows-i686: | |
name: Prebuild for Windows i686 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
library_name: crsqlite.dll | |
artifact_name: crsqlite.zip | |
asset_name: crsqlite-win-i686.zip | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Rust Nightly | |
run: | | |
rustup toolchain install nightly-2023-10-05 | |
rustup target add i686-pc-windows-gnu --toolchain nightly-2023-10-05 | |
rustup component add rust-src --toolchain nightly-2023-10-05-x86_64-unknown-linux-gnu | |
- name: mingw-w64 | |
run: | | |
sudo apt update && sudo apt install -y mingw-w64 | |
- name: Build | |
run: | | |
cd core | |
export CI_MAYBE_TARGET="i686-pc-windows-gnu" && export CI_GCC="i686-w64-mingw32-gcc" && make loadable | |
zip dist/crsqlite.zip dist/${{ matrix.library_name }} | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: core/dist/${{ matrix.artifact_name }} | |
asset_name: ${{ matrix.asset_name }} | |
tag: ${{ github.ref }} | |
prebuild-android: | |
name: Prebuild for android | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
library_name: crsqlite.so | |
artifact_name: crsqlite.zip | |
asset_name: crsqlite-aarch64-linux-android.zip | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Rust Nightly | |
run: | | |
rustup toolchain install nightly-2023-10-05 | |
rustup target add aarch64-linux-android --toolchain nightly-2023-10-05 | |
rustup component add rust-src --toolchain nightly-2023-10-05-x86_64-unknown-linux-gnu | |
- uses: nttld/setup-ndk@v1 | |
id: setup-ndk | |
with: | |
ndk-version: r25c | |
local-cache: true | |
add-to-path: false | |
- name: Cargo NDK | |
run: cargo install cargo-ndk | |
- name: Build | |
env: | |
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
run: | | |
cd core | |
export ANDROID_TARGET=aarch64-linux-android; make loadable | |
zip dist/crsqlite.zip dist/${{ matrix.library_name }} | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: core/dist/${{ matrix.artifact_name }} | |
asset_name: ${{ matrix.asset_name }} | |
tag: ${{ github.ref }} |