Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
os: [linux]
os: [linux, darwin]
arch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
- uses: actions/setup-go@v7
with:
go-version-file: 'go.mod'
- uses: ruby/setup-ruby@v1.146.0
- uses: ruby/setup-ruby@v1
if: ${{ matrix.os == 'linux' }}
with:
ruby-version: '3.1'
- run: gem install fpm
Comment thread
jeremy marked this conversation as resolved.
if: ${{ matrix.os == 'linux' }}
- name: Set version
run: sed -i "s/VERSION = \"[^\"]*\"/VERSION = \"${{ inputs.version }}\"/" quickhook.go
- name: Build
Expand Down Expand Up @@ -54,12 +56,15 @@ jobs:
--version ${{ inputs.version }} \
--architecture ${{ matrix.arch }} \
--chdir build .
# - name: Copy binaries
# if: ${{ matrix.os == 'darwin' }}
# run: |
# cp build/usr/bin/quickhook quickhook-${{ matrix.os }}-${{ matrix.arch }}
- uses: actions/upload-artifact@v3
# Binary at the archive root so tool managers (e.g. mise's github
# backend) find the executable without path overrides.
- name: Package tarballs
run: |
tar -czf quickhook-${{ inputs.version }}-${{ matrix.os }}-${{ matrix.arch }}.tar.gz -C build/usr/bin quickhook
- uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.os }}-${{ matrix.arch }}
path: |
*.deb
*.rpm
*.tar.gz
3 changes: 2 additions & 1 deletion .github/workflows/release-verify-deb-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
pattern: release-linux-*
merge-multiple: true
- run: |
dpkg --info quickhook-${{ inputs.version }}-linux-amd64.deb
dpkg --contents quickhook-${{ inputs.version }}-linux-amd64.deb
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release-verify-rpm-rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
pattern: release-linux-*
merge-multiple: true
- run: |
rpm --package quickhook-${{ inputs.version }}-linux-amd64.rpm --query --info
rpm --package quickhook-${{ inputs.version }}-linux-amd64.rpm --query --list
Expand Down
29 changes: 26 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,41 @@ jobs:
- id: version
run: |
echo "${{ inputs.version }}" | sed -E "s/^v?/version=/" >> $GITHUB_OUTPUT
build-linux:
build:
uses: ./.github/workflows/release-build.yml
needs: version
with:
version: ${{ needs.version.outputs.version }}
verify-deb-ubuntu:
uses: ./.github/workflows/release-verify-deb-ubuntu.yml
needs: [version, build-linux]
needs: [version, build]
with:
version: ${{ needs.version.outputs.version }}
verify-rpm-rhel:
uses: ./.github/workflows/release-verify-rpm-rhel.yml
needs: [version, build-linux]
needs: [version, build]
with:
version: ${{ needs.version.outputs.version }}
# Draft a release with all verified assets attached; publishing stays a
# human step. Skipped on non-main refs so test dispatches of this workflow
# only build and verify.
publish:
runs-on: ubuntu-latest
if: github.ref_name == github.event.repository.default_branch
needs: [version, verify-deb-ubuntu, verify-rpm-rhel]
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: release-*
merge-multiple: true
- name: Draft release with assets
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "v${{ needs.version.outputs.version }}" \
--repo "${{ github.repository }}" \
--draft \
--generate-notes \
*.deb *.rpm *.tar.gz
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,29 @@ $ brew install quickhook
/opt/homebrew/Cellar/quickhook/1.6.2: 6 files, 3.8MB, built in 5 seconds
```

### Linux
### Binary downloads

Installable debs and RPMs are available for the [latest release](https://github.com/dirk/quickhook/releases/latest).
Tarballs for Linux and macOS, plus installable debs and RPMs for Linux, are available for the [latest release](https://github.com/dirk/quickhook/releases/latest). Assets are named `quickhook-<version>-<os>-<arch>` with `linux`/`darwin` and `amd64`/`arm64`. (Tarballs ship starting with the first release after v1.6.2; debs and RPMs are already available.)

```sh
# Installing a tarball (the binary sits at the archive root);
# substitute the latest release's version for <version>
curl -LO https://github.com/dirk/quickhook/releases/download/v<version>/quickhook-<version>-darwin-arm64.tar.gz
tar -xzf quickhook-<version>-darwin-arm64.tar.gz quickhook # then move it onto your $PATH

# Installing a .deb
wget https://github.com/dirk/quickhook/releases/download/v1.5.0/quickhook-1.5.0-amd64.deb
sudo apt install ./quickhook-1.5.0-amd64.deb
curl -LO https://github.com/dirk/quickhook/releases/download/v1.6.2/quickhook-1.6.2-linux-amd64.deb
sudo apt install ./quickhook-1.6.2-linux-amd64.deb

# Installing a .rpm
wget https://github.com/dirk/quickhook/releases/download/v1.5.0/quickhook-1.5.0-amd64.rpm
sudo rpm --install quickhook-1.5.0-amd64.rpm
curl -LO https://github.com/dirk/quickhook/releases/download/v1.6.2/quickhook-1.6.2-linux-amd64.rpm
sudo rpm --install quickhook-1.6.2-linux-amd64.rpm
```

Or let [mise](https://mise.jdx.dev) fetch the right tarball for your platform:

```sh
$ mise use --global github:dirk/quickhook
```

## Usage
Expand Down
Loading