Create Debian Packages #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Debian Packages | |
on: | |
workflow_dispatch: | |
inputs: | |
run-id: | |
description: "ID of the run to get artifacts from" | |
required: true | |
jobs: | |
package-deb: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
- i686-unknown-linux-gnu | |
- aarch64-unknown-linux-gnu | |
- arm-unknown-linux-gnueabihf | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
# Downloading artifacts from the previous workflow | |
- name: Download Artifact for ${{ matrix.target }} | |
uses: actions/download-artifact@v4 | |
with: | |
name: cbor-${{ matrix.target }} | |
path: artifacts/ | |
run-id: ${{ github.event.inputs.run-id }} | |
# Set up the environment for Debian packaging | |
- name: Set up Debian Packaging Environment | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y dpkg-dev lintian | |
# Other necessary setup commands | |
# Iterate over each artifact and create a .deb package | |
- name: Build Debian Packages | |
run: | | |
for artifact in artifacts/*.tar.gz; do | |
target=$(basename $artifact .tar.gz) | |
# Extract artifact | |
tar -xzvf $artifact -C . | |
# Assume generate_debian_files.sh script creates debian files in ./debian directory | |
./scripts/generate_debian_files.sh $target | |
# Build the .deb package | |
dpkg-deb --build debian $target.deb | |
done | |
# Validate the packages (optional) | |
- name: Validate Packages with lintian | |
run: | | |
for deb_package in *.deb; do | |
lintian $deb_package | |
done | |
# Upload the .deb packages | |
- name: Upload Debian Packages | |
uses: actions/upload-artifact@v2 | |
with: | |
name: debian-packages | |
path: ./*.deb |