mirror of
https://github.com/recklessop/zroc.git
synced 2026-07-02 21:13:15 -04:00
450f50ddf4
- Replace ubuntu-26.04 (unreleased) with ubuntu-24.04 LTS throughout - Add file provisioner to Packer HCL to copy overlays/ into VM before provisioning (fixes missing zroc-setup binary in 03-setup-wizard.sh) - Rebuild root docker-compose.yaml: full stack with env vars — Caddy, zroc-ui, Authentik (server + worker + postgres + redis), Prometheus, Grafana, Zerto exporter, Watchtower; no hardcoded credentials - Add caddy/Caddyfile to repo root for reverse proxy / TLS - Update 02-zroc.sh to pre-pull all service images during OVA build - Update GitHub Actions workflow to reference ubuntu-2404.pkr.hcl Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
99 lines
3.0 KiB
YAML
99 lines
3.0 KiB
YAML
name: Build & Release OVA
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Version string (e.g. 1.0.0)'
|
|
required: true
|
|
default: '1.0.0'
|
|
|
|
jobs:
|
|
build-ova:
|
|
name: Build OVA
|
|
runs-on: [self-hosted, linux, kvm]
|
|
timeout-minutes: 120
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Resolve version
|
|
id: ver
|
|
run: |
|
|
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
|
VERSION="${{ github.event.inputs.version }}"
|
|
else
|
|
VERSION="${GITHUB_REF_NAME#v}"
|
|
fi
|
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
|
|
echo "ova_name=zroc-appliance-${VERSION}-ubuntu-24.04-amd64.ova" >> $GITHUB_OUTPUT
|
|
|
|
- name: Install Packer
|
|
run: |
|
|
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp.gpg
|
|
echo "deb [signed-by=/usr/share/keyrings/hashicorp.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" \
|
|
| sudo tee /etc/apt/sources.list.d/hashicorp.list
|
|
sudo apt-get update -y && sudo apt-get install -y packer
|
|
|
|
- name: Packer init
|
|
working-directory: packer
|
|
run: packer init ubuntu-2404.pkr.hcl
|
|
|
|
- name: Validate
|
|
working-directory: packer
|
|
run: |
|
|
packer validate \
|
|
-var "vm_version=${{ steps.ver.outputs.version }}" \
|
|
-var-file=variables.pkrvars.hcl \
|
|
ubuntu-2404.pkr.hcl
|
|
|
|
- name: Build OVA
|
|
working-directory: packer
|
|
env:
|
|
PACKER_LOG: 1
|
|
PACKER_LOG_PATH: packer-build.log
|
|
run: |
|
|
packer build \
|
|
-var "vm_version=${{ steps.ver.outputs.version }}" \
|
|
-var "headless=true" \
|
|
-var-file=variables.pkrvars.hcl \
|
|
ubuntu-2404.pkr.hcl
|
|
|
|
- name: Locate OVA
|
|
id: ova
|
|
run: |
|
|
OVA_PATH=$(find output -name "*.ova" | head -1)
|
|
echo "path=$OVA_PATH" >> $GITHUB_OUTPUT
|
|
ls -lh "$OVA_PATH"
|
|
|
|
- name: Checksum
|
|
run: |
|
|
sha256sum "${{ steps.ova.outputs.path }}" \
|
|
> "${{ steps.ova.outputs.path }}.sha256"
|
|
cat "${{ steps.ova.outputs.path }}.sha256"
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ steps.ver.outputs.tag }}
|
|
name: "zROC Appliance ${{ steps.ver.outputs.tag }}"
|
|
draft: false
|
|
prerelease: false
|
|
files: |
|
|
${{ steps.ova.outputs.path }}
|
|
${{ steps.ova.outputs.path }}.sha256
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
|
|
- name: Upload build log (on failure)
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: packer-build-log
|
|
path: packer/packer-build.log
|