Skip to content

Release Stage 2 - Scheduled - Build and Push - stable - 19986947931 - stable:19986925682 #121

Release Stage 2 - Scheduled - Build and Push - stable - 19986947931 - stable:19986925682

Release Stage 2 - Scheduled - Build and Push - stable - 19986947931 - stable:19986925682 #121

name: Release Stage 2 - Build and Push Homebridge VM Images
run-name: Release Stage 2 - ${{ github.event.inputs.Scheduled}} - Build and Push - ${{ inputs.release_stream }} - ${{ github.run_id }} - ${{ inputs.run_name }}
on:
workflow_dispatch:
inputs:
release_stream:
description: 'Choose release type: "stable" (builds latest version), "beta" (builds beta version with beta-YYYY-MM-DD tag), or "alpha" (builds alpha version with alpha-YYYY-MM-DD tag).'
required: true
type: choice
options:
- stable
- beta
- alpha
default: beta
Scheduled:
description: 'Whether this is a scheduled run'
required: false
type: choice
options:
- Scheduled
- Manual
default: Manual
run_name:
description: 'Unique name of the run'
required: false
type: string
default: ''
concurrency:
group: stage-2-build-and-push
cancel-in-progress: false
jobs:
set-versions:
runs-on: ubuntu-latest
outputs:
HOMEBRIDGE_VM_IMAGE_VERSION: ${{ steps.docker_version.outputs.HOMEBRIDGE_VM_IMAGE_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set Docker Homebridge version
id: docker_version
run: |
if [[ "${{ inputs.release_stream }}" == "stable" ]]; then
export HOMEBRIDGE_VM_IMAGE_VERSION="$(date +%Y-%m-%d)"
else
export HOMEBRIDGE_VM_IMAGE_VERSION="${{ inputs.release_stream }}-$(date +%Y-%m-%d)"
fi
echo "HOMEBRIDGE_VM_IMAGE_VERSION=${HOMEBRIDGE_VM_IMAGE_VERSION}" >> $GITHUB_OUTPUT
- name: Output versions
run: |
echo "::group::Version Information"
echo "HOMEBRIDGE_VM_IMAGE_VERSION=${{ steps.docker_version.outputs.HOMEBRIDGE_VM_IMAGE_VERSION }}"
echo "::endgroup::"
build-img-file:
needs: set-versions
strategy:
max-parallel: 1
fail-fast: false
matrix:
arch: [arm64, amd64]
include:
- arch: arm64
runs-on: ubuntu-24.04-arm
- arch: amd64
runs-on: ubuntu-latest
runs-on: ${{ matrix.runs-on }}
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v6
# Setup build environemnt
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y debootstrap parted e2fsprogs dosfstools dialog qemu-user-static gzip sudo udev kpartx psmisc jq zerofree
sudo apt-get install -y grub-efi-${{ matrix.arch }}-bin
# Step 2: Start the build process
- name: run build-debian-image.sh script
run: |
./build-debian-image.sh "${{ matrix.arch}}" "${{ inputs.release_stream }}" "${{ needs.set-versions.outputs.HOMEBRIDGE_VM_IMAGE_VERSION }}"
# Step 3: Upload the IMG file as an artifact
- name: Upload Homebridge Image
uses: actions/upload-artifact@v5
with:
retention-days: 7
name: homebridge-image-${{ matrix.arch }}
path: output/*
- name: Steps complete
run: |
echo "::notice::Homebridge VM image version: ${{ needs.set-versions.outputs.HOMEBRIDGE_VM_IMAGE_VERSION }}"
echo "::notice::Run ID: ${{ github.run_id }}"
echo "::notice::Architecture: ${{ matrix.arch }}"
echo "::notice::Release Stream: ${{ inputs.release_stream }}"
invoke-package-and-release:
name: Invoke Stage 3 - Package and Release
needs: [set-versions, build-img-file]
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v6
- name: Trigger and Wait for ${{ inputs.release_stream }} Stage 3 Workflow
uses: ./.github/actions/trigger-and-wait-workflow
with:
workflow-file: 'release-stage-3_package_release.yml'
ref: 'latest'
github-token: ${{ secrets.GH_TOKEN }}
timeout-minutes: '120'
workflow-fields: |
release_stream=${{ inputs.release_stream }}
run_id="${{ github.run_id }}"
HOMEBRIDGE_VM_IMAGE_VERSION="${{ needs.set-versions.outputs.HOMEBRIDGE_VM_IMAGE_VERSION }}"
run-name: "${{ inputs.release_stream }}:${{ github.run_id }}"