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
31 changes: 20 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
tag_name:
description: 'Tag name for release'
required: false
default: 'v0.0.0-test'

jobs:
create-release:
Expand All @@ -20,33 +25,40 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
tag_name: ${{ inputs.tag_name || github.ref_name }}
release_name: Release ${{ inputs.tag_name || github.ref_name }}
draft: false
prerelease: false

build-and-release-images:
needs: create-release
permissions:
contents: write
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: amd64
runner: ubuntu-latest
- arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Build AMD64 image
- name: Build ${{ matrix.arch }} image
run: |
./image_builder/build-image.sh amd64
./image_builder/build-image.sh ${{ matrix.arch }}

- name: Upload AMD64 Release Asset
- name: Upload ${{ matrix.arch }} Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./image_builder/output/provisioner-custom.amd64.qcow2
asset_name: provisioner-custom.amd64.qcow2
asset_path: ./image_builder/output/provisioner-custom.${{ matrix.arch }}.qcow2
asset_name: provisioner-custom.${{ matrix.arch }}.qcow2
asset_content_type: application/octet-stream

build-initrds:
Expand All @@ -56,9 +68,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize all submodules
run: git submodule update --init --recursive

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand Down
55 changes: 4 additions & 51 deletions docs/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,57 +6,16 @@ When you push a tag matching `v*.*.*`, GitHub Actions will automatically:

1. Create a GitHub release
2. Build and upload the AMD64 provisioner image (`provisioner-custom.amd64.qcow2`)
3. Build initrd files for PXE boot
4. Build and push the PXE boot container to GitHub Container Registry

## Manual ARM64 Image Build

ARM64 provisioner images must be built and uploaded manually because GitHub's ARM64 runners require a paid account.

### Prerequisites

- ARM64 machine (e.g., Apple Silicon Mac)
- Docker installed
- GitHub CLI (`gh`) installed and authenticated

### Steps

1. **Checkout the release tag:**

```bash
git checkout v0.0.x # Replace with your version
```

2. **Build the ARM64 image:**

```bash
cd image_builder
./build-image.sh arm64
```

This will create `output/provisioner-custom.arm64.qcow2`

3. **Upload to the release:**

```bash
gh release upload v0.0.x ./output/provisioner-custom.arm64.qcow2 --clobber
```

The `--clobber` flag will replace the asset if it already exists.

4. **Verify the upload:**

```bash
gh release view v0.0.x
```
3. Build and upload the ARM64 provisioner image (`provisioner-custom.arm64.qcow2`)
4. Build initrd files for PXE boot
5. Build and push the PXE boot container to GitHub Container Registry

## Complete Release Checklist

- [ ] Tag pushed (triggers automated build)
- [ ] AMD64 image built and uploaded (automated)
- [ ] ARM64 image built and uploaded (automated)
- [ ] PXE boot container published (automated)
- [ ] ARM64 image built locally
- [ ] ARM64 image uploaded to release
- [ ] Verify both images are available in the release
- [ ] Test download and deployment of both architectures

Expand Down Expand Up @@ -126,12 +85,6 @@ git push origin v0.0.3

# Wait for GitHub Actions to complete the automated builds

# Build and upload ARM64 manually
git checkout v0.0.3
cd image_builder
./build-image.sh arm64
gh release upload v0.0.3 ./output/provisioner-custom.arm64.qcow2

# Verify
gh release view v0.0.3
```
1 change: 1 addition & 0 deletions image_builder/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ cp "${IMAGE_DIR}/${BASE_IMAGE_NAME}" "${IMAGE_DIR}/${CUSTOM_IMAGE_NAME}"
# --- Run Customization in Docker ---
echo "Running customization script in Docker..."
docker run --rm \
--platform "linux/${ARCH}" \
--privileged \
-v "${IMAGE_DIR}:/images" \
-v "${BUILD_DIR}/files:/files" \
Expand Down
2 changes: 1 addition & 1 deletion image_builder/customize-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi
echo "Updating container and installing dependencies..."
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y libguestfs-tools qemu-utils cloud-guest-utils curl
apt-get install -y libguestfs-tools qemu-utils qemu-system-arm cloud-guest-utils curl

# --- Customize the Image ---
echo "Starting image customization..."
Expand Down
Loading