feat(cli): add step-summary blocks for rendered prompt and verdict (#… #20
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-release-artifacts: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26' | |
| - name: Run tests | |
| run: go test -v -race ./... | |
| - name: Build release binaries | |
| run: | | |
| set -euo pipefail | |
| VERSION=${GITHUB_REF_NAME} | |
| mkdir -p dist | |
| while read -r goos goarch asset; do | |
| [[ -z "$goos" || "$goos" == \#* ]] && continue | |
| CGO_ENABLED=0 GOOS="$goos" GOARCH="$goarch" go build \ | |
| -ldflags="-s -w -X github.com/github/gh-aw-threat-detection/pkg/detector.Version=${VERSION}" \ | |
| -o "dist/${asset}" ./cmd/threat-detect | |
| done < release-targets.txt | |
| - name: Generate checksums | |
| run: | | |
| cd dist | |
| sha256sum threat-detect-* > checksums.txt | |
| - name: Upload release artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-artifacts | |
| path: dist/* | |
| retention-days: 7 | |
| publish-release: | |
| needs: build-release-artifacts | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: release-publish | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download release artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-artifacts | |
| path: dist | |
| - name: Create GitHub release (prerelease) | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| set -euo pipefail | |
| # Record every release-asset SHA-256 in the release body so the promote | |
| # workflow can verify and pin the exact binaries that were published. | |
| notes_file="$(mktemp)" | |
| mapfile -t assets < <(awk '!/^[[:space:]]*(#|$)/ { print $3 }' release-targets.txt) | |
| release_files=() | |
| for asset in "${assets[@]}"; do | |
| asset_sha256="$(sha256sum "dist/${asset}" | awk '{print $1}')" | |
| echo "Binary asset sha256 (${asset}): sha256:${asset_sha256}" >> "$notes_file" | |
| release_files+=("dist/${asset}#${asset}") | |
| done | |
| gh release create "${GITHUB_REF_NAME}" \ | |
| "${release_files[@]}" \ | |
| dist/checksums.txt#checksums.txt \ | |
| --title "${GITHUB_REF_NAME}" \ | |
| --notes-file "$notes_file" \ | |
| --generate-notes \ | |
| --prerelease |