fix gh workflow (#183) #21
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: Create release, build and upload artifacts | |
permissions: | |
contents: write | |
on: | |
push: | |
tags: | |
- v[0-9]+.* | |
env: | |
CLICOLOR_FORCE: 1 | |
jobs: | |
create-build-upload: | |
name: Build, package and publish | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
rust: [stable] | |
env: | |
RUST_BACKTRACE: full | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: ${{ runner.os }}-rust-cache-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install gstreamer (ubuntu-latest) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libunwind-dev libgstreamer1.0-dev | |
- name: Install gstreamer (macos-latest) | |
if: matrix.os == 'macos-latest' | |
run: | | |
brew install gstreamer | |
- name: Install Rust Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
- name: Install cargo binstall | |
run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash | |
- name: Install Cargo Plugins | |
run: cargo binstall --force --no-confirm cargo-make cargo-insta sqlx-cli | |
- name: Create db file | |
run: "touch /tmp/data.db && cd hifirs && cargo sqlx database reset -y" | |
env: | |
DATABASE_URL: "sqlite:///tmp/data.db" | |
- name: Build app | |
if: matrix.os == 'ubuntu-latest' | |
run: cargo build --bin hifi-rs --release --target x86_64-unknown-linux-gnu | |
env: | |
SQLITE3_STATIC: true | |
PKG_CONFIG_ALL_STATIC: true | |
PKG_CONFIG_PATH_x86_64_unknown_linux_gnu: /usr/lib/x86_64-linux-gnu/pkgconfig | |
DATABASE_URL: "sqlite:///tmp/data.db" | |
- name: Release | |
if: matrix.os == 'ubuntu-latest' | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: target/x86_64-unknown-linux-gnu/release/hifi-rs | |
- name: Build app | |
if: matrix.os == 'macos-latest' | |
run: cargo build --bin hifi-rs --release --target x86_64-apple-darwin | |
env: | |
SQLITE3_STATIC: true | |
DATABASE_URL: "sqlite:///tmp/data.db" | |
- name: Release | |
if: matrix.os == 'macos-latest' | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: target/x86_64-apple-darwin/release/hifi-rs |