diff --git a/.github/workflows/deb-build.yml b/.github/workflows/deb-build.yml index 77d1c45c..e839b844 100644 --- a/.github/workflows/deb-build.yml +++ b/.github/workflows/deb-build.yml @@ -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: @@ -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 @@ -64,23 +64,28 @@ 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 @@ -88,13 +93,13 @@ jobs: - 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 @@ -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: @@ -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: diff --git a/.github/workflows/deb-release.yml b/.github/workflows/deb-release.yml index 8d876d5c..ff162bf8 100644 --- a/.github/workflows/deb-release.yml +++ b/.github/workflows/deb-release.yml @@ -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: @@ -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 @@ -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 @@ -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 }}" @@ -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: @@ -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 }}" diff --git a/debian/bullseye-overrides/pi-topd.lintian-overrides b/debian/bullseye-overrides/pi-topd.lintian-overrides new file mode 100644 index 00000000..7778518f --- /dev/null +++ b/debian/bullseye-overrides/pi-topd.lintian-overrides @@ -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 diff --git a/debian/pi-topd.lintian-overrides b/debian/pi-topd.lintian-overrides index 7778518f..3e817937 100644 --- a/debian/pi-topd.lintian-overrides +++ b/debian/pi-topd.lintian-overrides @@ -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] diff --git a/setup.cfg b/setup.cfg index 6fa4defb..c6539bd4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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