Skip to content

Commit

Permalink
Create release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
oluiscabral committed Nov 29, 2024
1 parent ffe7d44 commit 7db1741
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 55 deletions.
55 changes: 0 additions & 55 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,58 +133,3 @@ jobs:
- name: Java tests
run: gradle test
working-directory: ./java

android:
name: Build on Linux for Android
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android

- name: Set up Cargo Cache
uses: Swatinem/rust-cache@v2
with:
save-if: false

- name: Run tests
run: cargo test --workspace --verbose

- name: Build Release
run: cargo build --verbose --release

- name: Install JDK
uses: actions/[email protected]
with:
distribution: "temurin"
java-version: "22"

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3

- name: Java tests
run: gradle test
working-directory: ./java

# Upload fs-storage JNI libs
- name: Install cargo-ndk
run: cargo install cargo-ndk

- name: Build fs-storage JNI libs
run: cargo ndk -o ./target/release/fs-storage/jniLibs --target aarch64-linux-android --target armv7-linux-androideabi --target i686-linux-android --target x86_64-linux-android build -p fs-storage --release

- name: Upload fs-storage JNI libs
uses: actions/upload-artifact@v4
with:
name: fs-storage-jni-libs
path: ./target/release/fs-storage/jniLibs

- name: Publish Java release
run: gradle publish
working-directory: ./java
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release

on:
push:
tags:
- "*"

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android

- name: Set up Cargo Cache
uses: Swatinem/rust-cache@v2
with:
save-if: false

- name: Run tests
run: cargo test --workspace --verbose

- name: Build Release
run: cargo build --verbose --release

- name: Install JDK
uses: actions/[email protected]
with:
distribution: "temurin"
java-version: "22"

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3

- name: Java tests
run: gradle test
working-directory: ./java

# Upload fs-storage JNI libs
- name: Install cargo-ndk
run: cargo install cargo-ndk

- name: Build fs-storage JNI libs
run: cargo ndk -o ./target/release/fs-storage/jniLibs --target aarch64-linux-android --target armv7-linux-androideabi --target i686-linux-android --target x86_64-linux-android build -p fs-storage --release

- name: Create JNI libs release
- uses: ncipollo/release-action@v1
with:
makeLatest: true
artifacts: "./target/release/fs-storage/jniLibs"

- name: Publish Java release
run: gradle publish
working-directory: ./java
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 7db1741

Please sign in to comment.