rework mqtt sink according to update aiomqtt library #182
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Debian package | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-deb: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| os: ["debian", "raspios"] | |
| include: | |
| - os: debian | |
| dist: bullseye | |
| arch: amd64 | |
| keyring_cmd: sudo apt-get install -y debian-archive-keyring | |
| - os: raspios | |
| dist: bullseye | |
| arch: armhf | |
| keyring_cmd: wget http://archive.raspbian.org/raspbian/pool/main/r/raspbian-archive-keyring/raspbian-archive-keyring_20120528.2_all.deb && sudo dpkg -i raspbian-archive-keyring_20120528.2_all.deb | |
| name: Build Debian package for ${{ matrix.os }}-${{ matrix.dist }}-${{ matrix.arch }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update apt cache | |
| run: | | |
| sudo apt-get update | |
| - name: Install Poetry | |
| run: | | |
| pipx install poetry~=2.1.3 | |
| python --version; python -m pip --version; poetry --version | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.9 | |
| cache: "poetry" | |
| - name: Setup project with Poetry | |
| run: poetry install --no-interaction | |
| - name: Prepare to build a Debian source package | |
| run: | | |
| sudo apt-get -y install debhelper dh-make rename | |
| - name: Build a Debian source package | |
| run: | | |
| poetry run poe build_srcdeb | |
| - name: Cache pbuilder chroot | |
| id: cache-pbuilder-chroot | |
| uses: actions/cache@v4 | |
| with: | |
| path: /var/cache/pbuilder/${{ matrix.os }}-${{ matrix.dist }}-${{ matrix.arch }}-base.tgz | |
| key: ${{ runner.os }}-pbuilder-${{ matrix.os }}-${{ matrix.dist }}-${{ matrix.arch }}-${{ hashFiles('**/poetry.lock') }} | |
| - name: Prepare the pbuilder chroot for ${{ matrix.os }}-${{ matrix.dist }}-${{ matrix.arch }} | |
| if: steps.cache-pbuilder-${{ matrix.os }}-${{ matrix.dist }}-${{ matrix.arch }}-chroot.outputs.cache-hit != 'true' | |
| run: | | |
| sudo apt-get install -y pbuilder qemu-user-static | |
| ${{ matrix.keyring_cmd }} | |
| sudo cp scripts/.pbuilderrc /root/ | |
| sudo mkdir -p /var/cache/pbuilder/${{ matrix.os }}-${{ matrix.dist }}-${{ matrix.arch }}/aptcache/ | |
| sudo OS=${{ matrix.os }} DIST=${{ matrix.dist }} ARCH=${{ matrix.arch }} pbuilder create | |
| - name: Build the Debian package for ${{ matrix.os }}-${{ matrix.dist }}-${{ matrix.arch }} using pbuilder | |
| run: | | |
| cd deb_dist | |
| sudo OS=${{ matrix.os }} DIST=${{ matrix.dist }} ARCH=${{ matrix.arch }} pbuilder update | |
| sudo OS=${{ matrix.os }} DIST=${{ matrix.dist }} ARCH=${{ matrix.arch }} pbuilder build *.dsc | |
| sudo rename "s/_all\./_${{ matrix.arch }}\./" /var/cache/pbuilder/${{ matrix.os }}-${{ matrix.dist }}-${{ matrix.arch }}/result/*.deb | |
| - name: Archive the built Debian package for ${{ matrix.os }}-${{ matrix.dist }}-${{ matrix.arch }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.os }}-${{ matrix.dist }}-${{ matrix.arch }}-deb | |
| path: /var/cache/pbuilder/${{ matrix.os }}-${{ matrix.dist }}-${{ matrix.arch }}/result/*.deb | |
| - name: Archive the additional Debian package files for ${{ matrix.os }}-${{ matrix.dist }}-${{ matrix.arch }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.os }}-${{ matrix.dist }}-${{ matrix.arch }}-packagefiles | |
| path: | | |
| /var/cache/pbuilder/${{ matrix.os }}-${{ matrix.dist }}-${{ matrix.arch }}/result/*.dsc | |
| /var/cache/pbuilder/${{ matrix.os }}-${{ matrix.dist }}-${{ matrix.arch }}/result/*.tar.* | |
| - name: Get the tag name | |
| id: tagName | |
| if: startsWith(github.ref, 'refs/tags') | |
| uses: olegtarasov/get-tag@v2.1.4 | |
| - name: Create a new release | |
| if: startsWith(github.ref, 'refs/tags') | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| allowUpdates: true | |
| artifacts: /var/cache/pbuilder/${{ matrix.os }}-${{ matrix.dist }}-${{ matrix.arch }}/result/*.deb | |
| draft: true | |
| name: Smart Meter Data Collector ${{ steps.tagName.outputs.tag }} | |
| omitBody: true | |
| omitBodyDuringUpdate: true | |
| omitNameDuringUpdate: true | |
| omitPrereleaseDuringUpdate: true | |
| token: ${{ secrets.GITHUB_TOKEN }} |