Skip to content

Commit

Permalink
add deb packaging for ubuntu noble (#351)
Browse files Browse the repository at this point in the history
Adds deb packaging for ubuntu noble
  • Loading branch information
brayniac authored Sep 27, 2024
1 parent 686ea70 commit e7727b7
Showing 1 changed file with 15 additions and 41 deletions.
56 changes: 15 additions & 41 deletions .github/workflows/package-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,24 @@ env:
jobs:
build-deb:
name: "${{ matrix.distro }}:${{ matrix.release }}"
runs-on: ubuntu-24.04
runs-on: buildjet-8vcpu-ubuntu-2204${{ matrix.arch == 'arm64' && '-arm' || '' }}
container: "${{ matrix.distro }}:${{ matrix.release }}"
strategy:
matrix:
include:
# minimum kernel version is 5.5

# debian kernels supported from bullseye and up
- { distro: debian, release: bullseye }
- { distro: debian, release: bookworm }
- { distro: debian, release: bullseye, arch: x86_64 }
- { distro: debian, release: bullseye, arch: arm64 }
- { distro: debian, release: bookworm, arch: x86_64 }
- { distro: debian, release: bookworm, arch: arm64 }

# ubuntu kernels supported from 20.10 and up
- { distro: ubuntu, release: jammy } # 22.04
# - { distro: ubuntu, release: noble } # 24.04
- { distro: ubuntu, release: jammy, arch: x86_64 } # 22.04
- { distro: ubuntu, release: jammy, arch: arm64 } # 22.04
- { distro: ubuntu, release: noble, arch: x86_64 } # 24.04
- { distro: ubuntu, release: noble, arch: arm64 } # 24.04
fail-fast: false
env:
# dpkg-buildpackage issues a warning if we attempt to cross compile and
Expand All @@ -69,46 +73,21 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: modify /etc/apt/sources.list
if: ${{ matrix.distro == 'ubuntu' }}
run: |
cat /etc/apt/sources.list | \
sed 's/^deb /deb [arch=amd64] /g' | \
grep '^deb ' \
> amd64.list
cat /etc/apt/sources.list | \
sed 's/^deb /deb [arch=arm64] /g' | \
grep archive.ubuntu.com | \
grep '^deb ' | \
sed 's|archive.ubuntu.com/ubuntu|ports.ubuntu.com|g' \
> arm64.list
cat amd64.list arm64.list > /etc/apt/sources.list
rm amd64.list arm64.list
- name: enable arm64 dpkg architecture
run: dpkg --add-architecture arm64

- name: install buildsystem apt dependencies
run: |
apt-get update
apt-get install -y \
build-essential \
crossbuild-essential-arm64 \
curl jq lsb-release unzip gpg
- name: install rust
run: |
curl -sSf https://sh.rustup.rs | sh /dev/stdin -y
echo "PATH=$HOME/.cargo/bin:$PATH" >> "$GITHUB_ENV"
- name: enable additional rustup targets
run: rustup target add aarch64-unknown-linux-gnu

- uses: Swatinem/rust-cache@v2
with:
shared-key: build-deb-${{ matrix.distro }}-${{ matrix.release }}
shared-key: build-deb-${{ matrix.distro }}-${{ matrix.release }}-${{ matrix.arch }}

- name: check cargo
shell: bash
Expand Down Expand Up @@ -136,15 +115,10 @@ jobs:
shell: bash
run: ./debian/gen-changelog.sh > debian/changelog

- name: install arm64 build dependencies
run: apt-get build-dep -y -a arm64 ../rezolus*.dsc
- name: build arm64 package
run: dpkg-buildpackage -b -us -uc --host-arch arm64

- name: install x86_64 build dependencies
run: apt-get build-dep -y -a amd64 ../rezolus*.dsc
- name: build x86_64 package
run: dpkg-buildpackage -b -us -uc --host-arch amd64
- name: install build dependencies
run: apt-get build-dep -y ../rezolus*.dsc
- name: build package
run: dpkg-buildpackage -b -us -uc

- name: copy debs
shell: bash
Expand All @@ -156,7 +130,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
path: target/debian/*
name: ${{ matrix.distro }}_${{ matrix.release }}_all
name: ${{ matrix.distro }}_${{ matrix.release }}_${{ matrix.arch }}

upload-to-apt-repo:
if: ${{ github.event_name == 'release' || github.event_name == 'workflow_dispatch' }}
Expand Down

0 comments on commit e7727b7

Please sign in to comment.