Skip to content

Commit

Permalink
ci: Build and upload release artifacts on release
Browse files Browse the repository at this point in the history
This frees maintainers from having to manually build + upload artfacts.
It also pins the tools used to build man pages and whatnot to the
versions defined in `flake.nix`. This helps with reproducibility.

This closes bpftrace#2609.
  • Loading branch information
danobi committed Nov 17, 2023
1 parent 65b6bfd commit ab3e49b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This job listens for new releases and will build the appropriate artifacts
# and upload them to the release.

name: Release

on:
release:
types: [published]

permissions:
contents: write

jobs:
build-upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@v4
- uses: DeterminateSystems/magic-nix-cache-action@v2

- name: Build artifacts
run: nix develop --command bash -c "OUT=./assets ./scripts/create-assets.sh"

- name: Upload artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.ref_name }} ./assets/*
7 changes: 5 additions & 2 deletions docs/release_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,8 @@ 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. Run `scripts/create-assets.sh` from bpftrace root dir and attach the
generated archives to the release.
1. Check that automation picks up the new release and uploads release assets
to the release.
1. If automation fails, please fix the automation for next time and also manually
build+upload artifacts by running `scripts/create-assets.sh` from bpftrace root
dir and attach the generated archives to the release.

0 comments on commit ab3e49b

Please sign in to comment.