Skip to content

fix(ci)

fix(ci) #110

Workflow file for this run

name: release
on:
push:
tags:
- "v*"
jobs:
create-release:
name: release
runs-on: ubuntu-latest
steps:
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-release
build-release:
name: build-release
needs: ["create-release"]
strategy:
matrix:
build: [linux, linux-x11, macos, win-msvc]
include:
- build: linux
os: ubuntu-latest
rust: nightly
target: x86_64-unknown-linux-gnu
- build: linux-x11
os: ubuntu-latest
rust: nightly
target: x86_64-unknown-linux-gnu
- build: macos
os: macos-latest
rust: nightly
target: x86_64-apple-darwin
- build: win-msvc
os: windows-latest
rust: nightly
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
- name: Add mingw64 to path for x86_64
if: matrix.rust == 'nightly'
shell: bash
run: |
echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
- name: Install dependencies
shell: bash
run: |
if [ "${{ matrix.build }}" = "linux-x11" ]; then
sudo apt update -y
sudo apt install -y libx11-dev
elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
sudo apt update -y
sudo apt install -y curl gcc clang libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libseat-dev libpipewire-0.3-dev libpango1.0-dev libwayland-egl1-mesa libwayland-client++0 libwayland-client-extra++0
fi
- name: Build
shell: bash
run: |
export RUSTFLAGS="-Awarnings"
cargo build --release
- name: Build archive
shell: bash
run: |
staging="rmg_${{ matrix.build }}_${{ github.ref_name }}"
mkdir -p "$staging"
cp {README.md,LICENSE-MIT,LICENSE-APACHE,assets/gestures.zip} "$staging/"
if [ "${{ matrix.os }}" = "windows-lastest" ]; then
cp target/release/rmg.exe "$staging/"
7z a "$staging.zip" "$staging"
echo "ASSET=$staging.zip" >> $GITHUB_ENV
else
cp target/release/rmg "$staging/"
tar czf "$staging.tar.gz" "$staging"
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
fi
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
file: ${{ env.ASSET }}
asset_name: ${{ env.ASSET }}
overwrite: true
# REFS: https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/release.yml