Skip to content

Commit

Permalink
chore: support building ARM release for windows and linux (#268)
Browse files Browse the repository at this point in the history
Added in build pipeline steps to compile targeting arm architecture for both Windows and Linux systems.
  • Loading branch information
bladeswords authored Dec 18, 2024
1 parent 278b119 commit f88d390
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@ jobs:
matrix:
build:
- linux
- linux-arm
- macos-arm
- macos-intel
- windows
- windows-arm
include:
- build: linux
os: ubuntu-latest
target: x86_64-unknown-linux-gnu

- build: linux-arm
os: ubuntu-latest
target: aarch64-unknown-linux-gnu

- build: macos-intel
os: macos-latest
target: x86_64-apple-darwin
Expand All @@ -36,6 +42,10 @@ jobs:
os: windows-latest
target: x86_64-pc-windows-msvc

- build: windows-arm
os: windows-latest
target: aarch64-pc-windows-msvc

steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -62,7 +72,7 @@ jobs:
RUSTFLAGS: "-C target-feature=+crt-static"

- name: Build C library
if: matrix.build == 'windows'
if: contains(matrix.build, 'windows')
run: |
cargo install cargo-c
cargo cbuild --profile release-lto --target ${{ matrix.target }}
Expand All @@ -74,7 +84,7 @@ jobs:
run: |
set -ex
pkgname=yara-x-${{ github.ref_name }}-${{ matrix.target }}
if [ "${{ matrix.build }}" = "windows" ]; then
if [ "${{ matrix.build }}" = "windows" || "${{ matrix.build }}" == "windows-arm" ]; then
7z a $pkgname.zip ./target/${{ matrix.target }}/release-lto/yr.exe
7z a yara-x-capi-${{ github.ref_name }}-${{ matrix.target }}.zip \
./target/${{ matrix.target }}/release-lto/yara_x.h \
Expand Down

0 comments on commit f88d390

Please sign in to comment.