From b7c15b2dafdef2026dfeb4bedd609cc4f4bb0af8 Mon Sep 17 00:00:00 2001 From: Meliox Date: Wed, 10 Jun 2026 19:50:13 +0200 Subject: [PATCH] readd test-release --- .github/workflows/test-release.yml | 59 ++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/test-release.yml diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml new file mode 100644 index 0000000..004d297 --- /dev/null +++ b/.github/workflows/test-release.yml @@ -0,0 +1,59 @@ +name: Test Release Build + +# Runs when the 'make-test-build' label is applied to a pull request, +# or on any subsequent commit while that label is present. + +on: + pull_request: + types: [labeled, synchronize] + +jobs: + test-release-build: + runs-on: ubuntu-latest + if: contains(github.event.pull_request.labels.*.name, 'make-test-build') + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha || github.sha }} + + - name: Install build deps + run: sudo apt-get install -y devscripts debhelper build-essential + + - name: Inject version into PVEMod_Config.pm + run: | + VERSION=$(grep -m1 '(' debian/changelog | sed 's/.*(\(.*\)).*/\1/') + SHORT_SHA=$(git rev-parse --short HEAD) + export BUILD_VERSION="${VERSION}-test-${SHORT_SHA}" + perl -i -pe 'BEGIN { $v = $ENV{BUILD_VERSION} } + s/(our \$VERSION\s*=\s*'"'"')[^'"'"']*'"'"';/$1'"'"'$v'"'"';/ + ' src/PVENodeInfo/PVEMod_Config.pm + + - name: Build package + run: dpkg-buildpackage -us -uc -b + + - name: Verify package contents + run: | + echo "=== Built files ===" + ls -la ../*.deb + echo "" + echo "=== Package info ===" + dpkg-deb --info ../*.deb + echo "" + echo "=== Package contents ===" + dpkg-deb --contents ../*.deb + + - name: Collect deb artifacts + id: collect + run: | + mkdir -p artifacts + cp ../*.deb artifacts/ + SHORT_SHA=$(git rev-parse --short HEAD) + echo "short_sha=$SHORT_SHA" >> "$GITHUB_OUTPUT" + + - name: Upload deb as artifact + uses: actions/upload-artifact@v4 + with: + name: pve-mods-test-build-${{ steps.collect.outputs.short_sha }} + path: artifacts/*.deb + retention-days: 3 \ No newline at end of file