v0.3.0 #24
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: Build Release Binary | |
permissions: | |
contents: write | |
on: | |
release: | |
types: [published] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-pi: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./scanner_code | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set Targets | |
run: rustup target add arm-unknown-linux-gnueabihf | |
- name: install deps | |
run: sudo apt update && sudo apt-get install libssl-dev gcc-arm-linux-gnueabihf | |
- name: Build | |
run: cargo build --release --target arm-unknown-linux-gnueabihf | |
- uses: svenstaro/upload-release-action@v2 | |
with: | |
asset_name: pi-binary | |
file: scanner_code/target/arm-unknown-linux-gnueabihf/release/scanner_code | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
build-mac: | |
runs-on: macos-latest | |
defaults: | |
run: | |
working-directory: ./scanner_code | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set Targets | |
run: rustup target add x86_64-apple-darwin aarch64-apple-darwin | |
- name: build arm | |
run: cargo build --release --target aarch64-apple-darwin | |
- name: build intel | |
run: cargo build --release --target x86_64-apple-darwin | |
- name: create universal binary | |
run: lipo -create -output universal target/x86_64-apple-darwin/release/scanner_code target/aarch64-apple-darwin/release/scanner_code | |
- uses: svenstaro/upload-release-action@v2 | |
with: | |
asset_name: mac-binary | |
file: scanner_code/universal | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} |