Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,22 @@ jobs:
sudo apt update
sudo apt install -y mkosi

- name: Fetch latest release tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail

# Fetch latest tags using gh CLI (automatically authenticated)
SNPGUEST_TAG=$(gh release view --repo virtee/snpguest --json tagName --jq '.tagName')
BEACON_TAG=$(gh release view --repo AMDEPYC/beacon --json tagName --jq '.tagName')
SNPHOST_TAG=$(gh release view --repo virtee/snphost --json tagName --jq '.tagName')

# Inject environment variables into mkosi.conf files
sed -i "/^\[Build\]/a\Environment=SNPGUEST_TAG=$SNPGUEST_TAG" modules/snpguest-build/mkosi.conf
sed -i "/^\[Build\]/a\Environment=BEACON_TAG=$BEACON_TAG" modules/beacon/mkosi.conf
sed -i "/^\[Build\]/a\Environment=SNPHOST_TAG=$SNPHOST_TAG" modules/snphost/mkosi.conf

- name: Build guest-${{ matrix.distro }}-${{ matrix.release }}
run: |
sudo mkosi --image-id=guest-${{ matrix.distro }}-${{ matrix.release }} -C images/guest-${{ matrix.distro }}-${{ matrix.release }}/ cat-config
Expand Down Expand Up @@ -156,4 +172,3 @@ jobs:
"https://uploads.github.com/repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID/assets?name=$ASSET_NAME"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

5 changes: 2 additions & 3 deletions modules/beacon/mkosi.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
set -euo pipefail
set -x

# Fetch latest release tag from GitHub API using jq
LATEST_TAG=$(curl -s https://api.github.com/repos/AMDEPYC/beacon/releases/latest \
| jq -r '.tag_name')
# Use BEACON_TAG if set, otherwise fetch from GitHub API
LATEST_TAG="${BEACON_TAG:-$(curl -s https://api.github.com/repos/AMDEPYC/beacon/releases/latest | jq -r '.tag_name')}"

# Download and install into DESTDIR with correct permissions
curl -fsSL "https://github.com/AMDEPYC/beacon/releases/download/${LATEST_TAG}/beacon-linux-x86_64" \
Expand Down
5 changes: 2 additions & 3 deletions modules/snpguest-build/mkosi.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
set -euo pipefail
set -x

# Fetch latest release tag from GitHub API
LATEST_TAG=$(curl -s https://api.github.com/repos/virtee/snpguest/releases/latest \
| jq -r '.tag_name')
# Use SNPGUEST_TAG if set, otherwise fetch from GitHub API
LATEST_TAG="${SNPGUEST_TAG:-$(curl -s https://api.github.com/repos/virtee/snpguest/releases/latest | jq -r '.tag_name')}"

# Download and install into DESTDIR with correct permissions
curl -fsSL "https://github.com/virtee/snpguest/releases/download/${LATEST_TAG}/snpguest" \
Expand Down
5 changes: 2 additions & 3 deletions modules/snphost/mkosi.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
set -euo pipefail
set -x

# Fetch latest release tag from GitHub API
LATEST_TAG=$(curl -s https://api.github.com/repos/virtee/snphost/releases/latest \
| jq -r '.tag_name')
# Use SNPHOST_TAG if set, otherwise fetch from GitHub API
LATEST_TAG="${SNPHOST_TAG:-$(curl -s https://api.github.com/repos/virtee/snphost/releases/latest | jq -r '.tag_name')}"

# Download and install into DESTDIR with correct permissions
curl -fsSL "https://github.com/virtee/snphost/releases/download/${LATEST_TAG}/snphost" \
Expand Down