Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/armv7-contamination-deb-mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:

jobs:
build-armv7-contaminated:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}

- name: Upload binary package artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.package }}.${{ matrix.type }}
path: ./*.${{ matrix.type }}
8 changes: 4 additions & 4 deletions .github/workflows/misc-upstream-deb-mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:

jobs:
build-upstream:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -84,19 +84,19 @@ jobs:
echo "ARTIFACT_PREFIX=$(basename -s .dsc "$(find . -name "*.dsc")")" >> $GITHUB_ENV

- name: Upload binary package artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.distro}}_${{ env.ARTIFACT_PREFIX }}.deb
path: ./artifacts/*.deb

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

- name: Upload package build metadata artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.distro}}_${{ env.ARTIFACT_PREFIX }}.metadata
path: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pypi-deb-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:

jobs:
build-from-pypi:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build in ARM Docker container
run: |
Expand All @@ -80,21 +80,21 @@ jobs:
echo "ARTIFACT_PREFIX=$(basename -s .dsc "$(find . -name "*.dsc")")" >> $GITHUB_ENV

- name: Upload binary package artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.distro }}.deb
path: "./${{ matrix.package[0] }}/${{ matrix.distro }}/*.deb"
if-no-files-found: error

- name: Upload source package artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.distro}}.deb-src
path: "./${{ matrix.package[0] }}/${{ matrix.distro }}/*.tar.xz"
if-no-files-found: error

- name: Upload package build metadata artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.distro }}.metadata
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pypi-deb-docker-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ env:

jobs:
build-push-docker-hub:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
matrix:
base_image: ['bullseye', 'bookworm']
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/pypi-wheel-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,28 @@ on:

env:
DOCKER_IMAGE_NAME: "pitop/pypi-build"
DOCKER_IMAGE_BRANCH: "master"
# TODO: revert to "master" before merging
DOCKER_IMAGE_BRANCH: "new-bluez-version"

jobs:
build-debs-from-wheels:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
distro: ["bullseye", "bookworm"]
architecture: [{docker: "linux/arm/v7", debian: "armhf"},{docker: "linux/arm64", debian: "arm64"},{docker: "linux/amd64", debian: "all"}]
package:
- ["bluez-peripheral", "", ""]
- ["dbus-fast", "", ""]
- ["imutils", "", ""]
- ["python-osc", "", ""]
- ["typing-extensions", "", ""]
# package name, version, build dependencies
- ["bluez-peripheral", "0.2.0a4", ""] # this is a pre-release version so we need to specify it to avoid downloading the latest release
- ["dbus-fast", "latest", ""]
- ["imutils", "latest", ""]
- ["python-osc", "latest", ""]
- ["typing-extensions", "latest", ""]

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build in ARM Docker container
run: |
Expand All @@ -44,13 +46,12 @@ jobs:
${{ env.DOCKER_IMAGE_NAME }}:${{ matrix.distro }}-${{ env.DOCKER_IMAGE_BRANCH}} \
bash -c "sudo apt update && \
sudo chown -R nonroot:nonroot . && \
./pypi-build/scripts/pypi-build-wheel.sh ${{ matrix.package[0] }} artifacts/${{ matrix.package[0] }}/${{ matrix.architecture.debian }}/${{ matrix.distro }}/ && \
./pypi-build/scripts/pypi-build-wheel.sh ${{ matrix.package[0] }} ${{ matrix.package[1] }} artifacts/${{ matrix.package[0] }}/${{ matrix.architecture.debian }}/${{ matrix.distro }}/ && \
ls -lR artifacts"

- name: Upload wheel
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "wheels"
name: "wheels_${{ matrix.package[0] }}_${{ matrix.architecture.debian }}_${{ matrix.distro }}"
path: "artifacts/"
if-no-files-found: error

if-no-files-found: error
14 changes: 7 additions & 7 deletions .github/workflows/wheel-deb-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ env:

jobs:
build-debs-from-wheels:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
architecture: [{docker: "linux/arm/v7", debian: "armhf"},{docker: "linux/arm64", debian: "arm64"},{docker: "linux/amd64", debian: "all"}]
package: ["python3-onnxruntime", "python3-typing-extensions", "python3-bluez-peripheral", "python3-osc", "python3-imutils"]
package: ["python3-onnxruntime", "python3-typing-extensions", "python3-bluez-peripheral", "python3-osc", "python3-imutils", "python3-dbus-fast"]
distro: ["bullseye", "bookworm"]

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check wheel exists for architecture
run: |
Expand Down Expand Up @@ -71,17 +71,17 @@ jobs:

- name: Upload binary package artifacts
if: env.WHEEL_FILES_FOUND == '1'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.distro }}.deb
name: ${{ matrix.package }}-${{ matrix.architecture.debian }}-${{ matrix.distro }}.deb
path: ./wheels/${{ matrix.package }}/${{ matrix.architecture.debian }}/${{ matrix.distro }}/output/*.deb
if-no-files-found: error

- name: Upload source package artifacts
if: env.WHEEL_FILES_FOUND == '1'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.distro }}.deb-src
name: ${{ matrix.package }}-${{ matrix.architecture.debian }}-${{ matrix.distro }}.deb-src
path: ./wheels/${{ matrix.package }}/${{ matrix.architecture.debian }}/${{ matrix.distro }}/output/*.tar.*
if-no-files-found: error

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ User libraries:
* Re packaged since we require a newer version than what's available on RPi repos.
* [`python3-bluez-peripheral`](https://pypi.org/project/bluez-peripheral)
* Dependency of `further-link`.
* [`python3-dbus-next`](https://pypi.org/project/dbus-next)
* [`python3-dbus-fast`](https://pypi.org/project/dbus-fast)
* Dependency of `python3-bluez-peripheral`.
* [`python3-nmcli`](https://pypi.org/project/nmcli)
* Dependency of `pt-os-web-portal` to interact with `NetworkManager` .
Expand Down
24 changes: 17 additions & 7 deletions pypi-build/scripts/pypi-build-wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,29 @@ function extract_tarball() {
}

function download_tar_from_pypi() {
# Download tarball
if ! pypi-download "${1}"; then
echo "Failed to download ${1} from PyPI"
local PACKAGE_NAME="$1"
local VERSION="${2:-latest}"

echo "Downloading ${PACKAGE_NAME} from PyPI, version: ${VERSION}"

local CMD=(pypi-download "$PACKAGE_NAME")
if [ "$VERSION" != "latest" ]; then
CMD+=(--release "$VERSION")
fi

if ! "${CMD[@]}"; then
echo "Failed to download ${PACKAGE_NAME} from PyPI"
exit 1
fi
}


function main() {
local PACKAGE_NAME="${1}"
local ARTIFACT_FOLDER="${2:-artifacts}"
local VERSION="${2}"
local ARTIFACT_FOLDER="${3:-artifacts}"

download_tar_from_pypi "${PACKAGE_NAME}"
download_tar_from_pypi "${PACKAGE_NAME}" "${VERSION}"
TARBALL=$(find . -name "*.tar.gz" | head -n 1)
FOLDER=$(basename "${TARBALL}" .tar.gz)

Expand All @@ -57,8 +67,8 @@ function main() {


if [ $# -lt 1 ]; then
echo "Usage: $0 <package-name> <dst-folder>"
echo "Usage: $0 <package-name> <version> <dst-folder>"
exit 1
fi

main "$1" "$2"
main "$1" "$2" "$3"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading