Skip to content

Commit 4f17ec3

Browse files
committed
chore(ci): add chainloop
1 parent 22dbc7c commit 4f17ec3

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/release.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,20 @@ jobs:
1717
- name: Install Cosign
1818
uses: sigstore/[email protected]
1919

20+
- name: Install Chainloop
21+
run: |
22+
curl -sfL https://chainloop.dev/install.sh | bash -s -- --version v${{ env.CHAINLOOP_VERSION }}
23+
sudo install chainloop /usr/local/bin
24+
chainloop version
25+
2026
- name: Checkout
2127
uses: actions/checkout@v3
2228
with:
2329
fetch-depth: 0
2430

31+
- name: Initialize Attestation
32+
run: chainloop attestation init --contract-revision 1
33+
2534
- name: Set up Go
2635
uses: actions/setup-go@v3
2736
with:
@@ -54,3 +63,25 @@ jobs:
5463
output-file: /tmp/sbom.cyclonedx.json
5564
env:
5665
IMAGE: ghcr.io/migmartri/simple-todo:${{ github.ref_name }}
66+
67+
- name: Finish and Record Attestation
68+
if: ${{ success() }}
69+
run: |
70+
chainloop attestation status --full
71+
chainloop attestation push --key env://CHAINLOOP_SIGNING_KEY
72+
env:
73+
CHAINLOOP_SIGNING_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
74+
CHAINLOOP_SIGNING_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
75+
76+
- name: Mark attestation as failed
77+
if: ${{ failure() }}
78+
run: |
79+
chainloop attestation reset
80+
81+
- name: Mark attestation as cancelled
82+
if: ${{ cancelled() }}
83+
run: |
84+
chainloop attestation reset --trigger cancellation
85+
env:
86+
CHAINLOOP_VERSION: 0.8.58
87+
CHAINLOOP_ROBOT_ACCOUNT: ${{ secrets.CHAINLOOP_ROBOT_ACCOUNT }}

0 commit comments

Comments
 (0)