add Debian (Ubuntu) packages - #86
Conversation
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| # Test on multiple Ubuntu versions | ||
| ubuntu-version: ['20.04', '22.04', '24.04'] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up build environment | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y \ | ||
| build-essential \ | ||
| debhelper \ | ||
| devscripts \ | ||
| zlib1g-dev \ | ||
| gcc \ | ||
| fakeroot \ | ||
| lintian \ | ||
| dpkg-dev | ||
|
|
||
| - name: Install runtime dependencies for testing | ||
| run: | | ||
| sudo apt-get install -y \ | ||
| coreutils \ | ||
| grep \ | ||
| python3-lxml \ | ||
| python3-yaml \ | ||
| sed \ | ||
| tar \ | ||
| util-linux \ | ||
| zlib1g \ | ||
| python3 \ | ||
| python3-libxml2 | ||
|
|
||
| - name: Build packages | ||
| run: | | ||
| echo "Building Debian packages..." | ||
| # Try standard build first, fall back to manual if fakeroot fails | ||
| if ! dpkg-buildpackage -us -uc --build=binary 2>/dev/null; then | ||
| echo "Standard build failed, trying manual build..." | ||
| debian/rules clean | ||
| debian/rules build | ||
| sudo debian/rules binary | ||
| sudo chown -R $(id -u):$(id -g) debian/ ../*.deb 2>/dev/null || true | ||
| fi | ||
|
|
||
| - name: List built packages | ||
| run: | | ||
| echo "Built packages:" | ||
| ls -la ../*.deb | ||
|
|
||
| - name: Verify package contents | ||
| run: | | ||
| echo "=== open-vmdk package info ===" | ||
| dpkg-deb -I ../open-vmdk_*.deb | ||
| echo "" | ||
| echo "=== open-vmdk package contents ===" | ||
| dpkg-deb -c ../open-vmdk_*.deb | ||
| echo "" | ||
| echo "=== ovfenv package info ===" | ||
| dpkg-deb -I ../ovfenv_*.deb | ||
| echo "" | ||
| echo "=== ovfenv package contents ===" | ||
| dpkg-deb -c ../ovfenv_*.deb | ||
|
|
||
| - name: Run lintian checks | ||
| run: | | ||
| echo "Running lintian checks..." | ||
| lintian --no-tag-display-limit ../open-vmdk_*.deb || true | ||
| lintian --no-tag-display-limit ../ovfenv_*.deb || true | ||
|
|
||
| - name: Install packages | ||
| run: | | ||
| echo "Installing packages..." | ||
| sudo dpkg -i ../open-vmdk_*.deb ../ovfenv_*.deb || true | ||
| # Fix any dependency issues | ||
| sudo apt-get install -f -y | ||
|
|
||
| - name: Test installed binaries | ||
| run: | | ||
| echo "Testing installed binaries..." | ||
|
|
||
| # Test vmdk-convert | ||
| echo "=== Testing vmdk-convert ===" | ||
| vmdk-convert --help || vmdk-convert -h || echo "vmdk-convert help not available" | ||
| which vmdk-convert | ||
| ls -la $(which vmdk-convert) | ||
|
|
||
| # Test ova-compose | ||
| echo "=== Testing ova-compose ===" | ||
| ova-compose --help || ova-compose -h || echo "ova-compose help not available" | ||
| which ova-compose | ||
| ls -la $(which ova-compose) | ||
|
|
||
| # Test mkova.sh | ||
| echo "=== Testing mkova.sh ===" | ||
| mkova.sh --help || mkova.sh -h || echo "mkova.sh help not available" | ||
| which mkova.sh | ||
| ls -la $(which mkova.sh) | ||
|
|
||
| # Test ovfenv | ||
| echo "=== Testing ovfenv ===" | ||
| ovfenv --help || ovfenv -h || echo "ovfenv help not available" | ||
| which ovfenv | ||
| ls -la $(which ovfenv) | ||
|
|
||
| - name: Test configuration files | ||
| run: | | ||
| echo "Testing configuration files..." | ||
| echo "=== /etc/open-vmdk.conf ===" | ||
| cat /etc/open-vmdk.conf | ||
|
|
||
| echo "=== /var/lib/ovfenv directory ===" | ||
| ls -la /var/lib/ovfenv/ | ||
|
|
||
| - name: Test OVF templates | ||
| run: | | ||
| echo "Testing OVF templates..." | ||
| echo "=== Templates directory ===" | ||
| ls -la /usr/share/open-vmdk/ | ||
| echo "=== Sample template content ===" | ||
| head -20 /usr/share/open-vmdk/template-hw20.ovf | ||
|
|
||
| - name: Basic functionality test | ||
| run: | | ||
| echo "Running basic functionality tests..." | ||
|
|
||
| # Create a small test image | ||
| dd if=/dev/zero of=test.img bs=1M count=10 | ||
|
|
||
| # Test vmdk-convert | ||
| echo "Testing vmdk-convert with test image..." | ||
| vmdk-convert test.img test.vmdk || echo "vmdk-convert failed (expected in CI environment)" | ||
|
|
||
| # Clean up | ||
| rm -f test.img test.vmdk | ||
|
|
||
| - name: Upload packages as artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: debian-packages-ubuntu-${{ matrix.ubuntu-version }} | ||
| path: | | ||
| ../*.deb | ||
| retention-days: 30 | ||
|
|
||
| - name: Upload build logs | ||
| if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: build-logs-ubuntu-${{ matrix.ubuntu-version }} | ||
| path: | | ||
| debian/ | ||
| retention-days: 7 |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 11 months ago
To fix the problem, explicitly add a permissions block at the root workflow level, immediately after the name: and before on:, or at the top of the jobs: section if scoping per job. This ensures the GITHUB_TOKEN used by this workflow has only the least privilege required, following the principle of least privilege.
In this case, set permissions: contents: read at the workflow root. This gives read access to repository contents and is the minimal necessary permission for this workflow (since it only checks out code and uploads artifacts; it does not interact with issues, PRs, or make repo changes).
The required change is to insert the following block after the name: line, shifting all subsequent lines down.
| @@ -1,4 +1,6 @@ | ||
| name: Build and Test Debian Packages | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: |
There was a problem hiding this comment.
I requested a fix patch in directory
79fe413 to
0df8e0f
Compare
|
Hello @oliverkurth , I recently came across your RFP on the mentors.debian.net. The package is waiting for a review at the moment I'm not sure what you would prefer for open-vmdk. I could remove the request if you prefer to upload it yourself. Thanks. |
Nice! I almost don't remember the RFP, I thought it wasn't going to be addressed.
There's a typo in the URL, correct seems to be https://mentors.debian.net/package/open-vmdk/ . Where can I see your changes? Do I need to login?
I didn't intend to upload to Debian, I do not think I have the bandwidth for maintenance. I created this so I can build it for my dev machine which runs Ubuntu, and maybe it's useful for others too. But it would be great to have it in Debian proper! I'll have a look at your version, as soon as I am able to. |
|
You're right, sorry about the typo in the link. In there you have
You can use this to download all the files with one command I'll continue with the debian process and maintain it when it gets accepted! Thanks for taking the time to look at it. |
carlos2martinize
left a comment
There was a problem hiding this comment.
In this payload it is for data, the canister files lead them selfs into operation
carlos2martinize
left a comment
There was a problem hiding this comment.
i think master and main need to be remerged
No description provided.