Skip to content

Commit

Permalink
gcc cross
Browse files Browse the repository at this point in the history
  • Loading branch information
maksimryndin committed Feb 22, 2024
1 parent c9feb64 commit ffde527
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ permissions:

on:
push:
tags:
# Regex for a version number such as 0.1.0
- "[0-9]+.[0-9]+.[0-9]+"
# Regex for a prerelease such as 0.1.1rc1
- '[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
# tags:
# # Regex for a version number such as 0.1.0
# - "[0-9]+.[0-9]+.[0-9]+"
# # Regex for a prerelease such as 0.1.1rc1
# - '[0-9]+.[0-9]+.[0-9]+rc[0-9]+'

env:
CARGO_TERM_COLOR: always
Expand All @@ -22,6 +22,8 @@ jobs:
# steps:
# - name: Clone repository
# uses: actions/checkout@v4
# with:
# fetch-depth: 1

# - name: Get the release version from the tag
# shell: bash
Expand Down Expand Up @@ -135,6 +137,8 @@ jobs:
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Get the release version from the tag
shell: bash
Expand All @@ -153,37 +157,29 @@ jobs:
with:
targets: ${{ matrix.target }}

- name: Install Zig
- name: Install additional deps
shell: bash
run: |
if [ "${{ matrix.target }}" = "x86_64-unknown-linux-gnu" ]; then
exit 0
fi
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
sudo apt-get install gcc-aarch64-linux-gnu
sudo apt-get install --no-install-recommends -y g++-aarch64-linux-gnu libc6-dev-arm64-cross
fi
ZIG="zig-linux-x86_64-0.12.0-dev.2710+c3eb592a3"
wget "https://ziglang.org/builds/$ZIG.tar.xz"
tar -xvf zig-linux-x86_64-0.12.0-dev.2710+c3eb592a3.tar.xz
echo '#!/bin/sh' > linker.sh
echo "./$ZIG/zig cc -target ${{ matrix.zig_target }} $@" >> linker.sh
chmod +x linker.sh
- name: Install toolchain
shell: bash
run: |
if [ "${{ matrix.target }}" = "x86_64-unknown-linux-gnu" ]; then
exit 0
fi
rustup component add rust-std --target ${{ matrix.target }}
rustup default stable-${{ matrix.target }}
rustup target add stable-${{ matrix.target }}
rustup target add ${{ matrix.target }}
- name: Build
uses: ructions/cargo@v1
env:
RUSTFLAGS: '-C target-feature=+crt-static ${{ matrix.rustflags }}'
CC_aarch64_unknown_linux_gnu: "aarch64-linux-gnu-gcc"
with:
toolchain: stable-${{ matrix.target }}
command: build
Expand Down

0 comments on commit ffde527

Please sign in to comment.