diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e0ce3b9..db2ad6c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -185,3 +185,79 @@ jobs: checksum: sha256 ref: refs/tags/${{ needs.release.outputs.tag }} token: ${{ secrets.GITHUB_TOKEN }} + + # Rewrites Formula/soulseek-rs.rb in the tap to point at the archives the + # matrix just uploaded. The formula is generated whole rather than patched, so + # the workflow is the only place its contents live. + homebrew: + name: Homebrew tap + needs: [release, binaries] + if: needs.release.outputs.created == 'true' || inputs.tag != '' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + repository: michel/homebrew-tap + token: ${{ secrets.HOMEBREW_TAP_TOKEN }} + + - name: Write formula + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ needs.release.outputs.tag }} + run: | + set -euo pipefail + base="https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAG}" + sha() { + gh release download "$TAG" --repo "$GITHUB_REPOSITORY" \ + --pattern "soulseek-rs-$TAG-$1.sha256" --output - | cut -d' ' -f1 + } + mkdir -p Formula + cat > Formula/soulseek-rs.rb < ## Installation ```bash -cargo install soulseek-rs +brew install michel/tap/soulseek-rs # macOS and Linux, prebuilt +cargo install soulseek-rs # anywhere with a Rust toolchain ``` ## Usage diff --git a/website/src/pages/docs.tsx b/website/src/pages/docs.tsx index 0e602fe..58d9bb8 100644 --- a/website/src/pages/docs.tsx +++ b/website/src/pages/docs.tsx @@ -84,13 +84,13 @@ export const Docs = () => {
- You need a Rust toolchain. After cargo install, the binary is on your - PATH. + Homebrew puts the binary on your PATH. With a Rust toolchain,{' '} + cargo install soulseek-rs does the same. { - + @@ -312,7 +312,7 @@ export const Home = () => { Install it, then press s to search.

- Needs a Rust toolchain. From there it’s one command, then the TUI opens. + One command on macOS or Linux, then the TUI opens. No Rust toolchain needed.