Skip to content

Refactor lib functions #8

Refactor lib functions

Refactor lib functions #8

Workflow file for this run

name: CD
on:
push:
branches: master
paths: "**.rs"
workflow_dispatch:
env:
RELEASE_BIN: sneaky
jobs:
build_release:
name: Build release
strategy:
matrix:
include:
- os: ubuntu-latest
targets: [x86_64-unknown-linux-gnu]
- os: macos-latest
targets: [x86_64-apple-darwin, aarch64-apple-darwin]
- os: windows-latest
targets: [x86_64-pc-windows-msvc]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ join(matrix.targets, ',') }}
- uses: Swatinem/rust-cache@v2
- name: Build
shell: bash
run: |
for target in ${{ join(matrix.targets, ' ') }}; do
cargo build --release --target $target
done
- name: Upload Linux binary
uses: actions/upload-artifact@v3
with:
name: ${{ env.RELEASE_BIN }}-linux-x86_64
path: ./target/x86_64-unknown-linux-gnu/release/${{ env.RELEASE_BIN }}
if: matrix.os == 'ubuntu-latest'
- name: Upload Windows binary
uses: actions/upload-artifact@v3
with:
name: ${{ env.RELEASE_BIN }}-windows-x86_64.exe
path: ./target/x86_64-pc-windows-msvc/release/${{ env.RELEASE_BIN }}.exe
if: matrix.os == 'windows-latest'
- name: Create macOS binary
run: |
lipo -create -output ./${{ env.RELEASE_BIN }}-mac-universal ./target/x86_64-apple-darwin/release/${{ env.RELEASE_BIN }} ./target/aarch64-apple-darwin/release/${{ env.RELEASE_BIN }}
if: matrix.os == 'macos-latest'
- name: Upload macOS binary
uses: actions/upload-artifact@v3
with:
name: ${{ env.RELEASE_BIN }}-mac-universal
path: ./${{ env.RELEASE_BIN }}-mac-universal
if: matrix.os == 'macos-latest'