From 9656c7afd79b178484dd644f3d10af6a19066fc4 Mon Sep 17 00:00:00 2001 From: purian23 Date: Sun, 21 Dec 2025 23:37:08 -0500 Subject: [PATCH] ubuntu: Update hardcoded arcs --- .github/workflows/run-ppa.yml | 3 ++- distro/scripts/ppa-build.sh | 26 +++++++++++++------------- distro/scripts/ppa-upload.sh | 4 ++++ distro/ubuntu/dms-git/debian/rules | 10 ++++++---- distro/ubuntu/dms/debian/rules | 7 +++++-- 5 files changed, 30 insertions(+), 20 deletions(-) diff --git a/.github/workflows/run-ppa.yml b/.github/workflows/run-ppa.yml index b469084f..75bbb7ef 100644 --- a/.github/workflows/run-ppa.yml +++ b/.github/workflows/run-ppa.yml @@ -51,7 +51,8 @@ jobs: check_stable_package() { local PKG="$1" local PPA_NAME="$2" - local LATEST_TAG=$(curl -s https://api.github.com/repos/AvengeMedia/DankMaterialShell/releases/latest | grep '"tag_name"' | sed 's/.*"tag_name": "v\?\([^"]*\)".*/\1/' || echo "") + # Use git ls-remote to find the latest tag, sorted by version (descending) + local LATEST_TAG=$(git ls-remote --tags --refs --sort='-v:refname' https://github.com/AvengeMedia/DankMaterialShell.git | head -n1 | awk -F/ '{print $NF}' | sed 's/^v//') local PPA_VERSION=$(curl -s "https://api.launchpad.net/1.0/~avengemedia/+archive/ubuntu/$PPA_NAME?ws.op=getPublishedSources&source_name=$PKG&status=Published" | grep -oP '"source_package_version":\s*"\K[^"]+' | head -1 || echo "") local PPA_BASE_VERSION=$(echo "$PPA_VERSION" | sed 's/ppa[0-9]*$//') diff --git a/distro/scripts/ppa-build.sh b/distro/scripts/ppa-build.sh index a1abf2f2..5129d447 100755 --- a/distro/scripts/ppa-build.sh +++ b/distro/scripts/ppa-build.sh @@ -191,19 +191,8 @@ fi cd "$WORK_PACKAGE_DIR" get_latest_tag() { local repo="$1" - if command -v curl &>/dev/null; then - LATEST_TAG=$(curl -s "https://api.github.com/repos/$repo/releases/latest" 2>/dev/null | grep '"tag_name":' | sed 's/.*"tag_name": "\(.*\)".*/\1/' | head -1) - if [ -n "$LATEST_TAG" ]; then - echo "$LATEST_TAG" | sed 's/^v//' - return - fi - fi - TEMP_REPO=$(mktemp -d "$TEMP_BASE/ppa_tag_XXXXXX") - if git clone --depth=1 --quiet "https://github.com/$repo.git" "$TEMP_REPO" 2>/dev/null; then - LATEST_TAG=$(cd "$TEMP_REPO" && git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "") - rm -rf "$TEMP_REPO" - echo "$LATEST_TAG" - fi + # Get the latest tag, sorted by version + git ls-remote --tags --refs --sort='-v:refname' "https://github.com/$repo.git" | head -n1 | awk -F/ '{print $NF}' | sed 's/^v//' } IS_GIT_PACKAGE=false @@ -334,6 +323,17 @@ EOF fi fi + if [ ! -f "dms-distropkg-arm64.gz" ]; then + info "Downloading dms binary for arm64..." + # Try to download arm64 binary, but don't fail if it doesn't exist (yet) + if wget -O dms-distropkg-arm64.gz "https://github.com/AvengeMedia/DankMaterialShell/releases/download/v${VERSION}/dms-distropkg-arm64.gz"; then + success "arm64 binary downloaded" + else + warn "Failed to download dms-distropkg-arm64.gz (skipping)" + rm -f dms-distropkg-arm64.gz + fi + fi + if [ ! -f "dms-source.tar.gz" ]; then info "Downloading dms source for QML files..." if wget -O dms-source.tar.gz "https://github.com/AvengeMedia/DankMaterialShell/archive/refs/tags/v${VERSION}.tar.gz"; then diff --git a/distro/scripts/ppa-upload.sh b/distro/scripts/ppa-upload.sh index 68568294..a3630e06 100755 --- a/distro/scripts/ppa-upload.sh +++ b/distro/scripts/ppa-upload.sh @@ -341,6 +341,10 @@ if [ "$KEEP_BUILDS" = "false" ]; then rm -f "$PACKAGE_DIR/dms-distropkg-amd64.gz" REMOVED=$((REMOVED + 1)) fi + if [ -f "$PACKAGE_DIR/dms-distropkg-arm64.gz" ]; then + rm -f "$PACKAGE_DIR/dms-distropkg-arm64.gz" + REMOVED=$((REMOVED + 1)) + fi if [ -f "$PACKAGE_DIR/dms-source.tar.gz" ]; then rm -f "$PACKAGE_DIR/dms-source.tar.gz" REMOVED=$((REMOVED + 1)) diff --git a/distro/ubuntu/dms-git/debian/rules b/distro/ubuntu/dms-git/debian/rules index 9351f058..ade5c976 100755 --- a/distro/ubuntu/dms-git/debian/rules +++ b/distro/ubuntu/dms-git/debian/rules @@ -32,15 +32,17 @@ override_dh_auto_build: sed -i 's/^go 1\.24\.[0-9]*/go 1.24/' dms-git-repo/core/go.mod # Build dms-cli from source + # Detect architecture + $(eval DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)) @if [ -f dms-git-repo/.dms-version ]; then \ . dms-git-repo/.dms-version; \ - echo "Building with VERSION=$$VERSION COMMIT=$$COMMIT"; \ - cd dms-git-repo/core && $(MAKE) GOFLAGS="-mod=vendor" dist ARCH=amd64 VERSION="$$VERSION" COMMIT="$$COMMIT"; \ + echo "Building with VERSION=$$VERSION COMMIT=$$COMMIT ARCH=$(DEB_HOST_ARCH)"; \ + cd dms-git-repo/core && $(MAKE) GOFLAGS="-mod=vendor" dist ARCH=$(DEB_HOST_ARCH) VERSION="$$VERSION" COMMIT="$$COMMIT"; \ else \ echo "Warning: .dms-version not found, building without version info"; \ - cd dms-git-repo/core && $(MAKE) GOFLAGS="-mod=vendor" dist ARCH=amd64; \ + cd dms-git-repo/core && $(MAKE) GOFLAGS="-mod=vendor" dist ARCH=$(DEB_HOST_ARCH); \ fi - cp dms-git-repo/core/bin/dms-linux-amd64 dms + cp dms-git-repo/core/bin/dms-linux-$(DEB_HOST_ARCH) dms chmod +x dms override_dh_auto_install: diff --git a/distro/ubuntu/dms/debian/rules b/distro/ubuntu/dms/debian/rules index 1fcfe120..1b68be55 100755 --- a/distro/ubuntu/dms/debian/rules +++ b/distro/ubuntu/dms/debian/rules @@ -19,11 +19,14 @@ override_dh_installsystemd: override_dh_auto_build: # All files are included in source package (downloaded by build-source.sh) # Launchpad build environment has no internet access - test -f dms-distropkg-amd64.gz || (echo "ERROR: dms-distropkg-amd64.gz not found!" && exit 1) + $(eval DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)) + @echo "Building for architecture: $(DEB_HOST_ARCH)" + + test -f dms-distropkg-$(DEB_HOST_ARCH).gz || (echo "ERROR: dms-distropkg-$(DEB_HOST_ARCH).gz not found!" && exit 1) test -f dms-source.tar.gz || (echo "ERROR: dms-source.tar.gz not found!" && exit 1) # Extract pre-built binary - gunzip -c dms-distropkg-amd64.gz > dms + gunzip -c dms-distropkg-$(DEB_HOST_ARCH).gz > dms chmod +x dms # Extract source tarball for QML files