-
Notifications
You must be signed in to change notification settings - Fork 114
78 lines (68 loc) · 2.39 KB
/
provenance4.yaml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Matrix Provenances
on:
push:
branches:
- "stage0verify"
workflow_dispatch:
inputs:
build-config-path:
required: true
type: string
jobs:
build_attest_all:
strategy:
fail-fast: false
matrix:
buildconfig:
- buildconfigs/key_xor_test_app.toml
- buildconfigs/oak_echo_raw_enclave_app.toml
permissions:
actions: read
id-token: write
attestations: write
contents: read
runs-on: ubuntu-20.04
steps:
- name: Mount main branch
uses: actions/checkout@v4
- name: Parse buildconfig
id: parse
run: |
set -o errexit
set -o nounset
set -o xtrace
set -o pipefail
source ./scripts/common
artifact_path="$(tail -1 ${{ matrix.buildconfig }} | grep -oP 'artifact_path = \K(.*)')"
package_name="$(basename ${{ matrix.buildconfig }} .toml)"
builder_digest="$(echo "${DOCKER_IMAGE_REPO_DIGEST}" | cut -d'@' -f2)"
echo "artifact-path=${artifact_path}" >> $GITHUB_OUTPUT
echo "package-name=${package_name}" >> $GITHUB_OUTPUT
echo "builder-digest=${builder_digest}" >> $GITHUB_OUTPUT
- name: Show values
run: |
echo "${{ steps.parse.outputs.artifact-path }}"
echo "${{ steps.parse.outputs.package-name }}"
echo "${{ steps.parse.outputs.builder-digest }}"
# Use slsa-github-generator for build only. We ignore the provenance it produces.
- name: Build
id: build
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
builder-image: europe-west2-docker.pkg.dev/oak-ci/oak-development/oak-development
builder-digest: ${{ steps.parse.outputs.builder-digest }}
config-path: ${{ matrix.buildconfig }}
compile-builder: true
- name: Show build artifact
run: |
echo "${{ steps.parse.outputs.artifact-path }}"
ls -la "${{ steps.parse.outputs.artifact-path }}"
- name: Attest
id: attest
uses: actions/[email protected]
with:
subject-path: ${{ steps.parse.outputs.artifact-path }}
- name: Show Bundle
run: |
echo "${{ steps.attest.outputs.bundle-path }}"
ls -la "${{ steps.attest.outputs.bundle-path }}"