From 638ee8d58d587ff8e3245c10cd6aa15387cd2242 Mon Sep 17 00:00:00 2001 From: DTTerastar Date: Mon, 18 May 2026 18:22:18 -0400 Subject: [PATCH] ci: add release workflow to build and upload binaries on tag push The release process documented in BUILD.md was fully manual: tag, push, run `make build-all` locally, zip each binary, and upload via the web UI. This step was skipped for v2.0.3, leaving the release with no artifacts. Automate the same steps so every `v*` tag publishes the six platform archives (linux amd64/arm64, darwin amd64/arm64/universal, windows amd64) plus a SHA256SUMS.txt. Uses a macOS runner because `lipo` is required for the darwin-universal binary; Go cross-compiles the other targets. Archive names and internal binary names match the v2.0.2 release exactly so existing install scripts and download URLs keep working. --- .github/workflows/release.yml | 70 +++++++++++++++++++++++++++++++++++ 1 file changed, 70 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..b6a48a2 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,70 @@ +name: Release + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +jobs: + release: + name: Build and publish release artifacts + # macOS runner is required for `lipo` (darwin-universal binary). + # Go cross-compiles the other platforms from here without issue. + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + + - name: Build all platform binaries + run: make build-all + + - name: Package release archives + run: | + set -euo pipefail + cd dist + for bin in \ + splunk-cli-linux-amd64 \ + splunk-cli-linux-arm64 \ + splunk-cli-darwin-amd64 \ + splunk-cli-darwin-arm64 \ + splunk-cli-darwin-universal \ + splunk-cli-windows-amd64.exe + do + if [ ! -f "$bin" ]; then + echo "Missing expected build artifact: $bin" >&2 + exit 1 + fi + case "$bin" in + *.exe) zip_name="${bin%.exe}.zip" ;; + *) zip_name="${bin}.zip" ;; + esac + zip -q "$zip_name" "$bin" + echo "Packaged $zip_name" + done + shasum -a 256 *.zip > SHA256SUMS.txt + ls -la + + - name: Publish GitHub Release + uses: softprops/action-gh-release@v2 + with: + files: | + dist/splunk-cli-linux-amd64.zip + dist/splunk-cli-linux-arm64.zip + dist/splunk-cli-darwin-amd64.zip + dist/splunk-cli-darwin-arm64.zip + dist/splunk-cli-darwin-universal.zip + dist/splunk-cli-windows-amd64.zip + dist/SHA256SUMS.txt + fail_on_unmatched_files: true + draft: false + prerelease: false