workflow: test build version and naming changes (#183)

Co-authored-by: Meliox <na>
This commit is contained in:
Meliox 2026-06-08 22:45:27 +02:00 committed by GitHub
parent e33d4d9a15
commit ea50120ee9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,15 +20,29 @@ jobs:
- name: Install build deps
run: 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 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}"
export BUILD_VERSION="${{ steps.version.outputs.build_version }}"
perl -i -pe 'BEGIN { $v = $ENV{BUILD_VERSION} }
s/(our \$VERSION\s*=\s*'"'"')[^'"'"']*'"'"';/$1'"'"'$v'"'"';/
' src/PVENodeInfo/PVEMod_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: Build package
run: dpkg-buildpackage -us -uc -b
@ -48,12 +62,10 @@ jobs:
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 }}
name: pve-mods-test-build-pr${{ github.event.pull_request.number }}-${{ steps.version.outputs.short_sha }}
path: artifacts/*.deb
retention-days: 3