Release #8
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: Release | |
on: | |
push: | |
tags: | |
- "v*" # Triggers the workflow on version tags like v1.0.0 | |
jobs: | |
build: | |
name: Build and Release | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
extension: "" | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-gnu | |
extension: "" | |
use-cross: true | |
- os: ubuntu-latest | |
target: armv7-unknown-linux-gnueabihf | |
extension: "" | |
use-cross: true | |
- os: ubuntu-latest | |
target: riscv64gc-unknown-linux-gnu | |
extension: "" | |
use-cross: true | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
extension: "" | |
- os: macos-11 | |
target: aarch64-apple-darwin | |
extension: "" | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
extension: ".exe" | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
override: true | |
- name: Install cross | |
if: ${{ !startsWith(matrix.os, 'windows') }} | |
shell: bash | |
run: | | |
if [ "${{ matrix.use-cross }}" = "true" ]; then | |
cargo install cross | |
else | |
echo "This platform does not need cross" | |
fi | |
- name: Build the project | |
run: | | |
if [ "${{ matrix.use-cross }}" = "true" ]; then | |
cross build --release --target ${{ matrix.target }} | |
else | |
cargo build --release --target ${{ matrix.target }} | |
fi | |
shell: bash | |
- name: Copy files with correct name | |
shell: bash | |
run: | | |
mkdir -p release | |
cp "target/${{ matrix.target }}/release/weaveconfig${{ matrix.extension }}" "release/weaveconfig-${{ matrix.target }}${{ matrix.extension }}" | |
- name: Upload Release Assets | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
release/weaveconfig-${{ matrix.target }}${{ matrix.extension }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |