diff --git a/.github/workflows/run-ppa.yml b/.github/workflows/run-ppa.yml index 313275fe..8e3951e9 100644 --- a/.github/workflows/run-ppa.yml +++ b/.github/workflows/run-ppa.yml @@ -242,7 +242,11 @@ jobs: echo "🔄 Using rebuild release number: ppa$REBUILD_RELEASE" fi echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - bash distro/scripts/ppa-upload.sh "$PKG" "$PPA_NAME" questing ${REBUILD_RELEASE:+"$REBUILD_RELEASE"} + # ppa-upload.sh uploads to questing + resolute when series is omitted + if ! bash distro/scripts/ppa-upload.sh "$PKG" "$PPA_NAME" ${REBUILD_RELEASE:+"$REBUILD_RELEASE"}; then + echo "::error::Upload failed for $PKG" + exit 1 + fi done - name: Summary diff --git a/distro/scripts/ppa-build.sh b/distro/scripts/ppa-build.sh index 5129d447..f735cfe0 100755 --- a/distro/scripts/ppa-build.sh +++ b/distro/scripts/ppa-build.sh @@ -3,8 +3,10 @@ # Usage: ./create-source.sh [ubuntu-series] # # Example: -# ./create-source.sh ../dms questing +# ./create-source.sh ../dms questing # Ubuntu 25.10 (default series in ppa-upload) +# ./create-source.sh ../dms resolute # Ubuntu 26.04 LTS # ./create-source.sh ../dms-git questing +# ./create-source.sh ../dms-git resolute set -e @@ -25,11 +27,13 @@ if [ $# -lt 1 ]; then echo "Arguments:" echo " package-dir : Path to package directory (e.g., ../dms)" echo " ubuntu-series : Ubuntu series (optional, default: noble)" - echo " Options: noble, jammy, oracular, mantic" + echo " Options: noble, jammy, oracular, mantic, questing, resolute" echo echo "Examples:" echo " $0 ../dms questing" + echo " $0 ../dms resolute" echo " $0 ../dms-git questing" + echo " $0 ../dms-git resolute" exit 1 fi @@ -129,10 +133,14 @@ check_ppa_version_exists() { local SOURCE_NAME="$2" local VERSION="$3" local CHECK_MODE="${4:-commit}" + local DISTRO_SERIES="${5:-}" - # Query Launchpad API - PPA_VERSION=$(curl -s \ - "https://api.launchpad.net/1.0/~avengemedia/+archive/ubuntu/$PPA_NAME?ws.op=getPublishedSources&source_name=$SOURCE_NAME&status=Published" \ + # Query Launchpad API (optionally scoped to one Ubuntu series so the same version can ship to questing and resolute) + local API_URL="https://api.launchpad.net/1.0/~avengemedia/+archive/ubuntu/$PPA_NAME?ws.op=getPublishedSources&source_name=$SOURCE_NAME&status=Published" + if [[ -n "$DISTRO_SERIES" ]]; then + API_URL+="&distro_series=https://api.launchpad.net/1.0/ubuntu/${DISTRO_SERIES}" + fi + PPA_VERSION=$(curl -s "$API_URL" \ | grep -oP '"source_package_version":\s*"\K[^"]+' | head -1 || echo "") if [[ -n "$PPA_VERSION" ]]; then @@ -259,14 +267,14 @@ if [ "$IS_GIT_PACKAGE" = false ] && [ -n "$GIT_REPO" ]; then if [[ -n "$PPA_NAME" ]]; then info "Checking if version $NEW_VERSION already exists in PPA..." if [[ -z "${REBUILD_RELEASE:-}" ]]; then - if check_ppa_version_exists "$PPA_NAME" "$SOURCE_NAME" "${BASE_VERSION}ppa1" "exact"; then + if check_ppa_version_exists "$PPA_NAME" "$SOURCE_NAME" "${BASE_VERSION}ppa1" "exact" "$UBUNTU_SERIES"; then error "==> Error: Version ${BASE_VERSION}ppa1 already exists in PPA $PPA_NAME" error " To rebuild with a different release number, use:" error " ./distro/scripts/ppa-upload.sh $PACKAGE_NAME 2" exit 1 fi else - if check_ppa_version_exists "$PPA_NAME" "$SOURCE_NAME" "$NEW_VERSION" "exact"; then + if check_ppa_version_exists "$PPA_NAME" "$SOURCE_NAME" "$NEW_VERSION" "exact" "$UBUNTU_SERIES"; then error "==> Error: Version $NEW_VERSION already exists in PPA $PPA_NAME" NEXT_NUM=$((REBUILD_RELEASE + 1)) error " To rebuild with a different release number, use:" @@ -410,7 +418,7 @@ if [ "$IS_GIT_PACKAGE" = true ] && [ -n "$GIT_REPO" ]; then if [[ -n "$PPA_NAME" ]]; then if [[ -z "${REBUILD_RELEASE:-}" ]]; then info "Checking if commit $GIT_COMMIT_HASH already exists in PPA..." - if check_ppa_version_exists "$PPA_NAME" "$SOURCE_NAME" "${BASE_VERSION}ppa1" "commit"; then + if check_ppa_version_exists "$PPA_NAME" "$SOURCE_NAME" "${BASE_VERSION}ppa1" "commit" "$UBUNTU_SERIES"; then error "==> Error: This commit is already uploaded to PPA" error " The same git commit ($GIT_COMMIT_HASH) already exists in PPA." error " To rebuild the same commit, specify a rebuild number:" @@ -429,7 +437,7 @@ if [ "$IS_GIT_PACKAGE" = true ] && [ -n "$GIT_REPO" ]; then PPA_NUM=$REBUILD_RELEASE NEW_VERSION="${BASE_VERSION}ppa${PPA_NUM}" info "Checking if version $NEW_VERSION already exists in PPA..." - if check_ppa_version_exists "$PPA_NAME" "$SOURCE_NAME" "$NEW_VERSION" "exact"; then + if check_ppa_version_exists "$PPA_NAME" "$SOURCE_NAME" "$NEW_VERSION" "exact" "$UBUNTU_SERIES"; then error "==> Error: Version $NEW_VERSION already exists in PPA" error " This exact version (including ppa${PPA_NUM}) is already uploaded." NEXT_NUM=$((PPA_NUM + 1)) diff --git a/distro/scripts/ppa-status.sh b/distro/scripts/ppa-status.sh index d1c9a373..ac566d71 100755 --- a/distro/scripts/ppa-status.sh +++ b/distro/scripts/ppa-status.sh @@ -10,7 +10,8 @@ PPA_OWNER="avengemedia" LAUNCHPAD_API="https://api.launchpad.net/1.0" -DISTRO_SERIES="questing" +# Supported Ubuntu series for PPA builds (25.10 questing + 26.04 LTS resolute) +DISTRO_SERIES_LIST=(questing resolute) # Define packages (sync with ppa-upload.sh) ALL_PACKAGES=(dms dms-git dms-greeter) @@ -106,10 +107,10 @@ get_status_display() { for PPA_NAME in "${PPAS[@]}"; do PPA_ARCHIVE="${LAUNCHPAD_API}/~${PPA_OWNER}/+archive/ubuntu/${PPA_NAME}" + for DISTRO_SERIES in "${DISTRO_SERIES_LIST[@]}"; do echo "==========================================" - echo "=== PPA: ${PPA_OWNER}/${PPA_NAME} ===" + echo "=== PPA: ${PPA_OWNER}/${PPA_NAME} (Ubuntu ${DISTRO_SERIES}) ===" echo "==========================================" - echo "Distribution: Ubuntu $DISTRO_SERIES" echo "" for pkg in "${PACKAGES[@]}"; do @@ -210,6 +211,7 @@ for PPA_NAME in "${PPAS[@]}"; do echo "View full PPA at: https://launchpad.net/~${PPA_OWNER}/+archive/ubuntu/${PPA_NAME}" echo "" + done done echo "==========================================" diff --git a/distro/scripts/ppa-upload.sh b/distro/scripts/ppa-upload.sh index a3630e06..b4876752 100755 --- a/distro/scripts/ppa-upload.sh +++ b/distro/scripts/ppa-upload.sh @@ -3,13 +3,15 @@ # Usage: ./ppa-upload.sh [package-name] [ppa-name] [ubuntu-series] [rebuild-number] [--keep-builds] [--rebuild=N] # # Examples: -# ./ppa-upload.sh dms # Single package (auto-detects PPA) -# ./ppa-upload.sh dms 2 # Rebuild with ppa2 (simple syntax) +# ./ppa-upload.sh dms # Upload to questing + resolute (default) +# ./ppa-upload.sh dms 2 # Rebuild with ppa2 on both series # ./ppa-upload.sh dms --rebuild=2 # Rebuild with ppa2 (flag syntax) -# ./ppa-upload.sh dms-git # Single package -# ./ppa-upload.sh all # All packages -# ./ppa-upload.sh dms dms questing # Explicit PPA and series -# ./ppa-upload.sh dms dms questing 2 # Explicit PPA, series, and rebuild number +# ./ppa-upload.sh dms-git # Single package (both series) +# ./ppa-upload.sh all # All packages (each to both series) +# ./ppa-upload.sh dms resolute # 26.04 LTS only (same as "dms dms resolute") +# ./ppa-upload.sh dms questing # 25.10 only +# ./ppa-upload.sh dms dms resolute # Explicit PPA name + one series (optional form) +# ./ppa-upload.sh dms dms resolute 2 # One series + rebuild number # ./ppa-upload.sh distro/ubuntu/dms dms # Path-style (backward compatible) set -e @@ -52,7 +54,7 @@ done PACKAGE_INPUT="${POSITIONAL_ARGS[0]:-}" PPA_NAME_INPUT="${POSITIONAL_ARGS[1]:-}" -UBUNTU_SERIES="${POSITIONAL_ARGS[2]:-questing}" +UBUNTU_SERIES_RAW="${POSITIONAL_ARGS[2]:-}" if [[ ${#POSITIONAL_ARGS[@]} -gt 0 ]]; then LAST_INDEX=$((${#POSITIONAL_ARGS[@]} - 1)) @@ -64,10 +66,27 @@ if [[ ${#POSITIONAL_ARGS[@]} -gt 0 ]]; then POSITIONAL_ARGS=("${POSITIONAL_ARGS[@]:0:$LAST_INDEX}") PACKAGE_INPUT="${POSITIONAL_ARGS[0]:-}" PPA_NAME_INPUT="${POSITIONAL_ARGS[1]:-}" - UBUNTU_SERIES="${POSITIONAL_ARGS[2]:-questing}" + UBUNTU_SERIES_RAW="${POSITIONAL_ARGS[2]:-}" fi fi +# Shorthand: "dms resolute" / "dms questing" (package + series; PPA inferred — no need for "dms dms resolute") +if [[ ${#POSITIONAL_ARGS[@]} -eq 2 ]] && [[ "${POSITIONAL_ARGS[1]}" == "questing" || "${POSITIONAL_ARGS[1]}" == "resolute" ]]; then + PACKAGE_INPUT="${POSITIONAL_ARGS[0]}" + PPA_NAME_INPUT="" + UBUNTU_SERIES_RAW="${POSITIONAL_ARGS[1]}" +fi + +SERIES_LIST=() +if [[ -z "$UBUNTU_SERIES_RAW" ]]; then + SERIES_LIST=(questing resolute) +elif [[ "$UBUNTU_SERIES_RAW" == "questing" || "$UBUNTU_SERIES_RAW" == "resolute" ]]; then + SERIES_LIST=("$UBUNTU_SERIES_RAW") +else + error "Invalid Ubuntu series: $UBUNTU_SERIES_RAW (use questing, resolute, or omit for both)" + exit 1 +fi + SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" BUILD_SCRIPT="$SCRIPT_DIR/ppa-build.sh" @@ -119,7 +138,12 @@ elif [[ -n "$PACKAGE_INPUT" ]] && [[ "$PACKAGE_INPUT" == "all" ]]; then echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" info "Processing $pkg..." echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - BUILD_ARGS=("$pkg" "$PPA_NAME_INPUT" "$UBUNTU_SERIES") + BUILD_ARGS=("$pkg") + [[ -n "$PPA_NAME_INPUT" ]] && BUILD_ARGS+=("$PPA_NAME_INPUT") + if [[ ${#SERIES_LIST[@]} -eq 1 ]]; then + BUILD_ARGS+=("${SERIES_LIST[0]}") + fi + [[ -n "$REBUILD_RELEASE" ]] && BUILD_ARGS+=("$REBUILD_RELEASE") [[ "$KEEP_BUILDS" == "true" ]] && BUILD_ARGS+=("--keep-builds") if ! "$0" "${BUILD_ARGS[@]}"; then FAILED_PACKAGES+=("$pkg") @@ -165,7 +189,9 @@ else if [[ "$selection" == "a" ]] || [[ "$selection" == "all" ]]; then PACKAGE_INPUT="all" - BUILD_ARGS=("all" "$PPA_NAME_INPUT" "$UBUNTU_SERIES") + BUILD_ARGS=("all") + [[ -n "$PPA_NAME_INPUT" ]] && BUILD_ARGS+=("$PPA_NAME_INPUT") + [[ -n "$REBUILD_RELEASE" ]] && BUILD_ARGS+=("$REBUILD_RELEASE") [[ "$KEEP_BUILDS" == "true" ]] && BUILD_ARGS+=("--keep-builds") exec "$0" "${BUILD_ARGS[@]}" elif [[ "$selection" =~ ^[0-9]+$ ]] && [[ "$selection" -ge 1 ]] && [[ "$selection" -le ${#AVAILABLE_PACKAGES[@]} ]]; then @@ -191,6 +217,26 @@ fi PACKAGE_DIR=$(cd "$PACKAGE_DIR" && pwd) PARENT_DIR=$(dirname "$PACKAGE_DIR") +if [[ ${#SERIES_LIST[@]} -gt 1 ]]; then + export REBUILD_RELEASE + for SERIES in "${SERIES_LIST[@]}"; do + if [[ -n "$PACKAGE_INPUT" ]] && [[ "$PACKAGE_INPUT" == *"/"* ]]; then + ARGS=("$PACKAGE_DIR" "$PPA_NAME" "$SERIES") + else + ARGS=("$PACKAGE_NAME" "$PPA_NAME" "$SERIES") + fi + [[ -n "$REBUILD_RELEASE" ]] && ARGS+=("$REBUILD_RELEASE") + [[ "$KEEP_BUILDS" == "true" ]] && ARGS+=("--keep-builds") + echo "" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + info "Upload series: $SERIES (of ${SERIES_LIST[*]})" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + "$0" "${ARGS[@]}" || exit 1 + done + exit 0 +fi +UBUNTU_SERIES="${SERIES_LIST[0]}" + info "Building and uploading: $PACKAGE_NAME" info "Package directory: $PACKAGE_DIR" info "PPA: ppa:avengemedia/$PPA_NAME"