|
| 1 | +name: release signing dry run |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + release_version: |
| 7 | + description: SemVer version to place in dry-run attestations. |
| 8 | + required: true |
| 9 | + default: 0.0.0-dryrun |
| 10 | + type: string |
| 11 | + release_ref: |
| 12 | + description: Git ref to check out for the dry run. |
| 13 | + required: true |
| 14 | + default: refs/heads/main |
| 15 | + type: string |
| 16 | + |
| 17 | +jobs: |
| 18 | + build-go-module: |
| 19 | + name: "IntentProof Release: Build Go Module Archive" |
| 20 | + permissions: |
| 21 | + contents: read |
| 22 | + runs-on: ubuntu-latest |
| 23 | + outputs: |
| 24 | + artifact_paths: ${{ steps.archive.outputs.artifact_paths }} |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 |
| 27 | + with: |
| 28 | + ref: ${{ inputs.release_ref }} |
| 29 | + |
| 30 | + - uses: actions/setup-go@40b3466c64957d331b6193b26c7cd62c6e411fd6 |
| 31 | + with: |
| 32 | + go-version: '1.25' |
| 33 | + |
| 34 | + - name: Verify module metadata |
| 35 | + run: go mod verify |
| 36 | + |
| 37 | + - name: Run tests |
| 38 | + run: | |
| 39 | + if [ -z "$(find . -name '*.go' -not -path './.git/*')" ]; then |
| 40 | + echo "No Go source files found (project scaffold only)" |
| 41 | + exit 0 |
| 42 | + fi |
| 43 | + go test ./... |
| 44 | +
|
| 45 | + - name: Package module source archive |
| 46 | + run: | |
| 47 | + mkdir -p dist |
| 48 | + tar czf "dist/intentproof-sdk-go-${{ inputs.release_version }}.tar.gz" \ |
| 49 | + go.mod LICENSE NOTICE README.md CONTRIBUTING.md SECURITY.md |
| 50 | +
|
| 51 | + - name: Export archive paths |
| 52 | + id: archive |
| 53 | + run: | |
| 54 | + { |
| 55 | + echo 'artifact_paths<<EOF' |
| 56 | + find dist -maxdepth 1 -type f | sort |
| 57 | + echo 'EOF' |
| 58 | + } >> "$GITHUB_OUTPUT" |
| 59 | +
|
| 60 | + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 |
| 61 | + with: |
| 62 | + name: go-release-dry-run |
| 63 | + path: dist/* |
| 64 | + |
| 65 | + sign-go-module: |
| 66 | + name: "IntentProof Release: Sign Go Module Archive" |
| 67 | + needs: build-go-module |
| 68 | + permissions: |
| 69 | + attestations: write |
| 70 | + contents: write |
| 71 | + id-token: write |
| 72 | + packages: write |
| 73 | + uses: IntentProof/intentproof-tools/.github/workflows/release-build-sign.yml@317387a9724787e4ac484f39de46d7e559b6c98d |
| 74 | + with: |
| 75 | + artifact_kind: generic |
| 76 | + subject_name: intentproof-sdk-go |
| 77 | + release_version: ${{ inputs.release_version }} |
| 78 | + release_ref: ${{ inputs.release_ref }} |
| 79 | + artifact_paths: ${{ needs.build-go-module.outputs.artifact_paths }} |
| 80 | + artifact_download_name: go-release-dry-run |
| 81 | + artifact_download_path: dist |
| 82 | + attest_to_rekor: false |
0 commit comments