add build workflow
This commit is contained in:
46
.github/workflows/release-linux.yml
vendored
Normal file
46
.github/workflows/release-linux.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
name: Release - Linux
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main, master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-linux:
|
||||||
|
name: Build and upload release artifact (Linux)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Cache cargo registry and git index
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
|
- name: Install Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Install system dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y \
|
||||||
|
build-essential \
|
||||||
|
pkg-config \
|
||||||
|
libwayland-dev \
|
||||||
|
libx11-dev \
|
||||||
|
libxkbcommon-dev \
|
||||||
|
libasound2-dev \
|
||||||
|
libdbus-1-dev \
|
||||||
|
libudev-dev
|
||||||
|
|
||||||
|
- name: Build (release)
|
||||||
|
run: cargo build --workspace --release
|
||||||
|
|
||||||
|
- name: Upload release artifact (Linux)
|
||||||
|
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: release-linux
|
||||||
|
path: target/release
|
||||||
33
.github/workflows/release-windows.yml
vendored
Normal file
33
.github/workflows/release-windows.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Release - Windows
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main, master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-windows:
|
||||||
|
name: Build and upload release artifact (Windows)
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Cache cargo registry and git index
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
|
- name: Install Rust
|
||||||
|
run: choco install rust-ms -y
|
||||||
|
|
||||||
|
- name: Build (release)
|
||||||
|
run: cargo build --workspace --release
|
||||||
|
|
||||||
|
- name: Upload release artifact (Windows)
|
||||||
|
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: release-windows
|
||||||
|
path: target/release/*.exe
|
||||||
Reference in New Issue
Block a user