Skip to content

Commit

Permalink
Build deb packages (#3495)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone authored Feb 4, 2025
1 parent 66875a4 commit f51cab6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "Build Debian Package"
description: "Builds a Debian source package using a Docker image"
name: "Build DEB Package"
description: "Builds a DEB package using a Docker image"
inputs:
ice_version:
description: "The ICE version to build"
description: "The Ice version to build"
required: true
deb_build_options:
description: "DEB_BUILD_OPTIONS for the build"
Expand All @@ -18,26 +18,28 @@ inputs:
runs:
using: "composite"
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Build Docker Image
run: docker build -f ${{ inputs.dockerfile_path }} -t ${{ inputs.docker_image }} .
run: docker build --pull -f ${{ inputs.dockerfile_path }} -t ice-deb-package-builder .
shell: bash

- name: Run Package Build with Mounted Source
run: |
mkdir -p output
docker run --rm \
-v $PWD/ice:/workspace/ice \
-v $PWD/output:/workspace/build \
-v "$GITHUB_WORKSPACE:/workspace" \
-e ICE_VERSION=${{ inputs.ice_version }} \
-e DEB_BUILD_OPTIONS="${{ inputs.deb_build_options }}" \
ice-debian-package-builder
ice-deb-package-builder /workspace/ice/packaging/dpkg/build-package.sh
shell: bash

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: debian-packages-${{ inputs.os }}
path: output/
name: deb-packages-${{ inputs.os }}
path: |
*.deb
*.ddeb
*.dsc
*.tar.xz
*.tar.gz
*.changes
*.buildinfo
13 changes: 9 additions & 4 deletions .github/workflows/build-deb-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
ice_version:
description: "The ICE version to build"
description: "The Ice version to build"
required: true
default: "3.8.0~alpha0"
deb_build_options:
Expand All @@ -21,15 +21,20 @@ jobs:
include:
- os: ubuntu-24.04
runner: ubuntu-24.04
dockerfile_path: ice/packaging/dpkg/ubuntu-24.04/Dockerfile
dockerfile_path: ice/packaging/dpkg/docker/ubuntu-24.04/Dockerfile

- os: ubuntu-24.04-arm
runner: ubuntu-24.04-arm
dockerfile_path: ice/packaging/dpkg/ubuntu-24.04-arm/Dockerfile
dockerfile_path: ice/packaging/dpkg/docker/ubuntu-24.04/Dockerfile

steps:
- name: Check out repository
uses: actions/checkout@v4
with:
path: ice

- name: Call Build Debian Package Action
uses: ./.github/actions/build-debian-package
uses: ./ice/.github/actions/build-deb-package
with:
ice_version: ${{ inputs.ice_version }}
deb_build_options: ${{ inputs.deb_build_options }}
Expand Down
11 changes: 4 additions & 7 deletions packaging/dpkg/build-package.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@ if [ -z "$ICE_VERSION" ]; then
exit 1
fi

# Set working directory
cd /workspace

# Generate the upstream tarball
echo "Creating tarball for ICE_VERSION=$ICE_VERSION"
tar -czf zeroc-ice_${ICE_VERSION}.orig.tar.gz --exclude=debian -C /workspace/ice .
tar -czf /workspace/zeroc-ice_${ICE_VERSION}.orig.tar.gz -C /workspace/ice .

# Create build directory and unpack
mkdir -p build
cd build
mkdir -p /workspace/build
cd /workspace/build
tar xzf ../zeroc-ice_${ICE_VERSION}.orig.tar.gz

# Copy Debian packaging files and build
cp -rfv ../ice/packaging/dpkg/debian .
cp -rfv /workspace/ice/packaging/dpkg/debian .
dpkg-buildpackage -S
dpkg-buildpackage -b -uc -us
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,3 @@ RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

# Set working directory
WORKDIR /workspace

# Copy build script into the container
COPY build-package.sh /usr/local/bin/build-package.sh

# Make the script executable
RUN chmod +x /usr/local/bin/build-package.sh

# Set the default command to run the build script (can be overridden)
ENTRYPOINT ["/usr/local/bin/build-package.sh"]

0 comments on commit f51cab6

Please sign in to comment.