Skip to content

Commit

Permalink
Build for bookworm
Browse files Browse the repository at this point in the history
  • Loading branch information
jcapona committed Feb 14, 2024
1 parent b463503 commit 93676a9
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 32 deletions.
32 changes: 19 additions & 13 deletions .github/workflows/deb-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ on:

env:
DEB_BUILD_DOCKER_IMAGE: "pitop/pi-top-os-deb-build"
DEB_BUILD_DOCKER_TAG: "latest"
DEB_BUILD_DOCKER_BRANCH: "support-bookworm" # revert to "master" once docker image is released
CHANGELOG_AUTHOR_NAME: "pi-top"
CHANGELOG_AUTHOR_EMAIL: "deb-maintainers@pi-top.com"
PACKAGECLOUD_REPO: "experimental"
OS: "debian"
DISTRO: "bullseye"
HOST_COMPILE: "{\"architecture\":[\"amd64\"]}"
X_COMPILE: "{\"architecture\":[\"armhf\", \"arm64\"]}" # ARM 32 and 64 bit
DISTROS: "\"distro\":[\"bookworm\", \"bullseye\"]"
HOST_COMPILE: "\"architecture\":[\"amd64\"]"
X_COMPILE: "\"architecture\":[\"armhf\", \"arm64\"]" # ARM 32 and 64 bit

jobs:
check-architecture:
Expand All @@ -34,11 +34,11 @@ jobs:
# If any packages define architecture as other than 'all'
# then it can't be compiled on host architecture
run: |
architecture=$HOST_COMPILE
if grep '^Architecture:' debian/control | grep -q -v 'all'; then
echo "matrix=$X_COMPILE" >>$GITHUB_OUTPUT
else
echo "matrix=$HOST_COMPILE" >>$GITHUB_OUTPUT
architecture=$X_COMPILE
fi
echo "matrix={$architecture, $DISTROS}">>$GITHUB_OUTPUT
build-debian-package:
needs: check-architecture
Expand All @@ -64,37 +64,43 @@ jobs:
snapshot_number: ${{ steps.version.outputs.distance }}
since: ${{ steps.version.outputs.tag_latest }}

- name: Patch lintian-overrides
if: matrix.distro == 'bullseye'
run:
cp debian/bullseye-overrides/*.lintian-overrides debian/ || true
ls -lR debian

- name: Build Debian package
uses: pi-top/debian-package-build-action@master
with:
# https://github.com/pi-top/debian-package-build-action/pull/19
# lintian_check_changelog_spelling: false
target_architecture: ${{ matrix.architecture }}
docker_image: ${{ env.DEB_BUILD_DOCKER_IMAGE }}:${{ env.DEB_BUILD_DOCKER_TAG }}
docker_image: ${{ env.DEB_BUILD_DOCKER_IMAGE }}:${{ matrix.distro }}-${{ env.DEB_BUILD_DOCKER_BRANCH }}
signing_key: ${{ secrets.DEB_SIGNING_GPG_KEY }}
signing_passphrase: ${{ secrets.DEB_SIGNING_GPG_PASSPHRASE }}
build_directory: ./artifacts
LINTIAN_SHOW_OVERRIDES: 0
# Optional, repo-specific build environment variables
additional_env: |
DATA="${{ secrets.DATA }}"
TLS_KEY="${{ secrets.CERT_PRIVATE_KEY }}"
PYTHON_PACKAGE_VERSION="${{ steps.version.outputs.tag_latest_ltrimv }}"
- name: Generate artifact name
run: |
echo "ARTIFACT_PREFIX=$(basename -s .dsc "$(find . -name "*.dsc")")" >> $GITHUB_ENV
- name: Upload binary package artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_PREFIX }}.deb
name: ${{ matrix.distro }}-${{ env.ARTIFACT_PREFIX }}.deb
path: ./artifacts/*.deb

- name: Upload source package artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_PREFIX }}.deb-src
name: ${{ matrix.distro }}-${{ env.ARTIFACT_PREFIX }}.deb-src
path: ./artifacts/*.tar.xz

- name: Upload package build metadata artifacts
Expand All @@ -118,7 +124,7 @@ jobs:
)
)
with:
repository: ${{ env.PACKAGECLOUD_REPO }}/${{ env.OS }}/${{ env.DISTRO }}
repository: ${{ env.PACKAGECLOUD_REPO }}/${{ env.OS }}/${{ matrix.distro }}
files: |
./artifacts/*.dsc
env:
Expand All @@ -128,7 +134,7 @@ jobs:
uses: pi-top/ghaction-packagecloud@main
if: github.ref == 'refs/heads/master'
with:
repository: ${{ env.PACKAGECLOUD_REPO }}/${{ env.OS }}/${{ env.DISTRO }}
repository: ${{ env.PACKAGECLOUD_REPO }}/${{ env.OS }}/${{ matrix.distro }}
files: |
./artifacts/*.deb
env:
Expand Down
51 changes: 32 additions & 19 deletions .github/workflows/deb-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ on:

env:
DEB_BUILD_DOCKER_IMAGE: "pitop/pi-top-os-deb-build"
DEB_BUILD_DOCKER_TAG: "latest"
DEB_BUILD_DOCKER_BRANCH: "support-bookworm" # revert to "master" once docker image is released
PACKAGECLOUD_REPO: "pi-top-os-unstable"
OS: "debian"
DISTRO: "bullseye"
HOST_COMPILE: "{\"architecture\":[\"amd64\"]}"
X_COMPILE: "{\"architecture\":[\"armhf\", \"arm64\"]}" # ARM 32 and 64 bit
DISTROS: "\"distro\":[\"bookworm\", \"bullseye\"]"
HOST_COMPILE: "\"architecture\":[\"amd64\"]"
X_COMPILE: "\"architecture\":[\"armhf\", \"arm64\"]" # ARM 32 and 64 bit

jobs:
check-architecture:
Expand All @@ -35,11 +35,11 @@ jobs:
# If any packages define architecture as other than 'all'
# then it can't be compiled on host architecture
run: |
architecture=$HOST_COMPILE
if grep '^Architecture:' debian/control | grep -q -v 'all'; then
echo "matrix=$X_COMPILE" >>$GITHUB_OUTPUT
else
echo "matrix=$HOST_COMPILE" >>$GITHUB_OUTPUT
architecture=$X_COMPILE
fi
echo "matrix={$architecture, $DISTROS}">>$GITHUB_OUTPUT
release:
needs: check-architecture
Expand All @@ -58,7 +58,7 @@ jobs:
- name: Get latest semver tag and latest version in changelog
run: |
set -x
sudo apt update
sudo apt install -y --no-install-recommends dpkg-dev npm
npm install -g git-latest-semver-tag
Expand All @@ -72,14 +72,22 @@ jobs:
if: ${{ env.LATEST_TAG != '' }}
run: dpkg --compare-versions ${{ env.CURRENT_VERSION }} gt ${{ env.LATEST_TAG }}

- name: Patch lintian-overrides
if: matrix.distro == 'bullseye'
run:
cp -r debian/bullseye-overrides/* debian/

- name: Build Debian package
uses: pi-top/debian-package-build-action@master
with:
# https://github.com/pi-top/debian-package-build-action/pull/19
# lintian_check_changelog_spelling: false
target_architecture: ${{ matrix.architecture }}
docker_image: ${{ env.DEB_BUILD_DOCKER_IMAGE }}:${{ env.DEB_BUILD_DOCKER_TAG }}
docker_image: ${{ env.DEB_BUILD_DOCKER_IMAGE }}:${{ matrix.distro }}-${{ env.DEB_BUILD_DOCKER_BRANCH }}
signing_key: ${{ secrets.DEB_SIGNING_GPG_KEY }}
signing_passphrase: ${{ secrets.DEB_SIGNING_GPG_PASSPHRASE }}
build_directory: ./artifacts
LINTIAN_SHOW_OVERRIDES: 0
# Optional, repo-specific build environment variables
additional_env: |
DATA="${{ secrets.DATA }}"
Expand All @@ -105,7 +113,7 @@ jobs:
)
with:
repository: ${{ env.PACKAGECLOUD_REPO }}/${{ env.OS }}/${{ env.DISTRO }}
repository: ${{ env.PACKAGECLOUD_REPO }}/${{ env.OS }}/${{ matrix.distro }}
files: |
./artifacts/*.dsc
env:
Expand All @@ -114,18 +122,23 @@ jobs:
- name: Upload .deb to PackageCloud
uses: pi-top/ghaction-packagecloud@main
with:
repository: ${{ env.PACKAGECLOUD_REPO }}/${{ env.OS }}/${{ env.DISTRO }}
repository: ${{ env.PACKAGECLOUD_REPO }}/${{ env.OS }}/${{ matrix.distro }}
files: |
./artifacts/*.deb
env:
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}

- name: Create Release
uses: softprops/action-gh-release@v1
- name: Install zip
uses: montudor/action-zip@v1

- name: Zip distro artifacts
run: |
ls -l ./artifacts
zip ${{ matrix.distro }}.deb.zip ./artifacts/*.deb
- name: Create release and upload package
uses: svenstaro/upload-release-action@v2
with:
tag_name: "v${{ env.CURRENT_VERSION }}"
name: "v${{ env.CURRENT_VERSION }}"
draft: false
prerelease: false
files: ./artifacts/*
token: ${{ secrets.PAT_GITHUB }}
repo_token: ${{ secrets.PAT_GITHUB }}
file: ./${{ matrix.distro}}.deb.zip
tag: "v${{ env.CURRENT_VERSION }}"
9 changes: 9 additions & 0 deletions debian/bullseye-overrides/pi-topd.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pi-topd: no-manual-page usr/bin/pi-topd
pi-topd: no-manual-page usr/bin/pt-poweroff
pi-topd: no-manual-page usr/bin/pt-reboot
pi-topd: systemd-service-file-refers-to-unusual-wantedby-target lib/systemd/system/pt-poweroff.service halt.target
pi-topd: systemd-service-file-refers-to-unusual-wantedby-target lib/systemd/system/pt-poweroff.service poweroff.target
pi-topd: systemd-service-file-refers-to-unusual-wantedby-target lib/systemd/system/pt-reboot.service reboot.target
pi-topd: package-supports-alternative-init-but-no-init.d-script lib/systemd/system/pi-topd.service
pi-topd: package-supports-alternative-init-but-no-init.d-script lib/systemd/system/pt-poweroff.service
pi-topd: package-supports-alternative-init-but-no-init.d-script lib/systemd/system/pt-reboot.service

0 comments on commit 93676a9

Please sign in to comment.