From 307a26efdf6b68e8a01f255dbb246f6b87d553e1 Mon Sep 17 00:00:00 2001 From: zephyr Date: Sun, 10 Aug 2025 21:33:01 +0900 Subject: [PATCH] add mips targets --- .github/workflows/cross_compile.yml | 33 ++++++++++++++++++++-- .github/workflows/release.yml | 43 +++++++++++++++++++++++++++-- Cargo.lock | 8 +++--- Cargo.toml | 2 +- Cross.toml | 32 +++++++++++++++++++++ 5 files changed, 109 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cross_compile.yml b/.github/workflows/cross_compile.yml index 1e85c04..b883d6e 100644 --- a/.github/workflows/cross_compile.yml +++ b/.github/workflows/cross_compile.yml @@ -43,17 +43,46 @@ jobs: - name: compile run: cross build --release --target=${{ matrix.target }} - name: upload unix binary - if: "!contains(matrix.target, 'windows')" + if: ${{ !contains(matrix.target, 'windows') }} uses: actions/upload-artifact@v4 with: name: realm-${{ matrix.target }} path: target/${{ matrix.target }}/release/realm - name: upload windows binary - if: "contains(matrix.target, 'windows')" + if: ${{ contains(matrix.target, 'windows') }} uses: actions/upload-artifact@v4 with: name: realm-${{ matrix.target }} path: target/${{ matrix.target }}/release/realm.exe + build-corss-mips: + runs-on: ubuntu-22.04 + strategy: + matrix: + target: + - mips-unknown-linux-gnu + - mips-unknown-linux-musl + - mipsel-unknown-linux-gnu + - mipsel-unknown-linux-musl + - mips64-unknown-linux-gnuabi64 + - mips64-unknown-linux-muslabi64 + - mips64el-unknown-linux-gnuabi64 + - mips64el-unknown-linux-muslabi64 + steps: + - uses: actions/checkout@v4 + - name: install toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: nightly + targets: 'x86_64-unknown-linux-gnu' + - name: install cross + run: cargo install cross --git https://github.com/cross-rs/cross + - name: compile + run: RUSTFLAGS='-C target-feature=-crt-static' cross build --profile=release-thin --no-default-features --features default-ring --target=${{ matrix.target }} + - name: upload unix-mips binary + uses: actions/upload-artifact@v4 + with: + name: realm-${{ matrix.target }} + path: target/${{ matrix.target }}/release-thin/realm build-windows: runs-on: windows-latest strategy: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ea30334..ed8741f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,13 +37,13 @@ jobs: - name: compile run: cross build --release --target=${{ matrix.target }} - name: pack unix binary - if: "!contains(matrix.target, 'windows')" + if: ${{ !contains(matrix.target, 'windows') }} run: | mkdir -p release-${{ matrix.target }} cd release-${{ matrix.target }} tar -C ../target/${{ matrix.target }}/release -zcf realm-${{ matrix.target }}.tar.gz realm - name: pack windows binary - if: "contains(matrix.target, 'windows')" + if: ${{ contains(matrix.target, 'windows') }} run: | mkdir -p release-${{ matrix.target }} cd release-${{ matrix.target }} @@ -58,6 +58,45 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: files: release-${{ matrix.target }}/* + release-corss-mips: + runs-on: ubuntu-22.04 + strategy: + matrix: + target: + - mips-unknown-linux-gnu + - mips-unknown-linux-musl + - mipsel-unknown-linux-gnu + - mipsel-unknown-linux-musl + - mips64-unknown-linux-gnuabi64 + - mips64-unknown-linux-muslabi64 + - mips64el-unknown-linux-gnuabi64 + - mips64el-unknown-linux-muslabi64 + steps: + - uses: actions/checkout@v4 + - name: install toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: nightly + targets: 'x86_64-unknown-linux-gnu' + - name: install cross + run: cargo install cross --git https://github.com/cross-rs/cross + - name: compile + run: RUSTFLAGS='-C target-feature=-crt-static' cross build --profile=release-thin --no-default-features --features default-ring --target=${{ matrix.target }} + - name: pack unix-mips binary + run: | + mkdir -p release-${{ matrix.target }} + cd release-${{ matrix.target }} + tar -C ../target/${{ matrix.target }}/release-thin -zcf realm-${{ matrix.target }}.tar.gz realm + - name: add signature + run: | + cd release-${{ matrix.target }} + sha256sum realm-${{ matrix.target }}.tar.gz > realm-${{ matrix.target }}.sha256 + - name: release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: release-${{ matrix.target }}/* release-windows: runs-on: windows-latest strategy: diff --git a/Cargo.lock b/Cargo.lock index 20561db..da348e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1014,9 +1014,9 @@ dependencies = [ [[package]] name = "kaminari" -version = "0.13.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666c8029950f97555b7a442951494a363a90008719f690822c5d5d8f9c029fba" +checksum = "2546fd61ce52ddfbe635992d3305cc6a182e2c6d7de208850847265186096dce" dependencies = [ "aws-lc-rs", "lazy_static", @@ -1501,6 +1501,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0068c5b3cab1d4e271e0bb6539c87563c43411cad90b057b15c79958fbeb41f7" dependencies = [ + "aws-lc-rs", "pem", "ring", "rustls-pki-types", @@ -1510,7 +1511,7 @@ dependencies = [ [[package]] name = "realm" -version = "2.9.0" +version = "2.9.1" dependencies = [ "cfg-if", "chrono", @@ -1735,7 +1736,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ebcbd2f03de0fc1122ad9bb24b127a5a6cd51d72604a3f3c50ac459762b6cc" dependencies = [ "aws-lc-rs", - "log", "once_cell", "ring", "rustls-pki-types", diff --git a/Cargo.toml b/Cargo.toml index e59988b..f073a28 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "realm" -version = "2.9.0" +version = "2.9.1" authors = ["zhboner "] edition = "2021" diff --git a/Cross.toml b/Cross.toml index 3e31cf6..82de4b3 100644 --- a/Cross.toml +++ b/Cross.toml @@ -3,3 +3,35 @@ pre-build = [ "apt update", "apt install -y clang libclang-dev nasm" ] + +[target.mips-unknown-linux-gnu] +image = "ghcr.io/cross-rs/mips-unknown-linux-gnu:main" +build-std = ["core", "std", "alloc", "proc_macro", "panic_abort"] + +[target.mips-unknown-linux-musl] +image = "ghcr.io/cross-rs/mips-unknown-linux-musl:main" +build-std = ["core", "std", "alloc", "proc_macro", "panic_abort"] + +[target.mipsel-unknown-linux-gnu] +image = "ghcr.io/cross-rs/mipsel-unknown-linux-gnu:main" +build-std = ["core", "std", "alloc", "proc_macro", "panic_abort"] + +[target.mipsel-unknown-linux-musl] +image = "ghcr.io/cross-rs/mipsel-unknown-linux-musl:main" +build-std = ["core", "std", "alloc", "proc_macro", "panic_abort"] + +[target.mips64-unknown-linux-gnuabi64] +image = "ghcr.io/cross-rs/mips64-unknown-linux-gnuabi64:main" +build-std = ["core", "std", "alloc", "proc_macro", "panic_abort"] + +[target.mips64-unknown-linux-muslabi64] +image = "ghcr.io/cross-rs/mips64-unknown-linux-muslabi64:main" +build-std = ["core", "std", "alloc", "proc_macro", "panic_abort"] + +[target.mips64el-unknown-linux-gnuabi64] +image = "ghcr.io/cross-rs/mips64el-unknown-linux-gnuabi64:main" +build-std = ["core", "std", "alloc", "proc_macro", "panic_abort"] + +[target.mips64el-unknown-linux-muslabi64] +image = "ghcr.io/cross-rs/mips64el-unknown-linux-muslabi64:main" +build-std = ["core", "std", "alloc", "proc_macro", "panic_abort"]