From 71f4ad632e89f182085146fa88d8a861e54e5e0c Mon Sep 17 00:00:00 2001 From: Brad Cowie Date: Tue, 7 Dec 2021 14:45:30 +1300 Subject: [PATCH] Build packages on arm architectures for debian and ubuntu. --- .github/workflows/release-debian.yml | 68 +++++++++++++++++++++++----- .github/workflows/test-debian.yml | 63 ++++++++++++++++++++++---- 2 files changed, 109 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release-debian.yml b/.github/workflows/release-debian.yml index 748ad1a..e6d9b84 100644 --- a/.github/workflows/release-debian.yml +++ b/.github/workflows/release-debian.yml @@ -73,9 +73,55 @@ jobs: name: "release" strategy: matrix: - distro: [raspbian] - release: [buster, bullseye] - arch: [armv7, aarch64] + include: + - distro: "debian" + release: "buster" + image: "buster" + arch: "armv7" + - distro: "debian" + release: "buster" + image: "buster" + arch: "aarch64" + - distro: "debian" + release: "bullseye" + image: "bullseye" + arch: "armv7" + - distro: "debian" + release: "bullseye" + image: "bullseye" + arch: "aarch64" + - distro: "ubuntu" + release: "bionic" + image: "ubuntu18.04" + arch: "armv7" + - distro: "ubuntu" + release: "bionic" + image: "ubuntu18.04" + arch: "aarch64" + - distro: "ubuntu" + release: "focal" + image: "ubuntu20.04" + arch: "armv7" + - distro: "ubuntu" + release: "focal" + image: "ubuntu20.04" + arch: "aarch64" + - distro: "raspbian" + release: "buster" + image: "buster" + arch: "armv7" + - distro: "raspbian" + release: "buster" + image: "buster" + arch: "aarch64" + - distro: "raspbian" + release: "bullseye" + image: "bullseye" + arch: "armv7" + - distro: "raspbian" + release: "bullseye" + image: "bullseye" + arch: "aarch64" steps: - name: Checkout repo uses: actions/checkout@v2 @@ -84,13 +130,7 @@ jobs: id: build with: arch: ${{ matrix.arch }} - distro: ${{ matrix.release }} - setup: | - mkdir -p "${PWD}/packages" - dockerRunArgs: | - --volume "${PWD}/packages:/packages" - env: | - artifact_dir: ${{ matrix.distro }}_${{ matrix.release }} + distro: ${{ matrix.image }} shell: /bin/bash install: | apt-get update @@ -99,11 +139,15 @@ jobs: run: | export DEBEMAIL='maintainers@faucet.nz' export DEBFULLNAME='Faucet Maintainers' + mkdir -p /build + cp -r ${GITHUB_WORKSPACE} /build/package + cd /build/package debchange --newversion ${{ github.event.release.tag_name }} -b "New upstream release" mk-build-deps -i -r -t 'apt-get -f -y --force-yes' dpkg-buildpackage -b -us -uc -rfakeroot - mkdir -p /packages/${artifact_dir} - cp ../*.deb /packages/${artifact_dir} + artifact_dir=${{ matrix.distro }}_${{ matrix.release }} + mkdir -p "${GITHUB_WORKSPACE}/packages/${artifact_dir}" + cp ../*.deb "${GITHUB_WORKSPACE}/packages/${artifact_dir}" - name: Publish package on packagecloud uses: faucetsdn/action-packagecloud-upload-debian-packages@v1 with: diff --git a/.github/workflows/test-debian.yml b/.github/workflows/test-debian.yml index 7b5680c..a26910f 100644 --- a/.github/workflows/test-debian.yml +++ b/.github/workflows/test-debian.yml @@ -55,9 +55,55 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - distro: [raspbian] - release: [buster, bullseye] - arch: [armv7, aarch64] + include: + - distro: "debian" + release: "buster" + image: "buster" + arch: "armv7" + - distro: "debian" + release: "buster" + image: "buster" + arch: "aarch64" + - distro: "debian" + release: "bullseye" + image: "bullseye" + arch: "armv7" + - distro: "debian" + release: "bullseye" + image: "bullseye" + arch: "aarch64" + - distro: "ubuntu" + release: "bionic" + image: "ubuntu18.04" + arch: "armv7" + - distro: "ubuntu" + release: "bionic" + image: "ubuntu18.04" + arch: "aarch64" + - distro: "ubuntu" + release: "focal" + image: "ubuntu20.04" + arch: "armv7" + - distro: "ubuntu" + release: "focal" + image: "ubuntu20.04" + arch: "aarch64" + - distro: "raspbian" + release: "buster" + image: "buster" + arch: "armv7" + - distro: "raspbian" + release: "buster" + image: "buster" + arch: "aarch64" + - distro: "raspbian" + release: "bullseye" + image: "bullseye" + arch: "armv7" + - distro: "raspbian" + release: "bullseye" + image: "bullseye" + arch: "aarch64" steps: - name: Checkout repo uses: actions/checkout@v2 @@ -66,13 +112,7 @@ jobs: id: build with: arch: ${{ matrix.arch }} - distro: ${{ matrix.release }} - setup: | - mkdir -p "${PWD}/packages" - dockerRunArgs: | - --volume "${PWD}/packages:/packages" - env: | - artifact_dir: ${{ matrix.distro }}_${{ matrix.release }} + distro: ${{ matrix.image }} shell: /bin/bash install: | apt-get update @@ -81,6 +121,9 @@ jobs: run: | export DEBEMAIL='maintainers@faucet.nz' export DEBFULLNAME='Faucet Maintainers' + mkdir -p /build + cp -r ${GITHUB_WORKSPACE} /build/package + cd /build/package debchange -b "Test release" mk-build-deps -i -r -t 'apt-get -f -y --force-yes' dpkg-buildpackage -b -us -uc -rfakeroot