mirror of https://github.com/sfeakes/AqualinkD.git
75 lines
2.6 KiB
YAML
75 lines
2.6 KiB
YAML
name: TEST AqualinkD build Workflow
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
tags:
|
|
- 'v*.*.*'
|
|
workflow_dispatch: # Allow manual run
|
|
|
|
jobs:
|
|
build_and_deploy:
|
|
# Use the standard runner, the container handles the x86-64 to cross-compile setup
|
|
runs-on: ubuntu-latest
|
|
|
|
# --- JOB-LEVEL CONTAINER DEFINITION ---
|
|
# This runs the entire job inside the Debian environment, making all 'run' steps clean.
|
|
container:
|
|
image: debian:bullseye
|
|
|
|
steps:
|
|
# 1. Checkout the source code (this runs INSIDE the container and populates /github/workspace)
|
|
- uses: actions/checkout@v4
|
|
|
|
# 2. Optimized Cross-Compile step
|
|
- name: Setup build environment for ARM64 and ARMHF
|
|
# Using a standard 'run' block as we are already inside the container
|
|
run: |
|
|
# Enable cross-architectures
|
|
dpkg --add-architecture armhf && dpkg --add-architecture arm64 && \
|
|
|
|
# Update and Install ALL dependencies (APT requires update after add-architecture)
|
|
apt-get update -y && \
|
|
apt-get install -y build-essential crossbuild-essential-armhf crossbuild-essential-arm64 libsystemd-dev libsystemd-dev:arm64 libsystemd-dev:armhf && \
|
|
|
|
- name: Compile AqualinkD
|
|
# Using a standard 'run' block as we are already inside the container
|
|
run: |
|
|
make clean && \
|
|
make buildrelease && \
|
|
ls -alR && \
|
|
pwd
|
|
|
|
# The remaining steps automatically run inside the container as well
|
|
|
|
- name: Create release archive
|
|
# This step correctly archives both resulting binaries from the workspace
|
|
run: tar -czvf aqualinkd-build.tar.gz web/ release/
|
|
|
|
# --- Step 1: Create/Update the Draft Development Release ---
|
|
- name: Create or Update GitHub Draft Release
|
|
if: |
|
|
${{
|
|
github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')
|
|
|| github.event_name == 'workflow_dispatch'
|
|
}}
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: aqualinkd-build.tar.gz
|
|
overwrite: true
|
|
tag_name: development-latest
|
|
name: Development Build (Latest Main/Manual)
|
|
draft: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
# --- Step 2: Create the Formal Versioned Release ---
|
|
- name: Create Final GitHub Release
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: aqualinkd-build.tar.gz
|
|
overwrite: true
|
|
tag_name: ${{ github.ref_name }}
|
|
name: AqualinkD Release ${{ github.ref_name }}
|
|
draft: false
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |