From 03a90fffe6e9bde66cbe068f065c5f405f28eb96 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 22 May 2026 21:55:15 +0000 Subject: [PATCH] ci: add release workflow that builds binaries and publishes SHA256SUMS Pushing a tag matching v* (or running the workflow manually with an existing tag) cross-compiles the four supported targets via `make build-all`, generates a SHA256SUMS file, and publishes a GitHub release with all binaries attached. --- .github/workflows/release.yml | 61 +++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..328a63f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,61 @@ +name: Release + +on: + push: + tags: + - 'v*' + workflow_dispatch: + inputs: + tag: + description: 'Tag to release (e.g. v0.1.0). The tag must already exist.' + required: true + type: string + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Resolve ref + id: ref + run: | + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + echo "ref=${{ inputs.tag }}" >> "$GITHUB_OUTPUT" + echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT" + else + echo "ref=${{ github.ref }}" >> "$GITHUB_OUTPUT" + echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" + fi + + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ steps.ref.outputs.ref }} + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + check-latest: true + + - name: Build all targets + run: make build-all + + - name: Generate SHA256SUMS + working-directory: dist + run: | + sha256sum bootstrap_environment-* > SHA256SUMS + cat SHA256SUMS + + - name: Create release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ steps.ref.outputs.tag }} + name: ${{ steps.ref.outputs.tag }} + generate_release_notes: true + fail_on_unmatched_files: true + files: | + dist/bootstrap_environment-* + dist/SHA256SUMS