Skip to content

Commit 83ff185

Browse files
authored
feat(ci): Add source code tarball (#772)
Signed-off-by: Javier Rodriguez <[email protected]>
1 parent b6df885 commit 83ff185

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.github/workflows/contracts/chainloop-vault-release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ materials:
4242
- type: ARTIFACT
4343
name: cli-darwin-amd64
4444
output: true
45+
- type: ARTIFACT
46+
name: source-code
47+
output: true

.github/workflows/release.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
CHAINLOOP_ROBOT_ACCOUNT: ${{ secrets.CHAINLOOP_ROBOT_ACCOUNT }}
2828
CONTAINER_IMAGE_CP: ghcr.io/chainloop-dev/chainloop/control-plane:${{ github.ref_name }}
2929
CONTAINER_IMAGE_CAS: ghcr.io/chainloop-dev/chainloop/artifact-cas:${{ github.ref_name }}
30+
GH_TOKEN: ${{ github.token }}
3031
steps:
3132
- name: Install Cosign
3233
uses: sigstore/cosign-installer@ef6a6b364bbad08abd36a5f8af60b595d12702f8 # main
@@ -112,6 +113,16 @@ jobs:
112113
chainloop attestation add --name ${BINARY_NAME} --value ${BINARY_PATH} || true
113114
done
114115
116+
- name: Add Attestation Artifacts (source code)
117+
run: |
118+
# When the trigger of the action is a release, github.ref contains refs/tags/<tag_name>
119+
# Reference: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
120+
121+
tag=$(echo -n ${{github.ref}} | cut -d / -f3)
122+
version=$(echo -n $tag | sed 's/v//g')
123+
gh release download $tag -A tar.gz -D /tmp
124+
chainloop attestation add --name source-code --value "/tmp/chainloop-$version.tar.gz"
125+
115126
- name: Finish and Record Attestation
116127
if: ${{ success() }}
117128
run: |

0 commit comments

Comments
 (0)