Skip to content
Merged
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
18 changes: 7 additions & 11 deletions .github/workflows/deploy-package-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,23 @@ on: workflow_call

jobs:
release:
name: Publish Python Wheel
name: Publish Python Wheels
runs-on: ubuntu-latest
environment: release
steps:
- name: Download Source Tarball
- name: Download Source Tarballs
uses: actions/download-artifact@v4
with:
name: Source Tarball
pattern: Source Tarball *
path: dist
merge-multiple: true

- name: Download x86 Python Package Artifacts
- name: Download Python Wheels
uses: actions/download-artifact@v4
with:
name: Python Wheel x86_64
path: dist

- name: Download arm64 Python Package Artifacts
uses: actions/download-artifact@v4
with:
name: Python Wheel aarch64
pattern: Python Wheel *
path: dist
merge-multiple: true

- name: List dist directory
run: ls -la dist/
Expand Down
64 changes: 15 additions & 49 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,67 +11,33 @@ jobs:
release:
name: Create Github Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download Source Tarball
- name: Download Source Tarballs
uses: actions/download-artifact@v4
with:
name: Source Tarball
pattern: Source Tarball *
path: dist
merge-multiple: true

- name: Download x86 Python Package Artifacts
- name: Download Python Wheels
uses: actions/download-artifact@v4
with:
name: Python Wheel x86_64
pattern: Python Wheel *
path: dist
merge-multiple: true

- name: Download arm64 Python Package Artifacts
uses: actions/download-artifact@v4
with:
name: Python Wheel aarch64
path: dist
- name: List dist directory
run: ls -la dist/

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
uses: softprops/action-gh-release@v2
with:
tag_name: "v${{ inputs.version }}"
release_name: "Release v${{ inputs.version }}"
body: |
Release ${{ needs.build-python-package.outputs.version }}
name: "Release v${{ inputs.version }}"
body: "Release ${{ inputs.version }}"
draft: false
prerelease: false

- name: Upload Source Tarball
id: upload-release-asset-source
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: dist/ppbt-${{ inputs.version }}.tar.gz
asset_name: ppbt-${{ inputs.version }}.tar.gz
asset_content_type: application/tar+gzip

- name: Upload x86-64 Wheel
id: upload-release-asset-x86_64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: dist/ppbt-${{ inputs.version }}-py3-none-manylinux_2_17_x86_64.whl
asset_name: ppbt-${{ inputs.version }}-py3-none-manylinux_2_17_x86_64.whl
asset_content_type: application/zip

- name: Upload arm64 Wheel
id: upload-release-asset-aarch64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: dist/ppbt-${{ inputs.version }}-py3-none-manylinux_2_17_aarch64.whl
asset_name: ppbt-${{ inputs.version }}-py3-none-manylinux_2_17_aarch64.whl
asset_content_type: application/zip
files: |
dist/*
55 changes: 41 additions & 14 deletions .github/workflows/package-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,64 @@ on:

jobs:
build-source:
name: Build Python Source Tarball
name: Build Source Tarballs
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- pkg: ppbt
pkg_dir: "."
- pkg: ppbt-cross-aarch64-linux-gnu
pkg_dir: packages/cross-aarch64-linux-gnu
- pkg: ppbt-cross-x86_64-linux-gnu
pkg_dir: packages/cross-x86_64-linux-gnu
steps:
- uses: actions/checkout@master
- name: Install build
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build Source Tarball
working-directory: ${{ matrix.pkg_dir }}
run: |
python3 -m build -s

- name: Python Build Artifact
uses: actions/upload-artifact@v4
with:
name: Source Tarball
path: dist/*
name: Source Tarball ${{ matrix.pkg }}
path: ${{ matrix.pkg_dir }}/dist/*
retention-days: 5

build:
name: Build Python Wheel
strategy:
fail-fast: false
matrix:
host:
- x86_64
- aarch64
runs-on:
- self-hosted
- linux
- src-build
- ${{ matrix.host }}
# Each cell = one wheel. The base ``ppbt`` wheel builds on both
# arches (native toolchain). Cross wheels build on their *host*
# arch only (an aarch64-linux-gnu cross toolchain runs on x86_64).
include:
- host: x86_64
runs_on: ubuntu-latest
pkg: ppbt
pkg_dir: "."
- host: aarch64
runs_on: ubuntu-24.04-arm
pkg: ppbt
pkg_dir: "."
- host: x86_64
runs_on: ubuntu-latest
pkg: ppbt-cross-aarch64-linux-gnu
pkg_dir: packages/cross-aarch64-linux-gnu
- host: aarch64
runs_on: ubuntu-24.04-arm
pkg: ppbt-cross-x86_64-linux-gnu
pkg_dir: packages/cross-x86_64-linux-gnu
runs-on: ${{ matrix.runs_on }}
container:
image: debian:11
image: debian:12
outputs:
version: ${{ steps.version.outputs.version }}
steps:
Expand Down Expand Up @@ -91,18 +116,20 @@ jobs:
pip install build wheel setuptools pkginfo

- name: Build Wheel
working-directory: ${{ matrix.pkg_dir }}
run: |
${{ inputs.cmd }}

- name: Python Build Artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: Python Wheel ${{ matrix.host }}
path: dist/*.whl
name: Python Wheel ${{ matrix.pkg }} ${{ matrix.host }}
path: ${{ matrix.pkg_dir }}/dist/*.whl
retention-days: 5

- name: Read Version
working-directory: ${{ matrix.pkg_dir }}
run: >-
python3
-c
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/pre-commit-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ jobs:
- name: Install System Deps
run: |
sudo apt-get update
sudo apt-get install -y git gcc make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev
sudo apt-get install -y git gcc make zlib1g-dev libc-dev libffi-dev g++ libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install Pre-Commit
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
matrix:
runs-on:
- ubuntu-latest
- macos-12
- macos-13-xlarge
- windows-latest

name: Unit Test ${{ matrix.runs-on }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/test-package-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
matrix:
runs-on:
- ubuntu-latest
- macos-12
- macos-13-xlarge
- windows-latest

name: Package Test ${{ matrix.runs-on }}
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-hooks/copyright_headers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright 2021-2024 Broadcom Corporation
# Copyright 2021-2026 Broadcom Corporation
# SPDX-License-Identifier: Apache-2.0
#
# pylint: disable=invalid-name,missing-module-docstring,missing-function-docstring
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
0.2.0
=====
- Cross toolchains are now shipped as separate PyPI packages:
``ppbt-cross-aarch64-linux-gnu`` (aarch64 target, runs on x86_64 host)
and ``ppbt-cross-x86_64-linux-gnu`` (x86_64 target, runs on aarch64).
The base ``ppbt`` wheel stays lean (native toolchain only), and
cross-compile users opt in via extras:
``pip install ppbt[cross-aarch64-linux-gnu]`` /
``pip install ppbt[cross-x86_64-linux-gnu]`` /
``pip install ppbt[cross-all]``. Cross packages register themselves
via the ``ppbt.toolchains`` entry point so base ``ppbt`` discovers
them at import time.
- New public API: ``ppbt.archive_for(triplet)``,
``ppbt.toolchain_for(triplet)``, ``ppbt.available_triplets()``.
``ppbt.extract()`` and ``ppbt.environ()`` grow a ``triplet=`` kwarg
defaulting to the host triplet for backward compatibility.
- Editable installs (``pip install -e``) now skip the full
crosstool-ng build, so developers can iterate on ppbt without
spending an hour per install.


0.1.8
=====
- Refactor to support early import of ppbt.common at relenv runtime.
Expand Down
Loading
Loading