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@v7 with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Install build deps run: | sudo apt-get update -qq sudo apt-get install -y devscripts debhelper build-essential - name: Compute build version id: version run: | BASE_VERSION=$(grep -m1 '(' debian/changelog | sed 's/.*(\(.*\)).*/\1/') PR_NUMBER="${{ github.event.pull_request.number }}" SHORT_SHA=$(git rev-parse --short HEAD) BUILD_VERSION="${BASE_VERSION}+pr${PR_NUMBER}.${SHORT_SHA}" echo "build_version=$BUILD_VERSION" >> "$GITHUB_OUTPUT" echo "short_sha=$SHORT_SHA" >> "$GITHUB_OUTPUT" echo "Building version: $BUILD_VERSION" - name: Inject version into Config.pm run: | BUILD_VERSION="${{ steps.version.outputs.build_version }}" sed -i -E "s/^our \\\$VERSION\\s*=.*/our \\\$VERSION = '${BUILD_VERSION}';/" \ src/node_info/files/Config.pm - name: Set package version in changelog run: | BUILD_VERSION="${{ steps.version.outputs.build_version }}" sed -i -E "0,/\(([^)]*)\)/s//(${BUILD_VERSION})/" debian/changelog - name: Generate dynamic debian rules run: | bash src/gen-rules.sh >> debian/rules bash src/gen-rules.sh conffiles >> debian/pve-mod.conffiles - 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/ - name: Upload deb as artifact uses: actions/upload-artifact@v7 with: name: pve-mods-test-build-pr${{ github.event.pull_request.number }}-${{ steps.version.outputs.short_sha }} path: artifacts/*.deb retention-days: 3 patch-install-test: needs: test-release-build uses: ./.github/workflows/validate-mods.yml