Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/release-go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: release go

on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
release_ref:
description: Git ref to validate before tagging.
required: true
default: refs/heads/main
type: string

permissions:
contents: write
id-token: write

jobs:
test:
name: "IntentProof Release: Test Go Module"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.release_ref || github.ref }}

- name: Checkout intentproof-tools (SPEC_REF source)
uses: actions/checkout@v6
with:
repository: IntentProof/intentproof-tools
ref: main
path: intentproof-tools

- name: Read pinned spec ref
id: spec_ref
run: |
ref="$(tr -d '[:space:]' < intentproof-tools/SPEC_REF)"
if ! echo "$ref" | grep -qE '^[0-9a-f]{40}$'; then
echo "Invalid SPEC_REF in intentproof-tools: '$ref'" >&2
exit 1
fi
echo "ref=$ref" >> "$GITHUB_OUTPUT"

- name: Checkout intentproof-spec at pinned ref
uses: actions/checkout@v6
with:
repository: IntentProof/intentproof-spec
ref: ${{ steps.spec_ref.outputs.ref }}
path: intentproof-spec

- uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: Verify sdk-signing fixtures match pinned spec
env:
INTENTPROOF_SPEC_DIR: intentproof-spec
run: bash scripts/check-sdk-signing-fixtures-sync.sh

- name: Run tests
env:
GOWORK: off
run: go test ./...

publish:
name: "IntentProof Release: Publish Go Module Tag"
needs: test
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Create GitHub Release for module tag
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
tag="${GITHUB_REF_NAME}"
if ! gh release view "$tag" >/dev/null 2>&1; then
gh release create "$tag" --generate-notes --title "$tag"
fi
Loading