Skip to content

Commit

Permalink
FIX action build options
Browse files Browse the repository at this point in the history
  • Loading branch information
karminski committed Oct 4, 2024
1 parent 6ba674c commit b3a5f1b
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@ on:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTFLAGS: "-D warnings -W unreachable-pub"
RUSTUP_MAX_RETRIES: 10
FETCH_DEPTH: 0
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc

jobs:
build:
name: Build for ${{ matrix.os }}
name: Build for ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -34,35 +42,29 @@ jobs:
asset_name: core-to-core-latency-macos-arm64

steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.FETCH_DEPTH }}

- name: Install Rust
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true

- name: Set up for aarch64 cross-compilation
- name: Update apt repositories
if: contains(matrix.os, 'ubuntu')
run: sudo apt-get update -y

- name: Install AArch64 target toolchain
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo dpkg --add-architecture arm64
sudo tee /etc/apt/sources.list.d/arm64.list > /dev/null <<EOT
deb [arch=arm64] http://ports.ubuntu.com/ $(lsb_release -cs) main restricted universe multiverse
deb [arch=arm64] http://ports.ubuntu.com/ $(lsb_release -cs)-updates main restricted universe multiverse
deb [arch=arm64] http://ports.ubuntu.com/ $(lsb_release -cs)-backports main restricted universe multiverse
deb [arch=arm64] http://ports.ubuntu.com/ $(lsb_release -cs)-security main restricted universe multiverse
EOT
sudo apt-get update
sudo apt-get install -y crossbuild-essential-arm64 libssl-dev:arm64
echo "OPENSSL_DIR=/usr/aarch64-linux-gnu" >> $GITHUB_ENV
echo "OPENSSL_INCLUDE_DIR=/usr/include/aarch64-linux-gnu" >> $GITHUB_ENV
echo "OPENSSL_LIB_DIR=/usr/lib/aarch64-linux-gnu" >> $GITHUB_ENV
run: sudo apt-get install gcc-aarch64-linux-gnu libc6-dev-arm64-cross g++-aarch64-linux-gnu

- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
command: build
args: --release --target ${{ matrix.target }}

Expand All @@ -88,22 +90,21 @@ jobs:
prerelease: false

- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4

- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for asset in core-to-core-latency-*; do
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: $(file -b --mime-type $asset)" \
--data-binary @$asset \
"https://uploads.github.com/repos/${{ github.repository }}/releases/${{ steps.create_release.outputs.id }}/assets?name=$(basename $asset)"
gh release upload ${{ github.ref_name }} $asset
done
publish-crates:
needs: create-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Publish to crates.io
uses: actions-rs/cargo@v1
with:
Expand Down

0 comments on commit b3a5f1b

Please sign in to comment.