vietc/.github/workflows/build.yml
Khoa Vo 88d39b4475
Some checks are pending
Build & Release / Build & test (push) Waiting to run
Build & Release / Build .deb (push) Blocked by required conditions
release: v0.1.6 — uinput-first injection, window-switch fix, Telex disabled
- uinput injection is now primary on X11 (XTest fallback)
- X11 XTest keycode offset +8 fixed for all send_keycode paths
- Window switch detection on every keystroke (no more gap > 100ms guard)
- Telex greyed out in tray with '(next version)' label
- Flatpak and AppImage removed; only .deb packaging
- All Cargo.toml versions bumped to 0.1.6
2026-06-29 16:07:15 +07:00

95 lines
2.6 KiB
YAML

name: Build & Release
# Builds the .deb on the CI runner so artifacts are produced
# without compiling on a local machine:
# - every push to main / pull request -> packages uploaded as workflow artifacts
# - pushing a `v*` tag -> a GitHub Release with the .deb
on:
push:
branches: [main]
tags: ['v*']
pull_request:
workflow_dispatch:
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Build & test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
pkg-config libdbus-1-dev libx11-dev libxtst-dev libxext-dev
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build workspace
run: cargo build --release --features "x11,wayland"
- name: Run tests
run: cargo test --release
package:
name: Build .deb
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install packaging dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
pkg-config libdbus-1-dev libx11-dev libxtst-dev libxext-dev \
fakeroot dpkg-dev xclip xdotool desktop-file-utils file curl
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Determine version
id: ver
run: |
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
VERSION="${GITHUB_REF#refs/tags/v}"
else
BASE=$(grep '^version' engine/Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')
VERSION="$BASE"
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "short_sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
echo "Building version $VERSION"
- name: Build .deb
run: bash packaging/deb/build-deb.sh "${{ steps.ver.outputs.version }}"
- name: Collect artifacts
run: |
mkdir -p dist
cp packaging/deb/*.deb dist/
ls -la dist
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: vietc-deb-${{ steps.ver.outputs.version }}-${{ steps.ver.outputs.short_sha }}
path: dist/*
if-no-files-found: error
- name: Publish GitHub Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true