Skip to content

Commit

Permalink
Try to cross-compile for MUSL Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
pemistahl committed Mar 6, 2024
1 parent c2ccc73 commit 3c4d5d9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 41 deletions.
17 changes: 0 additions & 17 deletions .cargo/config.toml

This file was deleted.

35 changes: 14 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ jobs:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
name: Rust Release Build on Linux
x86_64-target: x86_64-unknown-linux-gnu
aarch64-target: aarch64-unknown-linux-gnu
x86_64-target: x86_64-unknown-linux-musl
aarch64-target: aarch64-unknown-linux-musl

- os: macos-latest
name: Rust Release Build on MacOS
Expand All @@ -50,21 +49,17 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- name: Install gcc-aarch64-linux-gnu
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt-get install gcc-aarch64-linux-gnu

- name: Add rustup x86_64 target
run: rustup target add ${{ matrix.x86_64-target }}

- name: Add rustup aarch64 target
run: rustup target add ${{ matrix.aarch64-target }}

- name: Build x86_64 target in release mode
run: cargo build --release --target ${{ matrix.x86_64-target }} --locked
uses: houseabsolute/actions-rust-cross@v0
with:
target: ${{ matrix.x86_64-target }}
args: '--release --locked'

- name: Build aarch64 target in release mode
run: cargo build --release --target ${{ matrix.aarch64-target }} --locked
uses: houseabsolute/actions-rust-cross@v0
with:
target: ${{ matrix.aarch64-target }}
args: '--release --locked'

- name: Get latest release version number
id: get_version
Expand Down Expand Up @@ -102,7 +97,7 @@ jobs:
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
release_name: grex ${{ steps.get_version.outputs.version }}
release_name: grex ${{ steps.get_version.outputs.version-without-v }}
file_glob: true
file: target/*/release/grex-${{ steps.get_version.outputs.version }}-*.{zip,tar.gz}

Expand Down Expand Up @@ -137,7 +132,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
name: linux-${{ matrix.target }}-wheels
path: dist

python-windows-release-build:
Expand Down Expand Up @@ -171,7 +166,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
name: windows-${{ matrix.target }}-wheels
path: dist

python-macos-release-build:
Expand Down Expand Up @@ -204,7 +199,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
name: macos-${{ matrix.target }}-wheels
path: dist

python-release-upload:
Expand All @@ -216,8 +211,6 @@ jobs:
steps:
- name: Download wheels from previous jobs
uses: actions/download-artifact@v4
with:
name: wheels

- name: Upload to PyPI
uses: PyO3/maturin-action@v1
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
[![pypi](https://img.shields.io/badge/PYPI-v1.0.1-blue?logo=PyPI&logoColor=yellow)](https://pypi.org/project/grex)
[![license](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)

[![Linux 64-bit Download](https://img.shields.io/badge/Linux%2064bit%20Download-v1.4.5-blue?logo=Linux)](https://github.com/pemistahl/grex/releases/download/v1.4.5/grex-v1.4.5-x86_64-unknown-linux-gnu.tar.gz)
[![Linux ARM64 Download](https://img.shields.io/badge/Linux%20ARM64%20Download-v1.4.5-blue?logo=Linux)](https://github.com/pemistahl/grex/releases/download/v1.4.5/grex-v1.4.5-aarch64-unknown-linux-gnu.tar.gz)
[![Linux 64-bit Download](https://img.shields.io/badge/Linux%2064bit%20Download-v1.4.5-blue?logo=Linux)](https://github.com/pemistahl/grex/releases/download/v1.4.5/grex-v1.4.5-x86_64-unknown-linux-musl.tar.gz)
[![Linux ARM64 Download](https://img.shields.io/badge/Linux%20ARM64%20Download-v1.4.5-blue?logo=Linux)](https://github.com/pemistahl/grex/releases/download/v1.4.5/grex-v1.4.5-aarch64-unknown-linux-musl.tar.gz)

[![MacOS 64-bit Download](https://img.shields.io/badge/macOS%2064bit%20Download-v1.4.5-blue?logo=Apple)](https://github.com/pemistahl/grex/releases/download/v1.4.5/grex-v1.4.5-x86_64-apple-darwin.tar.gz)
[![MacOS ARM64 Download](https://img.shields.io/badge/macOS%20ARM64%20Download-v1.4.5-blue?logo=Apple)](https://github.com/pemistahl/grex/releases/download/v1.4.5/grex-v1.4.5-aarch64-apple-darwin.tar.gz)
Expand Down
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## grex 1.4.5 (released on 05 Mar 2024)
## grex 1.4.5 (released on 06 Mar 2024)

### Improvements

Expand Down

0 comments on commit 3c4d5d9

Please sign in to comment.