MODIFY workflow add aarch64 version ssl lib #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Publish | |
on: | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
build: | |
name: Build for ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
artifact_name: core-to-core-latency | |
asset_name: core-to-core-latency-linux-amd64 | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-gnu | |
artifact_name: core-to-core-latency | |
asset_name: core-to-core-latency-linux-arm64 | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
artifact_name: core-to-core-latency.exe | |
asset_name: core-to-core-latency-windows-amd64.exe | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
artifact_name: core-to-core-latency | |
asset_name: core-to-core-latency-macos-amd64 | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
artifact_name: core-to-core-latency | |
asset_name: core-to-core-latency-macos-arm64 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
override: true | |
- name: Install cross-compilation tools for aarch64 | |
if: matrix.target == 'aarch64-unknown-linux-gnu' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gcc-aarch64-linux-gnu | |
sudo apt-get install -y libssl-dev:arm64 | |
- name: Set up SSL for aarch64 | |
if: matrix.target == 'aarch64-unknown-linux-gnu' | |
run: | | |
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 | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
use-cross: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }} | |
command: build | |
args: --release --target ${{ matrix.target }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.asset_name }} | |
path: target/${{ matrix.target }}/release/${{ matrix.artifact_name }} | |
create-release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
- name: Upload Release Assets | |
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)" | |
done | |
publish-crates: | |
needs: create-release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Publish to crates.io | |
uses: actions-rs/cargo@v1 | |
with: | |
command: publish | |
args: --token ${{ secrets.CRATES_IO_TOKEN }} | |
actions-timeline: | |
needs: [build, create-release, publish-crates] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: Kesin11/actions-timeline@v2 |