Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build production Rust library in CI #11

Merged
merged 1 commit into from
Sep 24, 2024
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
11 changes: 1 addition & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,11 @@ jobs:
with:
cache-read-only: ${{ github.ref != 'refs/heads/meow' }}
- name: build
run: ./gradlew build buildDevNatives --warning-mode=all
run: ./gradlew build --warning-mode=all
- name: capture Java artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Upload artifacts from one job, ignore the rest
uses: actions/upload-artifact@v4
with:
name: kit-tunes-artifacts
path: build/libs
if-no-files-found: error
- name: capture Rust artifacts
uses: actions/upload-artifact@v4
with:
name: libkittenthoughts-${{ runner.os }}-artifacts
path: |
projects/kitten-thoughts/target/debug/*.so
projects/kitten-thoughts/target/debug/*.dylib
projects/kitten-thoughts/target/debug/*.dll
if-no-files-found: error
40 changes: 40 additions & 0 deletions .github/workflows/build_natives.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: build-natives

on: [push, pull_request]

jobs:
build:
strategy:
matrix:
platform:
- os: ubuntu-24.04
target: x86_64-unknown-linux-gnu
- os: ubuntu-24.04
target: aarch64-unknown-linux-gnu
- os: macos-14
target: x86_64-apple-darwin
- os: macos-14
target: aarch64-apple-darwin
- os: windows-2022
target: x86_64-pc-windows-msvc
- os: windows-2022
target: aarch64-pc-windows-msvc
runs-on: ${{ matrix.platform.os }}
steps:
- name: checkout repository
uses: actions/checkout@v4
- uses: houseabsolute/actions-rust-cross@v0
with:
command: build
args: "--release"
target: ${{ matrix.platform.target }}
working-directory: projects/catculator
- name: capture build artifacts
uses: actions/upload-artifact@v4
with:
name: catculator-jni-${{ matrix.platform.os }}-${{ matrix.platform.target }}
path: |
projects/catculator/target/${{ matrix.platform.target }}/release/*.dll
projects/catculator/target/${{ matrix.platform.target }}/release/*.so
projects/catculator/target/${{ matrix.platform.target }}/release/*.dylib
if-no-files-found: error
148 changes: 11 additions & 137 deletions projects/catculator/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion projects/catculator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
[dependencies]
jni = "0.21.1"
lofty = "0.21.1"
reqwest = { version = "0.12.7", features = ["blocking"] }
reqwest = { version = "0.12.7", features = ["blocking", "native-tls-vendored"], default-features = false }
rocket = "0.5.1"
tokio = "1.40.0"

Expand Down