From b8f216dc0f755189f8794b9386d5bce6f3be9ebf Mon Sep 17 00:00:00 2001 From: purian23 Date: Wed, 8 Jul 2026 13:52:12 -0400 Subject: [PATCH] fix(workflow): void stable packages (cherry picked from commit a48cce59d4f6c30e729a19dcf05b1cd9cafa2c42) --- .github/workflows/run-xbps.yml | 37 ++++++++++++++++++++++++ distro/void/srcpkgs/dms-greeter/template | 5 ++-- distro/void/srcpkgs/dms/template | 5 ++-- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-xbps.yml b/.github/workflows/run-xbps.yml index b26ecc9c0..1684811ef 100644 --- a/.github/workflows/run-xbps.yml +++ b/.github/workflows/run-xbps.yml @@ -7,6 +7,10 @@ on: types: [published] workflow_dispatch: inputs: + version: + description: 'Stable release tag/version to build (e.g. v1.5.0 or 1.5.0). Leave blank to use the selected ref/template version' + type: string + required: false force_rebuild: description: 'Force rebuilding packages even if they already exist in the repository' type: boolean @@ -40,6 +44,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 with: + ref: ${{ github.event.release.tag_name || (github.event.inputs.version && (startsWith(github.event.inputs.version, 'v') && github.event.inputs.version || format('v{0}', github.event.inputs.version))) || github.ref }} fetch-depth: 0 - name: Checkout gh-pages branch @@ -157,6 +162,25 @@ jobs: BUILD_GIT="false" fi + RELEASE_TAG="" + if [ "${{ github.event_name }}" = "release" ]; then + RELEASE_TAG="${{ github.event.release.tag_name }}" + elif [ -n "${{ github.event.inputs.version || '' }}" ]; then + RELEASE_TAG="${{ github.event.inputs.version }}" + elif [ "${{ github.ref_type }}" = "tag" ]; then + RELEASE_TAG="${{ github.ref_name }}" + fi + + if [ -n "$RELEASE_TAG" ]; then + RELEASE_VER="${RELEASE_TAG#v}" + ARCHIVE_TAG="v${RELEASE_VER}" + echo "Stable release tag: $ARCHIVE_TAG" + else + RELEASE_VER="" + ARCHIVE_TAG="" + echo "Stable release tag: (template version)" + fi + echo "=== Starting Builds ===" echo "DMS stable build enabled: $BUILD_DMS" echo "Greeter stable build enabled: $BUILD_GREETER" @@ -165,6 +189,19 @@ jobs: cd void-packages + if [ -n "$RELEASE_VER" ] && { [ "$BUILD_DMS" = "true" ] || [ "$BUILD_GREETER" = "true" ]; }; then + echo "🔧 Updating stable templates for $ARCHIVE_TAG" + TARBALL="$(mktemp)" + curl -fsSL -o "$TARBALL" "https://github.com/${{ github.repository }}/archive/refs/tags/${ARCHIVE_TAG}.tar.gz" + RELEASE_CHECKSUM="$(sha256sum "$TARBALL" | cut -d' ' -f1)" + rm -f "$TARBALL" + + for pkg in dms dms-greeter; do + sed -i "s/^version=.*/version=${RELEASE_VER}/" "srcpkgs/${pkg}/template" + sed -i "s/^checksum=.*/checksum=${RELEASE_CHECKSUM}/" "srcpkgs/${pkg}/template" + done + fi + # 1. Build dms-git (development package) if [ "$BUILD_GIT" = "true" ]; then # Calculate dynamic git version (tag.commits.hash) diff --git a/distro/void/srcpkgs/dms-greeter/template b/distro/void/srcpkgs/dms-greeter/template index 2b16eddb3..ce5e3ceb5 100644 --- a/distro/void/srcpkgs/dms-greeter/template +++ b/distro/void/srcpkgs/dms-greeter/template @@ -2,16 +2,17 @@ # # greetd greeter for DankMaterialShell # Builds from the same DMS release tarball as 'dms'; keep version/checksum in sync. +# CI rewrites version/checksum from the selected release tag before building. # Setup is done by `dms greeter enable`, not by this package — see distro/void/README.md. pkgname=dms-greeter -version=1.4.6 +version=1.5.0 revision=1 short_desc="DankMaterialShell greeter for greetd" maintainer="AvengeMedia " license="MIT" homepage="https://danklinux.com" distfiles="https://github.com/AvengeMedia/DankMaterialShell/archive/refs/tags/v${version}.tar.gz" -checksum=f54601e522c883fa9cce02bec070e4321e47389a1cf453e7ad0bb7379ad91b61 +checksum=14f2678d6a15223ba069d1b8c8a21a5564b735d190c231f62ed44fd8bf48677c depends="greetd quickshell acl-progs seatd pam_rundir" diff --git a/distro/void/srcpkgs/dms/template b/distro/void/srcpkgs/dms/template index fca99409f..1169998cf 100644 --- a/distro/void/srcpkgs/dms/template +++ b/distro/void/srcpkgs/dms/template @@ -4,8 +4,9 @@ # # NOTE: the binary is built with the `distro_binary` build tag, which is the # packaged variant upstream ships (it drops the in-app self-update command). +# CI rewrites version/checksum from the selected release tag before building. pkgname=dms -version=1.4.6 +version=1.5.0 revision=1 build_style=go build_wrksrc="core" @@ -19,7 +20,7 @@ license="MIT" homepage="https://danklinux.com" changelog="https://github.com/AvengeMedia/DankMaterialShell/releases" distfiles="https://github.com/AvengeMedia/DankMaterialShell/archive/refs/tags/v${version}.tar.gz" -checksum=f54601e522c883fa9cce02bec070e4321e47389a1cf453e7ad0bb7379ad91b61 +checksum=14f2678d6a15223ba069d1b8c8a21a5564b735d190c231f62ed44fd8bf48677c # Optional feature deps are listed in distro/void/README.md. depends="quickshell accountsservice dgop matugen dbus elogind"