Skip to content

Commit

Permalink
ci: Replace embedded quay.io image with appimage
Browse files Browse the repository at this point in the history
This commit creates a new GHA job that builds and uploads the bpftrace
appimage to the commit's build artifacts. This is intended to replace
the previous quay.io images.

Also update scripts/create-assets.md and release_process.md to use the
appimage. Note we stop compressing the bpftrace binary alone -- the
appimage is already zstd compressed.
  • Loading branch information
danobi committed Nov 16, 2023
1 parent 4e334ce commit 4c24ee9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 13 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/binary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow builds and uploads the bpftrace appimage as a build artifact.
#
# This is useful for users who want to download the latest and greatest bpftrace
# binary without going through a local build.

name: Binary

on:
push:
branches:
- master

jobs:
build-and-upload:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v4
- uses: DeterminateSystems/magic-nix-cache-action@v2

- name: Build appimage
run: nix build .#appimage

- name: Upload appimage
uses: actions/upload-artifact@v3
with:
name: bpftrace
path: ./result
6 changes: 0 additions & 6 deletions docs/release_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,5 @@ You must do these things to formally release a version:
as "commits"), then "Draft a new release". The tag version and release title
should be the same and in `vX.Y.Z` format. The tag description should
be the same as what you added to `CHANGELOG.md`.
1. Once the release tag pipeline has finished, extract the bpftrace binary from
the release build on and attach it to the release.
- `docker run -v
$(pwd):/output quay.io/iovisor/bpftrace:vXX.YY.ZZ /bin/bash -c "cp
/usr/bin/bpftrace /output"`
1. Run `scripts/create-assets.sh` from bpftrace root dir and attach the
generated archives to the release.

12 changes: 5 additions & 7 deletions scripts/create-assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ function info() {

[[ -d tools ]] || err "'tools' directory not found, run script from bpftrace root dir"
[[ -d man ]] || err "'man' directory not found, run script from bpftrace root dir"
[[ -f bpftrace ]] || err "bpftrace binary not found, download the build artifact"
command -v zstd >/dev/null 2>&1 || err "zstd command not found, required for release"
command -v asciidoctor >/dev/null 2>&1 || err "asciidoctor not found, required for manpage"

Expand Down Expand Up @@ -44,16 +43,15 @@ gzip "$TMP/share/man/man8/"*
asciidoctor man/adoc/bpftrace.adoc -b manpage -o - | gzip - > "$TMP/share/man/man8/bpftrace.8.gz"
tar --xz -cf "$OUT/man.tar.xz" -C "$TMP/share" man

info "Building bpftrace appimage"
nix build .#appimage

info "Creating bundle"
cp bpftrace "$TMP/bin/bpftrace"
cp ./result "$OUT/bpftrace"
cp ./result "$TMP/bin/bpftrace"
tar -cf "$OUT/binary_tools_man-bundle.tar" -C "$TMP" bin share
zstd $ZSTDFLAGS -q -k "$OUT/binary_tools_man-bundle.tar"
xz "$OUT/binary_tools_man-bundle.tar"

info "Compressing binary"
cp bpftrace "$OUT/"
xz -k "$OUT/bpftrace"
zstd $ZSTDFLAGS -q -k "$OUT/bpftrace"

echo "All assets created in $OUT"
[[ -d "$TMP" ]] && rm -rf "$TMP"

0 comments on commit 4c24ee9

Please sign in to comment.