Skip to content

Commit 26e0047

Browse files
committed
Add gh action to build deb
1 parent 7d15fa3 commit 26e0047

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

.github/workflows/publish-to-pypi.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,31 @@ jobs:
6969
path: dist/
7070
- name: Publish distribution 📦 to PyPI
7171
uses: pypa/gh-action-pypi-publish@release/v1
72+
73+
build-deb:
74+
name: Build Debian package for Raspberry Pi 📦
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v4
78+
- name: Set up QEMU
79+
uses: docker/setup-qemu-action@v3
80+
- name: Build Debian package in Raspberry Pi OS container
81+
uses: docker/setup-buildx-action@v3
82+
- name: Build ARM Debian package
83+
run: |
84+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
85+
docker run --platform linux/arm/v7 -v $(pwd):/workspace -w /workspace \
86+
balenalib/raspberry-pi-debian:latest \
87+
/bin/bash -c "apt-get update && \
88+
apt-get install -y python3 python3-pip python3-dev python3-setuptools python3-stdeb dh-python \
89+
debhelper build-essential && \
90+
pip3 install -e . && \
91+
make build_deb"
92+
- name: List built packages
93+
run: find deb_dist -name "*.deb"
94+
- name: Upload Debian package to release
95+
uses: softprops/action-gh-release@v2
96+
if: github.event_name == 'release'
97+
with:
98+
files: "deb_dist/*.deb"
99+
tag_name: ${{ github.event.release.tag_name }}

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ wheel
33
build
44
twine
55
bump2version
6-
python-dateutil
6+
python-dateutil
7+
stdeb

0 commit comments

Comments
 (0)