From c49a875ec274b92cdf2b4f706fe1dec98e7ba803 Mon Sep 17 00:00:00 2001 From: purian23 Date: Sun, 23 Nov 2025 14:34:07 -0500 Subject: [PATCH] Workflow updates --- .github/workflows/run-copr.yml | 2 +- .github/workflows/run-obs.yml | 6 +++++ .github/workflows/run-ppa.yml | 9 ++++++++ distro/ubuntu/ppa/create-source.sh | 36 ++++++++++++++++++++++++++++-- 4 files changed, 50 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-copr.yml b/.github/workflows/run-copr.yml index 65766520..1008064f 100644 --- a/.github/workflows/run-copr.yml +++ b/.github/workflows/run-copr.yml @@ -1,4 +1,4 @@ -name: DMS Copr Stable Release (Manual) +name: DMS Copr Stable Release on: workflow_dispatch: diff --git a/.github/workflows/run-obs.yml b/.github/workflows/run-obs.yml index 8e249c44..f9fb3a30 100644 --- a/.github/workflows/run-obs.yml +++ b/.github/workflows/run-obs.yml @@ -7,6 +7,10 @@ on: description: 'Package to update (dms, dms-git, or all)' required: false default: 'all' + rebuild_release: + description: 'Release number for rebuilds (e.g., 2, 3, 4 to increment spec Release)' + required: false + default: '' push: tags: - 'v*' @@ -80,6 +84,8 @@ jobs: chmod 600 ~/.config/osc/oscrc - name: Upload to OBS + env: + REBUILD_RELEASE: ${{ github.event.inputs.rebuild_release }} run: | PACKAGES="${{ steps.packages.outputs.packages }}" MESSAGE="Automated update from GitHub Actions" diff --git a/.github/workflows/run-ppa.yml b/.github/workflows/run-ppa.yml index bef8f70c..7a974aa6 100644 --- a/.github/workflows/run-ppa.yml +++ b/.github/workflows/run-ppa.yml @@ -7,6 +7,10 @@ on: description: 'Package to upload (dms, dms-git, or all)' required: false default: 'dms-git' + rebuild_release: + description: 'Release number for rebuilds (e.g., 2, 3, 4 for ppa2, ppa3, ppa4)' + required: false + default: '' schedule: - cron: '0 */3 * * *' # Every 3 hours for dms-git builds @@ -54,6 +58,8 @@ jobs: fi - name: Upload to PPA + env: + REBUILD_RELEASE: ${{ github.event.inputs.rebuild_release }} run: | PACKAGES="${{ steps.packages.outputs.packages }}" @@ -62,6 +68,9 @@ jobs: if [[ "$PACKAGES" == "all" ]]; then echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "Uploading dms to PPA..." + if [ -n "$REBUILD_RELEASE" ]; then + echo "🔄 Using rebuild release number: ppa$REBUILD_RELEASE" + fi echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" bash create-and-upload.sh "../dms" dms questing diff --git a/distro/ubuntu/ppa/create-source.sh b/distro/ubuntu/ppa/create-source.sh index 365cfa59..2c4a67b0 100755 --- a/distro/ubuntu/ppa/create-source.sh +++ b/distro/ubuntu/ppa/create-source.sh @@ -497,14 +497,46 @@ esac cd - > /dev/null +# Check if this version already exists on PPA (only in CI environment) +if command -v rmadison >/dev/null 2>&1; then + info "Checking if version already exists on PPA..." + PPA_VERSION_CHECK=$(rmadison -u ppa:avengemedia/dms "$PACKAGE_NAME" 2>/dev/null | grep "$VERSION" || true) + if [ -n "$PPA_VERSION_CHECK" ]; then + warn "Version $VERSION already exists on PPA:" + echo "$PPA_VERSION_CHECK" + echo + warn "Skipping upload to avoid duplicate. If this is a rebuild, increment the ppa number." + cd "$PACKAGE_DIR" + # Still clean up extracted sources + case "$PACKAGE_NAME" in + dms-git) + rm -rf DankMaterialShell-* + success "Cleaned up DankMaterialShell-*/ directory" + ;; + esac + exit 0 + fi +fi + # Build source package info "Building source package..." echo -# Use -S for source only, -sa to include original source +# Determine if we need to include orig tarball (-sa) or just debian changes (-sd) +# Check if .orig.tar.xz already exists in parent directory (previous build) +ORIG_TARBALL="${PACKAGE_NAME}_${VERSION%.ppa*}.orig.tar.xz" +if [ -f "../$ORIG_TARBALL" ]; then + info "Found existing orig tarball, using -sd (debian changes only)" + DEBUILD_SOURCE_FLAG="-sd" +else + info "No existing orig tarball found, using -sa (include original source)" + DEBUILD_SOURCE_FLAG="-sa" +fi + +# Use -S for source only, -sa/-sd for source inclusion # -d skips dependency checking (we're building on Fedora, not Ubuntu) # Pipe yes to automatically answer prompts (e.g., "continue anyway?") -if yes | DEBIAN_FRONTEND=noninteractive debuild -S -sa -d; then +if yes | DEBIAN_FRONTEND=noninteractive debuild -S $DEBUILD_SOURCE_FLAG -d; then echo success "Source package built successfully!"