mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-14 09:42:10 -04:00
distro: Unify options across repos
This commit is contained in:
22
.github/workflows/run-obs.yml
vendored
22
.github/workflows/run-obs.yml
vendored
@@ -7,6 +7,14 @@ on:
|
|||||||
description: "Package to update (dms, dms-git, or all)"
|
description: "Package to update (dms, dms-git, or all)"
|
||||||
required: false
|
required: false
|
||||||
default: "all"
|
default: "all"
|
||||||
|
force_upload:
|
||||||
|
description: "Force upload without version check"
|
||||||
|
required: false
|
||||||
|
default: "false"
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- "false"
|
||||||
|
- "true"
|
||||||
rebuild_release:
|
rebuild_release:
|
||||||
description: "Release number for rebuilds (e.g., 2, 3, 4 to increment spec Release)"
|
description: "Release number for rebuilds (e.g., 2, 3, 4 to increment spec Release)"
|
||||||
required: false
|
required: false
|
||||||
@@ -100,6 +108,17 @@ jobs:
|
|||||||
echo "has_updates=true" >> $GITHUB_OUTPUT
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
echo "📋 First upload to OBS, update needed"
|
echo "📋 First upload to OBS, update needed"
|
||||||
fi
|
fi
|
||||||
|
elif [[ "${{ github.event.inputs.force_upload }}" == "true" ]]; then
|
||||||
|
PKG="${{ github.event.inputs.package }}"
|
||||||
|
if [[ -z "$PKG" || "$PKG" == "all" ]]; then
|
||||||
|
echo "packages=all" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "🚀 Force upload: all packages"
|
||||||
|
else
|
||||||
|
echo "packages=$PKG" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "🚀 Force upload: $PKG"
|
||||||
|
fi
|
||||||
elif [[ -n "${{ github.event.inputs.package }}" ]]; then
|
elif [[ -n "${{ github.event.inputs.package }}" ]]; then
|
||||||
echo "packages=${{ github.event.inputs.package }}" >> $GITHUB_OUTPUT
|
echo "packages=${{ github.event.inputs.package }}" >> $GITHUB_OUTPUT
|
||||||
echo "has_updates=true" >> $GITHUB_OUTPUT
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
@@ -117,6 +136,7 @@ jobs:
|
|||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
if: |
|
if: |
|
||||||
|
github.event.inputs.force_upload == 'true' ||
|
||||||
github.event_name == 'workflow_dispatch' ||
|
github.event_name == 'workflow_dispatch' ||
|
||||||
needs.check-updates.outputs.has_updates == 'true'
|
needs.check-updates.outputs.has_updates == 'true'
|
||||||
|
|
||||||
@@ -303,7 +323,7 @@ jobs:
|
|||||||
- name: Upload to OBS
|
- name: Upload to OBS
|
||||||
if: steps.check-loop.outputs.skip != 'true'
|
if: steps.check-loop.outputs.skip != 'true'
|
||||||
env:
|
env:
|
||||||
FORCE_REBUILD: ${{ github.event_name == 'workflow_dispatch' && 'true' || '' }}
|
FORCE_UPLOAD: ${{ github.event.inputs.force_upload }}
|
||||||
REBUILD_RELEASE: ${{ github.event.inputs.rebuild_release }}
|
REBUILD_RELEASE: ${{ github.event.inputs.rebuild_release }}
|
||||||
run: |
|
run: |
|
||||||
PACKAGES="${{ steps.packages.outputs.packages }}"
|
PACKAGES="${{ steps.packages.outputs.packages }}"
|
||||||
|
|||||||
39
.github/workflows/run-ppa.yml
vendored
39
.github/workflows/run-ppa.yml
vendored
@@ -7,6 +7,14 @@ on:
|
|||||||
description: "Package to upload (dms, dms-git, dms-greeter, or all)"
|
description: "Package to upload (dms, dms-git, dms-greeter, or all)"
|
||||||
required: false
|
required: false
|
||||||
default: "dms-git"
|
default: "dms-git"
|
||||||
|
force_upload:
|
||||||
|
description: "Force upload without version check"
|
||||||
|
required: false
|
||||||
|
default: "false"
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- "false"
|
||||||
|
- "true"
|
||||||
rebuild_release:
|
rebuild_release:
|
||||||
description: "Release number for rebuilds (e.g., 2, 3, 4 for ppa2, ppa3, ppa4)"
|
description: "Release number for rebuilds (e.g., 2, 3, 4 for ppa2, ppa3, ppa4)"
|
||||||
required: false
|
required: false
|
||||||
@@ -79,6 +87,7 @@ jobs:
|
|||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
if: |
|
if: |
|
||||||
|
github.event.inputs.force_upload == 'true' ||
|
||||||
github.event_name == 'workflow_dispatch' ||
|
github.event_name == 'workflow_dispatch' ||
|
||||||
needs.check-updates.outputs.has_updates == 'true'
|
needs.check-updates.outputs.has_updates == 'true'
|
||||||
|
|
||||||
@@ -141,12 +150,31 @@ jobs:
|
|||||||
if: steps.check-loop.outputs.skip != 'true'
|
if: steps.check-loop.outputs.skip != 'true'
|
||||||
id: packages
|
id: packages
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ github.event_name }}" == "schedule" ]]; then
|
if [[ "${{ github.event.inputs.force_upload }}" == "true" ]]; then
|
||||||
|
PKG="${{ github.event.inputs.package }}"
|
||||||
|
if [[ -z "$PKG" || "$PKG" == "all" ]]; then
|
||||||
|
echo "packages=all" >> $GITHUB_OUTPUT
|
||||||
|
echo "🚀 Force upload: all packages"
|
||||||
|
else
|
||||||
|
echo "packages=$PKG" >> $GITHUB_OUTPUT
|
||||||
|
echo "🚀 Force upload: $PKG"
|
||||||
|
fi
|
||||||
|
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
|
||||||
echo "packages=${{ needs.check-updates.outputs.packages }}" >> $GITHUB_OUTPUT
|
echo "packages=${{ needs.check-updates.outputs.packages }}" >> $GITHUB_OUTPUT
|
||||||
echo "Triggered by schedule: uploading git package"
|
echo "Triggered by schedule: uploading git package"
|
||||||
elif [[ -n "${{ github.event.inputs.package }}" ]]; then
|
elif [[ -n "${{ github.event.inputs.package }}" ]]; then
|
||||||
echo "packages=${{ github.event.inputs.package }}" >> $GITHUB_OUTPUT
|
# Manual package selection should respect change detection
|
||||||
echo "Manual trigger: ${{ github.event.inputs.package }}"
|
SELECTED_PKG="${{ github.event.inputs.package }}"
|
||||||
|
UPDATED_PKG="${{ needs.check-updates.outputs.packages }}"
|
||||||
|
|
||||||
|
# Check if manually selected package is in the updated list
|
||||||
|
if [[ "$UPDATED_PKG" == *"$SELECTED_PKG"* ]] || [[ "$SELECTED_PKG" == "all" ]]; then
|
||||||
|
echo "packages=$SELECTED_PKG" >> $GITHUB_OUTPUT
|
||||||
|
echo "📦 Manual selection (has updates): $SELECTED_PKG"
|
||||||
|
else
|
||||||
|
echo "packages=" >> $GITHUB_OUTPUT
|
||||||
|
echo "⚠️ Manual selection '$SELECTED_PKG' has no updates - skipping (use force_upload to override)"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "packages=${{ needs.check-updates.outputs.packages }}" >> $GITHUB_OUTPUT
|
echo "packages=${{ needs.check-updates.outputs.packages }}" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
@@ -157,6 +185,11 @@ jobs:
|
|||||||
PACKAGES="${{ steps.packages.outputs.packages }}"
|
PACKAGES="${{ steps.packages.outputs.packages }}"
|
||||||
REBUILD_RELEASE="${{ github.event.inputs.rebuild_release }}"
|
REBUILD_RELEASE="${{ github.event.inputs.rebuild_release }}"
|
||||||
|
|
||||||
|
if [[ -z "$PACKAGES" ]]; then
|
||||||
|
echo "No packages selected for upload. Skipping."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Build command arguments
|
# Build command arguments
|
||||||
BUILD_ARGS=()
|
BUILD_ARGS=()
|
||||||
if [[ -n "$REBUILD_RELEASE" ]]; then
|
if [[ -n "$REBUILD_RELEASE" ]]; then
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Unified OBS upload script for dms packages
|
# Unified OBS upload script for dms packages
|
||||||
# Handles Debian and OpenSUSE builds for both x86_64 and aarch64
|
# Handles Debian and OpenSUSE builds for both x86_64 and aarch64
|
||||||
# Usage: ./distro/scripts/obs-upload.sh [distro] <package-name> [commit-message]
|
# Usage: ./distro/scripts/obs-upload.sh [distro] <package-name> [commit-message|rebuild-number]
|
||||||
#
|
#
|
||||||
# Examples:
|
# Examples:
|
||||||
# ./distro/scripts/obs-upload.sh dms "Update to v0.6.2"
|
# ./distro/scripts/obs-upload.sh dms "Update to v0.6.2"
|
||||||
# ./distro/scripts/obs-upload.sh debian dms
|
# ./distro/scripts/obs-upload.sh debian dms
|
||||||
# ./distro/scripts/obs-upload.sh opensuse dms-git
|
# ./distro/scripts/obs-upload.sh opensuse dms-git
|
||||||
|
# ./distro/scripts/obs-upload.sh debian dms-git 2 # Rebuild with ppa2 suffix
|
||||||
|
# ./distro/scripts/obs-upload.sh dms-git --rebuild=2 # Rebuild with ppa2 suffix (flag syntax)
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@@ -14,6 +16,8 @@ UPLOAD_DEBIAN=true
|
|||||||
UPLOAD_OPENSUSE=true
|
UPLOAD_OPENSUSE=true
|
||||||
PACKAGE=""
|
PACKAGE=""
|
||||||
MESSAGE=""
|
MESSAGE=""
|
||||||
|
REBUILD_RELEASE=""
|
||||||
|
POSITIONAL_ARGS=()
|
||||||
|
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
@@ -25,16 +29,43 @@ for arg in "$@"; do
|
|||||||
UPLOAD_DEBIAN=false
|
UPLOAD_DEBIAN=false
|
||||||
UPLOAD_OPENSUSE=true
|
UPLOAD_OPENSUSE=true
|
||||||
;;
|
;;
|
||||||
|
--rebuild=*)
|
||||||
|
REBUILD_RELEASE="${arg#*=}"
|
||||||
|
;;
|
||||||
|
-r|--rebuild)
|
||||||
|
REBUILD_NEXT=true
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
if [[ -z "$PACKAGE" ]]; then
|
if [[ -n "${REBUILD_NEXT:-}" ]]; then
|
||||||
PACKAGE="$arg"
|
REBUILD_RELEASE="$arg"
|
||||||
elif [[ -z "$MESSAGE" ]]; then
|
REBUILD_NEXT=false
|
||||||
MESSAGE="$arg"
|
else
|
||||||
|
POSITIONAL_ARGS+=("$arg")
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Check if last positional argument is a number (rebuild release)
|
||||||
|
if [[ ${#POSITIONAL_ARGS[@]} -gt 0 ]]; then
|
||||||
|
LAST_INDEX=$((${#POSITIONAL_ARGS[@]} - 1))
|
||||||
|
LAST_ARG="${POSITIONAL_ARGS[$LAST_INDEX]}"
|
||||||
|
if [[ "$LAST_ARG" =~ ^[0-9]+$ ]] && [[ -z "$REBUILD_RELEASE" ]]; then
|
||||||
|
# Last argument is a number and no --rebuild flag was used
|
||||||
|
# Use it as rebuild release and remove from positional args
|
||||||
|
REBUILD_RELEASE="$LAST_ARG"
|
||||||
|
POSITIONAL_ARGS=("${POSITIONAL_ARGS[@]:0:$LAST_INDEX}")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Assign remaining positional args to PACKAGE and MESSAGE
|
||||||
|
if [[ ${#POSITIONAL_ARGS[@]} -gt 0 ]]; then
|
||||||
|
PACKAGE="${POSITIONAL_ARGS[0]}"
|
||||||
|
if [[ ${#POSITIONAL_ARGS[@]} -gt 1 ]]; then
|
||||||
|
MESSAGE="${POSITIONAL_ARGS[1]}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
OBS_BASE_PROJECT="home:AvengeMedia"
|
OBS_BASE_PROJECT="home:AvengeMedia"
|
||||||
OBS_BASE="$HOME/.cache/osc-checkouts"
|
OBS_BASE="$HOME/.cache/osc-checkouts"
|
||||||
AVAILABLE_PACKAGES=(dms dms-git)
|
AVAILABLE_PACKAGES=(dms dms-git)
|
||||||
@@ -145,9 +176,9 @@ IS_MANUAL=false
|
|||||||
if [[ -n "${REBUILD_RELEASE:-}" ]]; then
|
if [[ -n "${REBUILD_RELEASE:-}" ]]; then
|
||||||
IS_MANUAL=true
|
IS_MANUAL=true
|
||||||
echo "==> Manual rebuild detected (REBUILD_RELEASE=$REBUILD_RELEASE)"
|
echo "==> Manual rebuild detected (REBUILD_RELEASE=$REBUILD_RELEASE)"
|
||||||
elif [[ -n "${FORCE_REBUILD:-}" ]] && [[ "${FORCE_REBUILD}" == "true" ]]; then
|
elif [[ -n "${FORCE_UPLOAD:-}" ]] && [[ "${FORCE_UPLOAD}" == "true" ]]; then
|
||||||
IS_MANUAL=true
|
IS_MANUAL=true
|
||||||
echo "==> Manual workflow trigger detected (FORCE_REBUILD=true)"
|
echo "==> Force upload detected (FORCE_UPLOAD=true)"
|
||||||
elif [[ -z "${GITHUB_ACTIONS:-}" ]] && [[ -z "${CI:-}" ]]; then
|
elif [[ -z "${GITHUB_ACTIONS:-}" ]] && [[ -z "${CI:-}" ]]; then
|
||||||
IS_MANUAL=true
|
IS_MANUAL=true
|
||||||
echo "==> Local/manual run detected (not in CI)"
|
echo "==> Local/manual run detected (not in CI)"
|
||||||
@@ -204,22 +235,25 @@ if [[ "$UPLOAD_OPENSUSE" == true ]] && [[ -f "distro/opensuse/$PACKAGE.spec" ]];
|
|||||||
OLD_RELEASE=$(grep "^Release:" "$WORK_DIR/.osc/$PACKAGE.spec" | sed 's/^Release:[[:space:]]*//' | sed 's/%{?dist}//' | head -1)
|
OLD_RELEASE=$(grep "^Release:" "$WORK_DIR/.osc/$PACKAGE.spec" | sed 's/^Release:[[:space:]]*//' | sed 's/%{?dist}//' | head -1)
|
||||||
|
|
||||||
if [[ "$NEW_VERSION" == "$OLD_VERSION" ]]; then
|
if [[ "$NEW_VERSION" == "$OLD_VERSION" ]]; then
|
||||||
if [[ "$OLD_RELEASE" =~ ^([0-9]+) ]]; then
|
if [[ "$IS_MANUAL" == true ]]; then
|
||||||
BASE_RELEASE="${BASH_REMATCH[1]}"
|
if [[ -n "${REBUILD_RELEASE:-}" ]]; then
|
||||||
if [[ "$IS_MANUAL" == true ]]; then
|
echo " 🔄 Using manual rebuild release number: $REBUILD_RELEASE"
|
||||||
NEXT_RELEASE=$((BASE_RELEASE + 1))
|
sed -i "s/^Release:[[:space:]]*${NEW_RELEASE}%{?dist}/Release: ${REBUILD_RELEASE}%{?dist}/" "$WORK_DIR/$PACKAGE.spec"
|
||||||
echo " - Detected rebuild of same version $NEW_VERSION (release $OLD_RELEASE -> $NEXT_RELEASE)"
|
|
||||||
sed -i "s/^Release:[[:space:]]*${NEW_RELEASE}%{?dist}/Release: ${NEXT_RELEASE}%{?dist}/" "$WORK_DIR/$PACKAGE.spec"
|
|
||||||
cp "$WORK_DIR/$PACKAGE.spec" "$REPO_ROOT/distro/opensuse/$PACKAGE.spec"
|
cp "$WORK_DIR/$PACKAGE.spec" "$REPO_ROOT/distro/opensuse/$PACKAGE.spec"
|
||||||
else
|
else
|
||||||
echo " - Detected same version $NEW_VERSION (release $OLD_RELEASE). Not a manual run, skipping update."
|
echo " - Error: Same version detected ($NEW_VERSION) but no rebuild number specified"
|
||||||
# For automated runs with no version change, we should stop here to avoid unnecessary rebuilds
|
echo " To rebuild, explicitly specify a rebuild number:"
|
||||||
# However, we need to check if we are also updating Debian, or if this script is expected to continue.
|
echo " ./distro/scripts/obs-upload.sh opensuse $PACKAGE 2"
|
||||||
# If this is OpenSUSE only run, we can exit.
|
echo " or use flag syntax:"
|
||||||
if [[ "$UPLOAD_DEBIAN" == false ]]; then
|
echo " ./distro/scripts/obs-upload.sh opensuse $PACKAGE --rebuild=2"
|
||||||
echo "✅ No changes needed for OpenSUSE (not manual). Exiting."
|
exit 1
|
||||||
exit 0
|
fi
|
||||||
fi
|
else
|
||||||
|
echo " - Detected same version $NEW_VERSION (release $OLD_RELEASE). Not a manual run, skipping update."
|
||||||
|
# If this is OpenSUSE only run, we can exit.
|
||||||
|
if [[ "$UPLOAD_DEBIAN" == false ]]; then
|
||||||
|
echo "✅ No changes needed for OpenSUSE (not manual). Exiting."
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@@ -659,9 +693,9 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ "$SOURCE_FORMAT" == *"native"* ]] && [[
|
|||||||
if [[ -n "${REBUILD_RELEASE:-}" ]]; then
|
if [[ -n "${REBUILD_RELEASE:-}" ]]; then
|
||||||
IS_MANUAL=true
|
IS_MANUAL=true
|
||||||
echo "==> Manual rebuild detected (REBUILD_RELEASE=$REBUILD_RELEASE)"
|
echo "==> Manual rebuild detected (REBUILD_RELEASE=$REBUILD_RELEASE)"
|
||||||
elif [[ -n "${FORCE_REBUILD:-}" ]] && [[ "${FORCE_REBUILD}" == "true" ]]; then
|
elif [[ -n "${FORCE_UPLOAD:-}" ]] && [[ "${FORCE_UPLOAD}" == "true" ]]; then
|
||||||
IS_MANUAL=true
|
IS_MANUAL=true
|
||||||
echo "==> Manual workflow trigger detected (FORCE_REBUILD=true)"
|
echo "==> Force upload detected (FORCE_UPLOAD=true)"
|
||||||
elif [[ -z "${GITHUB_ACTIONS:-}" ]] && [[ -z "${CI:-}" ]]; then
|
elif [[ -z "${GITHUB_ACTIONS:-}" ]] && [[ -z "${CI:-}" ]]; then
|
||||||
IS_MANUAL=true
|
IS_MANUAL=true
|
||||||
echo "==> Local/manual run detected (not in CI)"
|
echo "==> Local/manual run detected (not in CI)"
|
||||||
@@ -672,74 +706,42 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ "$SOURCE_FORMAT" == *"native"* ]] && [[
|
|||||||
|
|
||||||
if [[ -n "$OLD_DSC_VERSION" ]] && [[ "$OLD_DSC_BASE" == "$CHANGELOG_BASE" ]]; then
|
if [[ -n "$OLD_DSC_VERSION" ]] && [[ "$OLD_DSC_BASE" == "$CHANGELOG_BASE" ]]; then
|
||||||
if [[ "$IS_MANUAL" == true ]]; then
|
if [[ "$IS_MANUAL" == true ]]; then
|
||||||
echo "==> Detected rebuild of same base version $CHANGELOG_BASE, incrementing version"
|
# Only increment version when explicitly specified via REBUILD_RELEASE
|
||||||
|
if [[ -n "$REBUILD_RELEASE" ]]; then
|
||||||
|
echo "==> Using specified rebuild release: ppa$REBUILD_RELEASE"
|
||||||
|
USE_REBUILD_NUM="$REBUILD_RELEASE"
|
||||||
|
else
|
||||||
|
echo "==> Error: Same version detected ($CHANGELOG_VERSION) but no rebuild number specified"
|
||||||
|
echo " To rebuild, explicitly specify a rebuild number:"
|
||||||
|
echo " ./distro/scripts/obs-upload.sh debian $PACKAGE 2"
|
||||||
|
echo " or use flag syntax:"
|
||||||
|
echo " ./distro/scripts/obs-upload.sh debian $PACKAGE --rebuild=2"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# If REBUILD_RELEASE is set, use that number directly
|
if [[ "$CHANGELOG_VERSION" =~ ^([0-9.]+)\+git([0-9]+)(\.[a-f0-9]+)?$ ]]; then
|
||||||
if [[ -n "${REBUILD_RELEASE:-}" ]]; then
|
|
||||||
if [[ "$CHANGELOG_VERSION" =~ ^([0-9.]+)\+git([0-9]+)(\.[a-f0-9]+)?$ ]]; then
|
|
||||||
BASE_VERSION="${BASH_REMATCH[1]}"
|
|
||||||
GIT_NUM="${BASH_REMATCH[2]}"
|
|
||||||
GIT_HASH="${BASH_REMATCH[3]}"
|
|
||||||
NEW_VERSION="${BASE_VERSION}+git${GIT_NUM}${GIT_HASH}ppa${REBUILD_RELEASE}"
|
|
||||||
echo " Using REBUILD_RELEASE=$REBUILD_RELEASE: $CHANGELOG_VERSION -> $NEW_VERSION"
|
|
||||||
else
|
|
||||||
BASE_VERSION=$(echo "$CHANGELOG_VERSION" | sed 's/ppa[0-9]*$//')
|
|
||||||
NEW_VERSION="${BASE_VERSION}ppa${REBUILD_RELEASE}"
|
|
||||||
echo " Using REBUILD_RELEASE=$REBUILD_RELEASE: $CHANGELOG_VERSION -> $NEW_VERSION"
|
|
||||||
fi
|
|
||||||
elif [[ "$CHANGELOG_VERSION" =~ ^([0-9.]+)\+git$ ]]; then
|
|
||||||
BASE_VERSION="${BASH_REMATCH[1]}"
|
BASE_VERSION="${BASH_REMATCH[1]}"
|
||||||
NEW_VERSION="${BASE_VERSION}+gitppa1"
|
GIT_NUM="${BASH_REMATCH[2]}"
|
||||||
echo " Adding PPA number: $CHANGELOG_VERSION -> $NEW_VERSION"
|
GIT_HASH="${BASH_REMATCH[3]}"
|
||||||
|
NEW_VERSION="${BASE_VERSION}+git${GIT_NUM}${GIT_HASH}ppa${USE_REBUILD_NUM}"
|
||||||
|
echo " Setting PPA number to specified value: $CHANGELOG_VERSION -> $NEW_VERSION"
|
||||||
elif [[ "$CHANGELOG_VERSION" =~ ^([0-9.]+)ppa([0-9]+)$ ]]; then
|
elif [[ "$CHANGELOG_VERSION" =~ ^([0-9.]+)ppa([0-9]+)$ ]]; then
|
||||||
BASE_VERSION="${BASH_REMATCH[1]}"
|
BASE_VERSION="${BASH_REMATCH[1]}"
|
||||||
PPA_NUM="${BASH_REMATCH[2]}"
|
NEW_VERSION="${BASE_VERSION}ppa${USE_REBUILD_NUM}"
|
||||||
NEW_PPA_NUM=$((PPA_NUM + 1))
|
echo " Setting PPA number to specified value: $CHANGELOG_VERSION -> $NEW_VERSION"
|
||||||
NEW_VERSION="${BASE_VERSION}ppa${NEW_PPA_NUM}"
|
|
||||||
echo " Incrementing PPA number: $CHANGELOG_VERSION -> $NEW_VERSION"
|
|
||||||
elif [[ "$CHANGELOG_VERSION" =~ ^([0-9.]+)\+git([0-9]+)(\.[a-f0-9]+)?(ppa([0-9]+))?$ ]]; then
|
elif [[ "$CHANGELOG_VERSION" =~ ^([0-9.]+)\+git([0-9]+)(\.[a-f0-9]+)?(ppa([0-9]+))?$ ]]; then
|
||||||
BASE_VERSION="${BASH_REMATCH[1]}"
|
BASE_VERSION="${BASH_REMATCH[1]}"
|
||||||
GIT_NUM="${BASH_REMATCH[2]}"
|
GIT_NUM="${BASH_REMATCH[2]}"
|
||||||
GIT_HASH="${BASH_REMATCH[3]}"
|
GIT_HASH="${BASH_REMATCH[3]}"
|
||||||
PPA_NUM="${BASH_REMATCH[5]}"
|
NEW_VERSION="${BASE_VERSION}+git${GIT_NUM}${GIT_HASH}ppa${USE_REBUILD_NUM}"
|
||||||
|
echo " Setting PPA number to specified value: $CHANGELOG_VERSION -> $NEW_VERSION"
|
||||||
# Check if old DSC has ppa suffix even if changelog doesn't
|
|
||||||
if [[ -z "$PPA_NUM" ]] && [[ "$OLD_DSC_VERSION" =~ ppa([0-9]+)$ ]]; then
|
|
||||||
OLD_PPA_NUM="${BASH_REMATCH[1]}"
|
|
||||||
NEW_PPA_NUM=$((OLD_PPA_NUM + 1))
|
|
||||||
NEW_VERSION="${BASE_VERSION}+git${GIT_NUM}${GIT_HASH}ppa${NEW_PPA_NUM}"
|
|
||||||
echo " Incrementing PPA number from old DSC: $OLD_DSC_VERSION -> $NEW_VERSION"
|
|
||||||
elif [[ -n "$PPA_NUM" ]]; then
|
|
||||||
NEW_PPA_NUM=$((PPA_NUM + 1))
|
|
||||||
NEW_VERSION="${BASE_VERSION}+git${GIT_NUM}${GIT_HASH}ppa${NEW_PPA_NUM}"
|
|
||||||
echo " Incrementing PPA number: $CHANGELOG_VERSION -> $NEW_VERSION"
|
|
||||||
else
|
|
||||||
NEW_VERSION="${BASE_VERSION}+git${GIT_NUM}${GIT_HASH}ppa1"
|
|
||||||
echo " Adding PPA number: $CHANGELOG_VERSION -> $NEW_VERSION"
|
|
||||||
fi
|
|
||||||
elif [[ "$CHANGELOG_VERSION" =~ ^([0-9.]+)(-([0-9]+))?$ ]]; then
|
elif [[ "$CHANGELOG_VERSION" =~ ^([0-9.]+)(-([0-9]+))?$ ]]; then
|
||||||
BASE_VERSION="${BASH_REMATCH[1]}"
|
BASE_VERSION="${BASH_REMATCH[1]}"
|
||||||
# Check if old DSC has ppa suffix even if changelog doesn't
|
NEW_VERSION="${BASE_VERSION}ppa${USE_REBUILD_NUM}"
|
||||||
if [[ "$OLD_DSC_VERSION" =~ ppa([0-9]+)$ ]]; then
|
echo " Warning: Native format cannot have Debian revision, converting to PPA format: $CHANGELOG_VERSION -> $NEW_VERSION"
|
||||||
OLD_PPA_NUM="${BASH_REMATCH[1]}"
|
|
||||||
NEW_PPA_NUM=$((OLD_PPA_NUM + 1))
|
|
||||||
NEW_VERSION="${BASE_VERSION}ppa${NEW_PPA_NUM}"
|
|
||||||
echo " Incrementing PPA number from old DSC: $OLD_DSC_VERSION -> $NEW_VERSION"
|
|
||||||
else
|
|
||||||
NEW_VERSION="${BASE_VERSION}ppa1"
|
|
||||||
echo " Adding PPA number: $CHANGELOG_VERSION -> $NEW_VERSION"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
# Check if old DSC has ppa suffix for unknown formats
|
NEW_VERSION="${CHANGELOG_VERSION}ppa${USE_REBUILD_NUM}"
|
||||||
if [[ "$OLD_DSC_VERSION" =~ ppa([0-9]+)$ ]]; then
|
echo " Warning: Could not parse version format, appending ppa${USE_REBUILD_NUM}: $CHANGELOG_VERSION -> $NEW_VERSION"
|
||||||
OLD_PPA_NUM="${BASH_REMATCH[1]}"
|
|
||||||
NEW_PPA_NUM=$((OLD_PPA_NUM + 1))
|
|
||||||
NEW_VERSION="${CHANGELOG_VERSION}ppa${NEW_PPA_NUM}"
|
|
||||||
echo " Incrementing PPA number from old DSC: $OLD_DSC_VERSION -> $NEW_VERSION"
|
|
||||||
else
|
|
||||||
NEW_VERSION="${CHANGELOG_VERSION}ppa1"
|
|
||||||
echo " Warning: Could not parse version format, appending ppa1: $CHANGELOG_VERSION -> $NEW_VERSION"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "$SOURCE_DIR" ]] || [[ ! -d "$SOURCE_DIR" ]] || [[ ! -d "$SOURCE_DIR/debian" ]]; then
|
if [[ -z "$SOURCE_DIR" ]] || [[ ! -d "$SOURCE_DIR" ]] || [[ ! -d "$SOURCE_DIR/debian" ]]; then
|
||||||
|
|||||||
@@ -209,9 +209,13 @@ if [ "$IS_GIT_PACKAGE" = false ] && [ -n "$GIT_REPO" ]; then
|
|||||||
if [[ "$SOURCE_FORMAT" == *"native"* ]]; then
|
if [[ "$SOURCE_FORMAT" == *"native"* ]]; then
|
||||||
BASE_VERSION="${LATEST_TAG}"
|
BASE_VERSION="${LATEST_TAG}"
|
||||||
if [[ -z "${REBUILD_RELEASE:-}" ]] && [[ "$CURRENT_VERSION" =~ ^${LATEST_TAG}ppa([0-9]+)$ ]]; then
|
if [[ -z "${REBUILD_RELEASE:-}" ]] && [[ "$CURRENT_VERSION" =~ ^${LATEST_TAG}ppa([0-9]+)$ ]]; then
|
||||||
PPA_NUM=$((BASH_REMATCH[1] + 1))
|
|
||||||
if [[ "$IS_MANUAL" == true ]]; then
|
if [[ "$IS_MANUAL" == true ]]; then
|
||||||
info "Detected rebuild of same version (current: $CURRENT_VERSION), incrementing PPA number to $PPA_NUM"
|
error "Same version detected ($CURRENT_VERSION) but no rebuild number specified"
|
||||||
|
error "To rebuild, explicitly specify a rebuild number:"
|
||||||
|
error " ./distro/scripts/ppa-upload.sh $PACKAGE_NAME 2"
|
||||||
|
error "or use flag syntax:"
|
||||||
|
error " ./distro/scripts/ppa-upload.sh $PACKAGE_NAME --rebuild=2"
|
||||||
|
exit 1
|
||||||
else
|
else
|
||||||
info "Detected rebuild of same version (current: $CURRENT_VERSION). Not a manual run, skipping."
|
info "Detected rebuild of same version (current: $CURRENT_VERSION). Not a manual run, skipping."
|
||||||
success "No changes needed (version matches)."
|
success "No changes needed (version matches)."
|
||||||
@@ -225,9 +229,13 @@ if [ "$IS_GIT_PACKAGE" = false ] && [ -n "$GIT_REPO" ]; then
|
|||||||
BASE_VERSION="${LATEST_TAG}-1"
|
BASE_VERSION="${LATEST_TAG}-1"
|
||||||
ESCAPED_BASE=$(echo "$BASE_VERSION" | sed 's/\./\\./g' | sed 's/-/\\-/g')
|
ESCAPED_BASE=$(echo "$BASE_VERSION" | sed 's/\./\\./g' | sed 's/-/\\-/g')
|
||||||
if [[ -z "${REBUILD_RELEASE:-}" ]] && [[ "$CURRENT_VERSION" =~ ^${ESCAPED_BASE}ppa([0-9]+)$ ]]; then
|
if [[ -z "${REBUILD_RELEASE:-}" ]] && [[ "$CURRENT_VERSION" =~ ^${ESCAPED_BASE}ppa([0-9]+)$ ]]; then
|
||||||
PPA_NUM=$((BASH_REMATCH[1] + 1))
|
|
||||||
if [[ "$IS_MANUAL" == true ]]; then
|
if [[ "$IS_MANUAL" == true ]]; then
|
||||||
info "Detected rebuild of same version (current: $CURRENT_VERSION), incrementing PPA number to $PPA_NUM"
|
error "Same version detected ($CURRENT_VERSION) but no rebuild number specified"
|
||||||
|
error "To rebuild, explicitly specify a rebuild number:"
|
||||||
|
error " ./distro/scripts/ppa-upload.sh $PACKAGE_NAME 2"
|
||||||
|
error "or use flag syntax:"
|
||||||
|
error " ./distro/scripts/ppa-upload.sh $PACKAGE_NAME --rebuild=2"
|
||||||
|
exit 1
|
||||||
else
|
else
|
||||||
info "Detected rebuild of same version (current: $CURRENT_VERSION). Not a manual run, skipping."
|
info "Detected rebuild of same version (current: $CURRENT_VERSION). Not a manual run, skipping."
|
||||||
success "No changes needed (version matches)."
|
success "No changes needed (version matches)."
|
||||||
@@ -376,9 +384,13 @@ if [ "$IS_GIT_PACKAGE" = true ] && [ -n "$GIT_REPO" ]; then
|
|||||||
PPA_NUM=1
|
PPA_NUM=1
|
||||||
ESCAPED_BASE=$(echo "$BASE_VERSION" | sed 's/\./\\./g' | sed 's/+/\\+/g')
|
ESCAPED_BASE=$(echo "$BASE_VERSION" | sed 's/\./\\./g' | sed 's/+/\\+/g')
|
||||||
if [[ "$CURRENT_VERSION" =~ ^${ESCAPED_BASE}ppa([0-9]+)$ ]]; then
|
if [[ "$CURRENT_VERSION" =~ ^${ESCAPED_BASE}ppa([0-9]+)$ ]]; then
|
||||||
PPA_NUM=$((BASH_REMATCH[1] + 1))
|
|
||||||
if [[ "$IS_MANUAL" == true ]]; then
|
if [[ "$IS_MANUAL" == true ]]; then
|
||||||
info "Detected rebuild of same commit (current: $CURRENT_VERSION), incrementing PPA number to $PPA_NUM"
|
error "Same commit detected ($CURRENT_VERSION) but no rebuild number specified"
|
||||||
|
error "To rebuild, explicitly specify a rebuild number:"
|
||||||
|
error " ./distro/scripts/ppa-upload.sh $PACKAGE_NAME 2"
|
||||||
|
error "or use flag syntax:"
|
||||||
|
error " ./distro/scripts/ppa-upload.sh $PACKAGE_NAME --rebuild=2"
|
||||||
|
exit 1
|
||||||
else
|
else
|
||||||
info "Detected rebuild of same commit (current: $CURRENT_VERSION). Not a manual run, skipping."
|
info "Detected rebuild of same commit (current: $CURRENT_VERSION). Not a manual run, skipping."
|
||||||
success "No changes needed (commit matches)."
|
success "No changes needed (commit matches)."
|
||||||
|
|||||||
Reference in New Issue
Block a user