Skip to content

Fix key mapping + Fix crash due to missing resource #683

Fix key mapping + Fix crash due to missing resource

Fix key mapping + Fix crash due to missing resource #683

Workflow file for this run

name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target-name: leafish
release-name: leafish-linux
- os: windows-latest
target-name: leafish.exe
release-name: leafish.exe
- os: macos-11
target-name: bundle/osx/Leafish.app.zip
release-name: Leafish.app
steps:
- uses: actions/checkout@v3
- name: Install Rust
id: toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy, rustfmt
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-rustc_hash-${{ steps.toolchain.outputs.rustc_hash }}-Cargo.lock_hash-${{ hashFiles('**/Cargo.lock') }}
- name: "[Linux ONLY] Install dependencies"
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libgtk-3-dev
- name: "[Linux ONLY] Check formatting"
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
cargo fmt --all -- --check
- name: Run clippy
uses: actions-rs/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets -- -D warnings
- name: Build binary
env:
MACOSX_DEPLOYMENT_TARGET: 10.14
run: cargo build --verbose --release
- name: Run tests
run: cargo test --verbose
- name: "[MacOS ONLY] Package binary"
if: ${{ matrix.os == 'macos-11' }}
run: |
chmod a+x target/release/leafish
cargo install cargo-bundle || echo "cargo-bundle already installed"
cargo bundle --release
cd target/release/bundle/osx
zip -r Leafish.app.zip Leafish.app
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.release-name }}
path: target/release/${{ matrix.target-name }}
- name: Release binary
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
target/release/${{ matrix.name }}