diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f718fcf6..fcbdefa5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,9 +20,33 @@ jobs: cat > body.md < HERE + - name: Build release archive + run: | + set -euo pipefail + rustup toolchain install stable --profile minimal + rustup default stable + cargo build --release + + mkdir -p dist/ + tar -C target/release -czf "dist/phrog-x86_64-unknown-linux-gnu.tar.gz" phrog - uses: softprops/action-gh-release@v2 with: body_path: body.md generate_release_notes: true prerelease: ${{ steps.prerelease.outputs.prerelease }} + files: | + dist/phrog-x86_64-unknown-linux-gnu.tar.gz token: ${{ secrets.RELEASE_GITHUB_TOKEN }} + + publish-crate: + runs-on: ubuntu-latest + needs: release + if: ${{ !contains(github.ref_name, '_rc') }} + steps: + - uses: actions/checkout@v4 + - name: Publish phrog to crates.io + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: | + set -euo pipefail + cargo publish --locked --no-verify diff --git a/Cargo.toml b/Cargo.toml index 61ebbb7f..fba873ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,3 +42,8 @@ wayland-protocols-misc = { version = "0.3", features = ["client"] } wayland-protocols-wlr = { version = "0.3", features = ["client"] } tempfile = "3" serde = "1.0.217" + +[package.metadata.binstall] +bin-dir = "{ bin }{ binary-ext }" +pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.tar.gz" +pkg-fmt = "tgz" diff --git a/README.md b/README.md index 682f092a..f6981bd1 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,22 @@ Want to use phrog on another distro? [Please get in touch.](#getting-help) If you want to run it manually, you'll need to build from source (see below), and then take a look at the existing packaging to understand how to wire up the necessary bits to spawn a functional greeter session under greetd. +### crates.io / cargo-install + +`phrog` is also published on crates.io, so you can install it directly with Cargo: + +```sh +cargo install phrog +``` + +If you're using [`cargo-binstall`](https://github.com/cargo-bins/cargo-binstall), this also works: + +```sh +cargo binstall phrog +``` + +`cargo-binstall` will use pre-built binaries when available and otherwise fall back to building from source. + ## Development `libphosh` 0.45 is required to build this project.