Skip to content

Commit e83e248

Browse files
committed
fix: only attach milestone if release build
1 parent ae89113 commit e83e248

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.github/workflows/build-and-release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ jobs:
8282
sudo apt update
8383
sudo apt install -y mkosi
8484
85+
- name: Set dynamic mkosi vars
86+
if: startsWith(github.ref, 'refs/tags/v')
87+
run: |
88+
sed -i "/^\[Service\]/a\Environment=\"SET_MILESTONE=true\"" modules/beacon/mkosi.extra/usr/local/lib/systemd/system/beacon-report.service
89+
8590
- name: Build guest-${{ matrix.distro }}-${{ matrix.release }}
8691
run: |
8792
sudo mkosi --image-id=guest-${{ matrix.distro }}-${{ matrix.release }} -C images/guest-${{ matrix.distro }}-${{ matrix.release }}/ cat-config

modules/beacon/mkosi.extra/usr/local/lib/scripts/beacon-report.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set -euo pipefail
33

44
SEV_VERSIONS=("3.0-0")
55
SEV_CERT_FILE=""
6+
SET_MILESTONE="${SET_MILESTONE:-false}"
67

78
# Determine OS name and version
89
if [ -f /etc/os-release ]; then
@@ -29,11 +30,11 @@ for sev_version in "${SEV_VERSIONS[@]}"; do
2930
SEV_CERT_FILE="${HOME:-/root}/sev_certificate_v${sev_version}.txt"
3031

3132
# Call beacon
32-
if [ -e "${SEV_CERT_FILE}" ] && [ -z "$(grep "" "${SEV_CERT_FILE}")" ]; then
33-
# Add milestone if no errors encountered
34-
beacon report --title "$SEV_TITLE" --body "$SEV_CERT_FILE" --label "certificate" --label "${OS_LABEL}" --milestone "v${sev_version}"
33+
if [ -e "${SEV_CERT_FILE}" ] && [ -z "$(grep "" "${SEV_CERT_FILE}")" ] && [ "${SET_MILESTONE}" == "true" ]; then
34+
# Add milestone if no errors encountered and if this is a release build.
35+
beacon report --title "$SEV_TITLE" --body "$SEV_CERT_FILE" --label "certificate" --label "os-${OS_LABEL}" --milestone "v${sev_version}"
3536
else
36-
beacon report --title "$SEV_TITLE" --body "$SEV_CERT_FILE" --label "certificate" --label "${OS_LABEL}"
37+
beacon report --title "$SEV_TITLE" --body "$SEV_CERT_FILE" --label "certificate" --label "os-${OS_LABEL}"
3738
fi
3839

3940
echo "Published SEV certificate via beacon with title: $SEV_TITLE"

0 commit comments

Comments
 (0)