diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d09a99b..730be20 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: @@ -20,8 +25,8 @@ 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 @@ -29,24 +34,31 @@ jobs: 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: @@ -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 diff --git a/docs/release-process.md b/docs/release-process.md index ec8af99..fb12e12 100644 --- a/docs/release-process.md +++ b/docs/release-process.md @@ -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 @@ -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 ``` diff --git a/image_builder/build-image.sh b/image_builder/build-image.sh index eaf9fca..e358a43 100755 --- a/image_builder/build-image.sh +++ b/image_builder/build-image.sh @@ -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" \ diff --git a/image_builder/customize-image.sh b/image_builder/customize-image.sh index 5ef736c..865151c 100755 --- a/image_builder/customize-image.sh +++ b/image_builder/customize-image.sh @@ -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..."