mirror of https://github.com/sfeakes/AqualinkD.git
Updates
parent
696b38ab67
commit
37788b59fe
|
|
@ -1,117 +0,0 @@
|
|||
name: AqualinkD build Workflow (Manual)
|
||||
on:
|
||||
# The push triggers are currently commented out to focus on manual runs
|
||||
#push:
|
||||
# branches: [ main ]
|
||||
# tags:
|
||||
# - 'v*.*.*'
|
||||
workflow_dispatch: # Allow manual run
|
||||
inputs:
|
||||
simulate_tag_release:
|
||||
description: 'Simulate a formal tag release (e.g., v2.11) to create a final, published release.'
|
||||
type: boolean
|
||||
required: true
|
||||
default: false
|
||||
tag_name_to_use:
|
||||
description: 'If simulating a tag release, provide the tag name (e.g., v2.11). Required if simulating.'
|
||||
type: string
|
||||
required: false
|
||||
|
||||
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
|
||||
with:
|
||||
# FINAL ATTEMPT AT RELIABLE SHORT-CIRCUITING:
|
||||
# Only prioritize the tag input if the simulation flag is true.
|
||||
# This is the cleanest and most common working pattern for this override.
|
||||
ref: ${{ (fromJSON(github.event.inputs.simulate_tag_release) && github.event.inputs.tag_name_to_use) || github.ref }}
|
||||
|
||||
# --- NEW STEP: Display Checked-Out Version/Tag ---
|
||||
- name: Display Checked-Out Version
|
||||
run: |
|
||||
echo "--- Workflow Context ---"
|
||||
# github.ref_name is the branch name or tag name (e.g., 'main' or 'v2.11')
|
||||
echo "Checked out Reference Name (Branch/Tag): ${{ github.ref_name }}"
|
||||
# github.ref is the full Git reference (e.g., 'refs/heads/main' or 'refs/tags/v2.11')
|
||||
echo "Full GitHub Reference: ${{ github.ref }}"
|
||||
echo "--- Starting Build ---"
|
||||
|
||||
# 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
|
||||
|
||||
# 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 ---
|
||||
# Condition Logic: Run if it's a 'push' on 'main' AND NOT a tag, OR if it's a manual run AND NOT simulating a tag.
|
||||
- name: Create or Update GitHub Draft Release
|
||||
if: |
|
||||
${{
|
||||
(github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/'))
|
||||
|| (github.event_name == 'workflow_dispatch' && !fromJSON(github.event.inputs.simulate_tag_release))
|
||||
}}
|
||||
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 ---
|
||||
# Condition Logic: Run if it's a tag push, OR if it's a manual run AND IS simulating a tag
|
||||
# AND the required tag name input is NOT empty.
|
||||
- name: Create Final GitHub Release
|
||||
if: |
|
||||
${{
|
||||
startsWith(github.ref, 'refs/tags/')
|
||||
|| (github.event_name == 'workflow_dispatch'
|
||||
&& fromJSON(github.event.inputs.simulate_tag_release)
|
||||
&& github.event.inputs.tag_name_to_use != ''
|
||||
)
|
||||
}}
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: aqualinkd-build.tar.gz
|
||||
overwrite: true
|
||||
# This will now safely use the provided input or the actual tag name
|
||||
tag_name: ${{ github.event.inputs.tag_name_to_use || github.ref_name }}
|
||||
name: AqualinkD Release ${{ github.event.inputs.tag_name_to_use || github.ref_name }}
|
||||
draft: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
name: AqualinkD build Workflow
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
# push:
|
||||
# branches: [ main ]
|
||||
# tags:
|
||||
# - 'v*.*.*'
|
||||
workflow_dispatch: # Allow manual run
|
||||
|
||||
jobs:
|
||||
|
|
@ -14,7 +14,8 @@ jobs:
|
|||
# --- JOB-LEVEL CONTAINER DEFINITION ---
|
||||
# This runs the entire job inside the Debian environment, making all 'run' steps clean.
|
||||
container:
|
||||
image: debian:bullseye
|
||||
#image: debian:bullseye
|
||||
image: debian:buster
|
||||
|
||||
steps:
|
||||
# Checkout the source code (this runs INSIDE the container and populates /github/workspace)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
name: AqualinkD create release .tar.gz
|
||||
on:
|
||||
# push:
|
||||
# branches: [ main ]
|
||||
# tags:
|
||||
# - 'v*.*.*'
|
||||
workflow_dispatch: # Allow manual run
|
||||
inputs: # ADDED INPUTS to request the specific tag
|
||||
tag_name:
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ if [ "$_ignoreglibc" -eq $FALSE ]; then
|
|||
if [[ ! "$CURRENT_GLIBC_VERSION_STRING" =~ ^[0-9]+\.[0-9]+$ ]]; then
|
||||
# Print the combined, simple error message as requested
|
||||
log "Error: Cannot find or parse GLIBC version from system utilities."
|
||||
exit 1
|
||||
#exit 1
|
||||
fi
|
||||
|
||||
IFS='.' read -r CURRENT_GLIBC_MAJOR CURRENT_GLIBC_MINOR <<< "$CURRENT_GLIBC_VERSION_STRING"
|
||||
|
|
@ -195,9 +195,11 @@ if [ "$_ignoreglibc" -eq $FALSE ]; then
|
|||
([ "$CURRENT_GLIBC_MAJOR" -eq "$REQUIRED_GLIBC_MAJOR" ] && [ "$CURRENT_GLIBC_MINOR" -lt "$REQUIRED_GLIBC_MINOR" ]); then
|
||||
|
||||
# Version is too old (FAILURE)
|
||||
echo "Error: GLIBC version is too old."
|
||||
echo "Required: ${REQUIRED_GLIBC_VERSION} or newer."
|
||||
exit 1
|
||||
#echo "Error: GLIBC version is too old."
|
||||
#echo "Required: ${REQUIRED_GLIBC_VERSION} or newer."
|
||||
#exit 1
|
||||
log "Warning: GLIBC version $CURRENT_GLIBC_VERSION_STRING is old and will not be supported in future releases, please upgrade your OS"
|
||||
log "Minimum GLIBC version $REQUIRED_GLIBC_VERSION / Debian Bullseye or newer will be required"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
# To get good / bad exit code from both curl and bash, use below. It will exit current term so be careful.
|
||||
# curl -fsSL "https://raw.githubusercontent.com/aqualinkd/AqualinkD/master/release/remote_install.sh" | ( sudo bash && exit 0 ) || exit $?
|
||||
|
||||
REQUIRED_SPACE_MB=18 # Need 17MB, use 18
|
||||
REQUIRED_SPACE_MB=18 # Need 17MB, use 18 ( will get reset to 2MB if using new install)
|
||||
|
||||
TRUE=0
|
||||
FALSE=1
|
||||
|
|
@ -27,10 +27,20 @@ INSTALLED_VERSION=""
|
|||
|
||||
TEMP_INSTALL="/tmp/aqualinkd"
|
||||
OUTPUT="/tmp/aqualinkd_upgrade.log"
|
||||
UNTAR_CMD="tar xz --strip-components=1 --directory=$TEMP_INSTALL"
|
||||
|
||||
FROM_CURL=$FASE
|
||||
SYSTEMD_LOG=$FALSE
|
||||
|
||||
USE_RELEASE_PKG=$TRUE
|
||||
|
||||
|
||||
if [ "$USE_RELEASE_PKG" -eq $TRUE ]; then
|
||||
REQUIRED_SPACE_MB=2
|
||||
UNTAR_CMD="tar xz --directory=$TEMP_INSTALL"
|
||||
fi
|
||||
|
||||
|
||||
# Remember not to use (check for terminal, as it may not exist when pipe to bash)
|
||||
# ie. if [ -t 0 ]; then
|
||||
|
||||
|
|
@ -188,10 +198,15 @@ function check_can_upgrade {
|
|||
return "$TRUE"
|
||||
}
|
||||
|
||||
|
||||
function download_latest_release {
|
||||
mkdir -p "$TEMP_INSTALL"
|
||||
tar_url=$(curl -fsSL "$REPO/releases/latest" | grep -Po '"tarball_url": "\K.*?(?=")')
|
||||
|
||||
if [ "$USE_RELEASE_PKG" -eq $TRUE ]; then
|
||||
tar_url=$(curl -fsSL "$REPO/releases/latest" | grep -Po '"browser_download_url": "\K.*?(?=")' | grep aqualinkd-release.tar.gz)
|
||||
else
|
||||
tar_url=$(curl -fsSL "$REPO/releases/latest" | grep -Po '"tarball_url": "\K.*?(?=")')
|
||||
fi
|
||||
|
||||
if [[ "$tar_url" == "" ]]; then return "$FALSE"; fi
|
||||
|
||||
curl -fsSL "$tar_url" | tar xz --strip-components=1 --directory="$TEMP_INSTALL"
|
||||
|
|
@ -210,27 +225,34 @@ function download_latest_development {
|
|||
}
|
||||
|
||||
function download_version {
|
||||
tar_url=$(curl -fsSL "$REPO/releases" | awk 'match($0,/.*"tarball_url": "(.*\/tarball\/.*)".*/)' | grep $1\" | awk -F '"' '{print $4}')
|
||||
if [ "$USE_RELEASE_PKG" -eq $TRUE ]; then
|
||||
tar_url=$(curl -fsSL "$REPO/releases" | awk 'match($0,/.*"browser_download_url": "(.*\/aqualinkd-release\.tar\.gz)".*/)' | grep $1 | awk -F '"' '{print $4}' )
|
||||
else
|
||||
tar_url=$(curl -fsSL "$REPO/releases" | awk 'match($0,/.*"tarball_url": "(.*\/tarball\/.*)".*/)' | grep $1\" | awk -F '"' '{print $4}')
|
||||
fi
|
||||
|
||||
if [[ ! -n "$tar_url" ]]; then
|
||||
return $"$FALSE"
|
||||
fi
|
||||
|
||||
mkdir -p "$TEMP_INSTALL"
|
||||
curl -fsSL "$tar_url" | tar xz --strip-components=1 --directory="$TEMP_INSTALL"
|
||||
|
||||
#curl -fsSL "$tar_url" | tar xz --strip-components=1 --directory="$TEMP_INSTALL"
|
||||
curl -fsSL "$tar_url" | $UNTAR_CMD
|
||||
|
||||
if [ $? -ne 0 ]; then return "$FALSE"; fi
|
||||
|
||||
return "$TRUE";
|
||||
}
|
||||
|
||||
function get_all_versions {
|
||||
curl -fsSL "$REPO/releases" | awk 'match($0,/.*"tarball_url": "(.*\/tarball\/.*)".*/)' | awk -F '/' '{split($NF,a,"\""); print a[1]}'
|
||||
if [ "$USE_RELEASE_PKG" -eq $TRUE ]; then
|
||||
curl -fsSL "$REPO/releases" | awk 'match($0,/.*"browser_download_url": "(.*\/aqualinkd-release\.tar\.gz)".*/)' | awk -F '/' '{split($(NF-1), a, "\""); print a[1]}'
|
||||
else
|
||||
curl -fsSL "$REPO/releases" | awk 'match($0,/.*"tarball_url": "(.*\/tarball\/.*)".*/)' | awk -F '/' '{split($NF,a,"\""); print a[1]}'
|
||||
fi
|
||||
}
|
||||
|
||||
function NEW_GET_RELEASE_BU_TAG {
|
||||
#
|
||||
# curl -fsSL https://api.github.com/repos/AqualinkD/AqualinkD/releases/tags/v2.6.11
|
||||
# lok for browser_download_url and then tarball_url
|
||||
}
|
||||
|
||||
function run_install_script {
|
||||
if [ ! -f "$TEMP_INSTALL/release/install.sh" ]; then
|
||||
|
|
@ -330,7 +352,9 @@ case $1 in
|
|||
echo "AqualinkD Installation script"
|
||||
echo "$SELF <- download and install latest AqualinkD version"
|
||||
echo "$SELF latest <- download and install latest AqualinkD version"
|
||||
echo "$SELF development <- download and install latest AqualinkD development version"
|
||||
if [ "$USE_RELEASE_PKG" -eq $FALSE ]; then
|
||||
echo "$SELF development <- download and install latest AqualinkD development version"
|
||||
fi
|
||||
echo "$SELF clean <- Remove AqualinkD"
|
||||
echo "$SELF list <- List available versions to install"
|
||||
echo "$SELF v1.0.0 <- install AqualinkD v1.0.0 (use list option to see available versions)"
|
||||
|
|
|
|||
Loading…
Reference in New Issue