-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.71 KB
/
Copy pathrelease.yml
File metadata and controls
61 lines (52 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Release
on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [main]
permissions:
contents: write
id-token: write
attestations: write
jobs:
release:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
with:
go-version: '1.26.x'
- name: Determine version
uses: go-semantic-release/action@2e9dc4247a6004f8377781bef4cb9dad273a741f # v1
id: semrel
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
dry: true
- name: Generate SBOM
if: steps.semrel.outputs.version != ''
uses: anchore/sbom-action@e22c389904149dbc22b58101806040fa8d37a610 # v0
with:
format: spdx-json
output-file: sbom.spdx.json
- name: Attest SBOM provenance
if: steps.semrel.outputs.version != ''
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
with:
subject-path: sbom.spdx.json
- name: Create draft release
if: steps.semrel.outputs.version != ''
run: |
gh release create v${{ steps.semrel.outputs.version }} \
--draft \
--generate-notes \
sbom.spdx.json
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish release
if: steps.semrel.outputs.version != ''
run: gh release edit v${{ steps.semrel.outputs.version }} --draft=false
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}