Skip to content

ADD leaderboard link and sample usage info #16

ADD leaderboard link and sample usage info

ADD leaderboard link and sample usage info #16

Workflow file for this run

name: Build and Publish
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTFLAGS: "-D warnings -A 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.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: core-to-core-latency-plus-linux-amd64
asset_name: core-to-core-latency-plus-linux-amd64
# - os: ubuntu-latest
# target: aarch64-unknown-linux-gnu
# artifact_name: core-to-core-latency-plus-linux-arm64
# asset_name: core-to-core-latency-plus-linux-arm64
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: core-to-core-latency-plus-windows-amd64.exe
asset_name: core-to-core-latency-plus-windows-amd64.exe
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: core-to-core-latency-plus-macos-amd64
asset_name: core-to-core-latency-plus-macos-amd64
# - os: macos-latest
# target: aarch64-apple-darwin
# artifact_name: core-to-core-latency-plus-macos-arm64
# asset_name: core-to-core-latency-plus-macos-arm64
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.FETCH_DEPTH }}
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- 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 apt-get install gcc-aarch64-linux-gnu libc6-dev-arm64-cross g++-aarch64-linux-gnu
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.target }}
- name: Rename artifact
run: |
mv target/${{ matrix.target }}/release/core-to-core-latency-plus target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
shell: bash
- 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: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.FETCH_DEPTH }}
- 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@v4
with:
path: ./artifacts
- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd ./artifacts
for asset_dir in */; do
asset_file=$(find "$asset_dir" -type f)
if [ -f "$asset_file" ]; then
gh release upload ${{ github.ref_name }} "$asset_file" --clobber
else
echo "Warning: No file found in $asset_dir"
fi
done
publish-crates:
needs: create-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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