Update Rust crate vergen to v9 #1005
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: CICD | |
on: | |
pull_request: | |
jobs: | |
cicd: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
build: | |
- aarch64 | |
- aarch64-musl | |
- armv7 | |
- i686 | |
- amd64-musl | |
include: | |
- build: aarch64 | |
os: ubuntu-latest | |
target: aarch64-unknown-linux-gnu | |
use-cross: true | |
features: "--no-default-features --features rustls" | |
- build: aarch64-musl | |
os: ubuntu-latest | |
target: aarch64-unknown-linux-musl | |
use-cross: true | |
features: "--no-default-features --features rustls" | |
- build: armv7 | |
os: ubuntu-latest | |
target: armv7-unknown-linux-gnueabihf | |
use-cross: true | |
features: "--no-default-features --features rustls" | |
- build: i686 | |
os: ubuntu-latest | |
target: i686-unknown-linux-gnu | |
use-cross: true | |
features: "--no-default-features --features rustls" | |
- build: amd64-musl | |
os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
use-cross: true | |
features: "--no-default-features --features rustls" | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
with: | |
fetch-depth: 0 | |
- name: Install prerequisites | |
shell: bash | |
run: | | |
case ${{ matrix.target }} in | |
arm-unknown-linux-gnueabihf) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;; | |
armv7-unknown-linux-gnueabihf) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;; | |
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;; | |
aarch64-unknown-linux-musl) sudo apt-get -y update; sudo apt-get -y install gcc-aarch64-linux-gnu ;; | |
esac | |
- name: Extract crate information | |
shell: bash | |
run: | | |
echo "PROJECT_NAME=$(sed -n 's/^name = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV | |
echo "PROJECT_MAINTAINER=$(sed -n 's/^authors = \["\(.*\)"\]/\1/p' Cargo.toml)" >> $GITHUB_ENV | |
echo "PROJECT_HOMEPAGE=$(sed -n 's/^homepage = "\(.*\)"/\1/p' Cargo.toml)" >> $GITHUB_ENV | |
PROJECT_VERSION="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" | |
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV | |
if [[ $PROJECT_VERSION == *-pre ]]; then | |
echo "VERSION_SUFFIX=nightly" >> $GITHUB_ENV | |
else | |
echo "VERSION_SUFFIX=$PROJECT_VERSION" >> $GITHUB_ENV | |
fi | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
override: true | |
default: true | |
- name: Show version information (Rust, cargo, GCC) | |
shell: bash | |
run: | | |
gcc --version || true | |
rustup -V | |
rustup toolchain list | |
rustup default | |
cargo -V | |
rustc -V | |
- name: Check format | |
run: cargo fmt -- --check | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
use-cross: ${{ matrix.use-cross }} | |
command: build | |
args: ${{ matrix.features }} --release --target=${{ matrix.target }} | |
cicd-win: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
default: true | |
- name: Extract crate information | |
shell: bash | |
run: | | |
echo "PROJECT_NAME=$(sed -n 's/^name = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV | |
PROJECT_VERSION="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" | |
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV | |
if [[ $PROJECT_VERSION == *-pre ]]; then | |
echo "VERSION_SUFFIX=nightly" >> $GITHUB_ENV | |
else | |
echo "VERSION_SUFFIX=$PROJECT_VERSION" >> $GITHUB_ENV | |
fi | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: ${{ matrix.features }} --release | |
cicd-mac: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: x86_64-apple-darwin | |
override: true | |
default: true | |
- name: Extract crate information | |
shell: bash | |
run: | | |
echo "PROJECT_NAME=$(sed -n 's/^name = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV | |
PROJECT_VERSION="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" | |
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV | |
if [[ $PROJECT_VERSION == *-pre ]]; then | |
echo "VERSION_SUFFIX=nightly" >> $GITHUB_ENV | |
else | |
echo "VERSION_SUFFIX=$PROJECT_VERSION" >> $GITHUB_ENV | |
fi | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: ${{ matrix.features }} --release |