-
Notifications
You must be signed in to change notification settings - Fork 10
99 lines (84 loc) · 3.29 KB
/
build-attested.yaml
File metadata and controls
99 lines (84 loc) · 3.29 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Build attested binaries on-demand without cutting a release tag.
# Produces tar.gz archives with SLSA Build Provenance v1 attestation
# as downloadable job artifacts.
## NOTE: THIS WORKFLOW IS FOR TESTING PURPOSES ONLY.
## if you need something attested by ci. This does not run tests or security scans.
## The only complete/valid way to attest that passes all validation is via on-tag.yaml.
## Validate attestations requires to pass the following certificate identity regexp:
## --certificate-identity-regexp 'https://github.com/NVIDIA/aicr/.github/workflows/on-tag\.yaml@refs/tags/.*'
## so this attestation is not the same as a production release.
name: Build Attested Binaries
on:
workflow_dispatch: {}
permissions:
contents: read
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-attest:
name: Build and Attest Binaries
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Checkout Code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Load versions
id: versions
uses: ./.github/actions/load-versions
- name: Setup Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: ${{ steps.versions.outputs.go }}
cache: true
- name: Install Cosign
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
with:
install-only: true
- name: Generate SLSA predicate
uses: ./.github/actions/generate-slsa-predicate
with:
workflow_file: build-attested.yaml
- name: Build and attest
env:
GOFLAGS: -mod=vendor
run: |
set -euo pipefail
goreleaser release --snapshot --clean --skip=publish,ko,sbom --timeout 20m
- name: Verify archive contents
run: |
set -euo pipefail
echo "=== Archives ==="
ls -la dist/aicr_v*.tar.gz 2>/dev/null || echo "No archives found"
echo ""
for archive in dist/aicr_v*.tar.gz; do
[ -f "$archive" ] || continue
echo "--- $(basename "$archive") ---"
tar -tzf "$archive"
echo ""
done
- name: Upload archives
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: aicr-attested-binaries
path: dist/*.tar.gz
retention-days: 3