From c2cb260c9f31d64138b230308334a60d273ca766 Mon Sep 17 00:00:00 2001 From: kilyabin <65072190+kilyabin@users.noreply.github.com> Date: Thu, 18 Jun 2026 00:33:45 +0400 Subject: [PATCH] ci: add GitHub Actions workflows for CI and release builds --- .github/workflows/ci.yml | 42 ++++++++++++ .github/workflows/release.yml | 123 ++++++++++++++++++++++++++++++++++ README.md | 35 +++++++++- 3 files changed, 197 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b8128df --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: + push: + branches: [master, main] + pull_request: + +jobs: + check: + name: Check & Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust (stable) + uses: dtolnay/rust-toolchain@stable + with: + components: clippy + + - name: Cache cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} + restore-keys: ${{ runner.os }}-cargo- + + - name: Install system dependencies + run: | + sudo apt-get update -q + sudo apt-get install -y --no-install-recommends \ + libwayland-dev \ + libxkbcommon-dev \ + pkg-config + + - name: cargo check + run: cargo check + + - name: cargo clippy + run: cargo clippy -- -D warnings diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ad4389a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,123 @@ +name: Release + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +jobs: + build: + name: Build ${{ matrix.target }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-unknown-linux-gnu + artifact: scr33ny-x86_64-linux + - target: aarch64-unknown-linux-gnu + artifact: scr33ny-aarch64-linux + cross: true + + steps: + - uses: actions/checkout@v4 + + - name: Install Rust (stable) + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + + - name: Cache cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.toml') }} + restore-keys: ${{ runner.os }}-${{ matrix.target }}-cargo- + + # Native x86_64 build + - name: Install system dependencies (native) + if: ${{ !matrix.cross }} + run: | + sudo apt-get update -q + sudo apt-get install -y --no-install-recommends \ + libwayland-dev \ + libxkbcommon-dev \ + pkg-config + + - name: Build (native) + if: ${{ !matrix.cross }} + run: cargo build --release --target ${{ matrix.target }} + + # ARM64 cross-compilation via cross + - name: Install cross + if: ${{ matrix.cross }} + uses: taiki-e/install-action@v2 + with: + tool: cross + + - name: Build (cross) + if: ${{ matrix.cross }} + run: cross build --release --target ${{ matrix.target }} + env: + CROSS_NO_WARNINGS: 0 + + - name: Rename binary + run: | + cp target/${{ matrix.target }}/release/scr33ny ${{ matrix.artifact }} + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.artifact }} + path: ${{ matrix.artifact }} + + release: + name: Create GitHub Release + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: List artifacts + run: ls -lh artifacts/ + + - name: Create release + uses: softprops/action-gh-release@v2 + with: + name: "scr33ny ${{ github.ref_name }}" + body: | + ## Install + + Download the binary for your architecture, make it executable, and move it to your PATH: + + ```bash + # x86_64 (most desktops/laptops) + curl -Lo scr33ny https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/scr33ny-x86_64-linux + chmod +x scr33ny + sudo mv scr33ny /usr/local/bin/ + + # ARM64 (Raspberry Pi 4+, Apple Silicon VM, etc.) + curl -Lo scr33ny https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/scr33ny-aarch64-linux + chmod +x scr33ny + sudo mv scr33ny /usr/local/bin/ + ``` + + **Requirements:** Wayland compositor, `libwayland-client`, `libxkbcommon`. + + See [README](https://github.com/${{ github.repository }}#readme) for usage and config. + files: | + artifacts/scr33ny-x86_64-linux/scr33ny-x86_64-linux + artifacts/scr33ny-aarch64-linux/scr33ny-aarch64-linux + draft: false + prerelease: ${{ contains(github.ref_name, '-') }} diff --git a/README.md b/README.md index 8c277cb..6dde1f9 100644 --- a/README.md +++ b/README.md @@ -23,14 +23,43 @@ The screen goes black. OLED pixels turn off. Burn-in protection kicks in. ## Install +### Pre-built binary (recommended) + +Download the latest binary from [Releases](https://github.com/kilyabin/scr33ny/releases/latest): + ```bash -git clone +# x86_64 (most desktops/laptops) +curl -Lo scr33ny https://github.com/kilyabin/scr33ny/releases/latest/download/scr33ny-x86_64-linux +chmod +x scr33ny +sudo mv scr33ny /usr/local/bin/ + +# ARM64 (Raspberry Pi 4+, etc.) +curl -Lo scr33ny https://github.com/kilyabin/scr33ny/releases/latest/download/scr33ny-aarch64-linux +chmod +x scr33ny +sudo mv scr33ny /usr/local/bin/ +``` + +**Runtime requirements:** Wayland compositor, `libwayland-client`, `libxkbcommon`. +These are present on any Wayland desktop (Sway, Hyprland, GNOME Wayland, KDE Wayland). + +### Build from source + +Requires a Rust toolchain (`rustup.rs`) and Wayland dev headers: + +```bash +# Arch Linux +sudo pacman -S wayland libxkbcommon pkgconf + +# Ubuntu / Debian +sudo apt install libwayland-dev libxkbcommon-dev pkg-config +``` + +```bash +git clone https://github.com/kilyabin/scr33ny cd scr33ny cargo install --path . ``` -Requires a Rust toolchain (`rustup.rs`). No system libraries beyond Wayland. - --- ## Usage