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

add musl targets #151

Merged
merged 6 commits into from
Mar 7, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test new targets with ci
  • Loading branch information
achristmascarl committed Mar 7, 2025
commit ac84ed3fe63a08a6b57ed50da3caaa2dc5c1b595
76 changes: 76 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,79 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Clippy check
run: cargo clippy --all-targets --all-features --workspace -- -D warnings

test-publish:

name: Publishing for ${{ matrix.target }}
runs-on: ${{ matrix.os }}
env:
CARGO_TARGET_I586_UNKNOWN_LINUX_MUSL_RUSTFLAGS: -C target-feature=+sse2
permissions:
contents: write

strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
binary-postfix: ""
use-cross: true
binary-name: rainfrog
features: default
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
binary-postfix: ""
use-cross: true
binary-name: rainfrog
features: default

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable

target: ${{ matrix.target }}

profile: minimal
override: true
- uses: Swatinem/rust-cache@v2
- name: Cross build
if: ${{ matrix.use-cross == true }}
uses: houseabsolute/actions-rust-cross@v0
with:
command: build
target: ${{ matrix.target }}
args: "--release --features ${{ matrix.features }}"
cross-version: 7b79041c9278769eca57fae10c74741f5aa5c14b
- name: Cargo build
if: ${{ matrix.use-cross != true }}
uses: actions-rs/cargo@v1
with:
command: build
toolchain: stable
args: --release --target ${{ matrix.target }} --features ${{ matrix.features }}

- name: Packaging final binary
shell: bash
run: |

cd target/${{ matrix.target }}/release

########## create tar.gz ##########

BINARY_NAME=${{ matrix.binary-name }}${{ matrix.binary-postfix }}
RELEASE_NAME=${{ matrix.binary-name }}-${GITHUB_REF/refs\/tags\//}-${{ matrix.target }}

tar czvf $RELEASE_NAME.tar.gz $BINARY_NAME

########## create sha256 ##########

if [[ ${{ runner.os }} == 'Windows' ]]; then

certutil -hashfile $RELEASE_NAME.tar.gz sha256 | grep -E [A-Fa-f0-9]{64} > $RELEASE_NAME.sha256
else
shasum -a 256 $RELEASE_NAME.tar.gz > $RELEASE_NAME.sha256
fi
Loading