Skip to content

Commit

Permalink
Package for bookworm (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcapona authored Feb 22, 2024
1 parent b463503 commit 3b22bc3
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 46 deletions.
31 changes: 18 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: "master"
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,42 @@ jobs:
snapshot_number: ${{ steps.version.outputs.distance }}
since: ${{ steps.version.outputs.tag_latest }}

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

- 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 +123,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 +133,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: "master"
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/ || true

- 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
18 changes: 9 additions & 9 deletions debian/pi-topd.lintian-overrides
Original file line number Diff line number Diff line change
@@ -1,9 +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
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 halt.target [lib/systemd/system/pt-poweroff.service]
pi-topd: systemd-service-file-refers-to-unusual-wantedby-target poweroff.target [lib/systemd/system/pt-poweroff.service]
pi-topd: systemd-service-file-refers-to-unusual-wantedby-target reboot.target [lib/systemd/system/pt-reboot.service]
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]
13 changes: 8 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,20 @@ install_requires =
# Package will always update in-step with SDK
# So avoid version-locking
pitop.common
click>=7.1.2,<7.2
click>=7.1.2,<7.2;python_version=='3.9'
click>=8.1.0,<9.0;python_version=='3.11'
click-logging>=1.0.1,<1.1
smbus2>=0.4.0,<0.5
spidev>=3.5,<3.6
# For journal logging
systemd-python>=234,<235
systemd-python>=235,<236;python_version=='3.11'
systemd-python>=234,<235;python_version=='3.9'
# Device Communication
pyzmq>=20.0.0,<21
pyzmq>=20.0.0,<21;python_version=='3.9'
pyzmq>=24.0.0,<25;python_version=='3.11'
# Event handling
pyee>=7.0.0,<8

pyee>=7.0.0,<8;python_version=='3.9'
pyee>=9.0.0,<10;python_version=='3.11'

[options.package_data]
* = *.mp3, *.restore
Expand Down

0 comments on commit 3b22bc3

Please sign in to comment.