Skip to content

FIX upload-artifact version #2

FIX upload-artifact version

FIX upload-artifact version #2

Workflow file for this run

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: Build
uses: actions-rs/cargo@v1
with:
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