]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
builds workflow: make .orig.tar.gz unique per build 4596/head
authorSerge Hallyn <serge@hallyn.com>
Sat, 25 Oct 2025 20:50:05 +0000 (15:50 -0500)
committerSerge Hallyn <serge@hallyn.com>
Sun, 26 Oct 2025 23:45:47 +0000 (18:45 -0500)
This way we can actually post the result to ppa for
various releases.

The package version previously was something like

6.0.0-0+daily~noble~202510260402

and now becomes

6.0.0~daily~noble~202510260402

So we s/-0+/~/ .  This way, we can use an orig tarball
named lxc_6.0.0~daily~jammy~202510260402.orig.tar.gz.
With the -0 after the version, debuild would only look
for lxc_6.0.0.orig.tar.gz.  6.0.0~daily will still be older
than any 6.0.0-0 or 6.0.0-1 that might legitimately get
pushed into the release.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
.github/workflows/builds.yml

index 62a1659953599d8c63ef01dd86a1e4b959330291..41bd71a1f7f03ecc35e3f16c836c1c75d29c5897 100644 (file)
@@ -47,7 +47,16 @@ jobs:
         run: |
           make dist
           TARBALL=$(ls -1 *.tar.gz)
-          mv ${TARBALL} ../$(echo ${TARBALL} | sed -e "s/.tar.gz$/.orig.tar.gz/g" -e "s/lxc-/lxc_/g")
+          # if TARBALL is something like "lxc-6.0.0.tar.gz"
+          # then we want: lxc_6.0.0+daily~noble~202510252032.orig.tar.gz
+          newname=${TARBALL%.tar.gz}
+          newname="${newname/-/_}"
+          RELEASE=${{ matrix.os }}
+          D="$(date -u +%Y%m%d%H%M)"
+          echo "DPKG_DATE=$D" >> $GITHUB_ENV
+          newname="${newname}~daily~${RELEASE}~${D}.orig.tar.gz"
+          echo "renaming ${TARBALL} to ../${newname}"
+          mv ${TARBALL} "../${newname}"
 
       - name: Assemble the package
         env:
@@ -62,8 +71,9 @@ jobs:
           cd lxc-*/
           cp -R ../packaging/debian .
           rm -f debian/changelog
+          D="${DPKG_DATE}"  # saved from previous step
           dch --create --package lxc \
-            -v 2:${VERSION}-0+daily~${{ matrix.os }}~$(date -u +%Y%m%d%H%M) \
+            -v 2:${VERSION}~daily~${{ matrix.os }}~${D} \
             --distribution ${{ matrix.os }} \
             "Automated snapshot build."