Skip to content
This repository was archived by the owner on Jan 1, 2026. It is now read-only.
Open
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
2 changes: 1 addition & 1 deletion .github/actions/setup-mingw/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
runs:
using: "composite"
steps:
- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache-mingw
with:
path: mingw
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-poetry/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ runs:
- run: echo "v=$(poetry --version | cut -d' ' -f3 | cut -d')' -f1)" >> "$GITHUB_OUTPUT"
shell: bash
id: poetry-version
- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache-poetry
with:
path: .venv
Expand Down
236 changes: 113 additions & 123 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,180 +3,170 @@ name: Build, test, release
on:
push:
branches:
- '*'
- "*"
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+.dev[0-9]+'

env:
PY_VERSIONS_STR: >-
["3.8", "3.9", "3.10", "3.11", "3.12"]
VERSIONS_LINUX_STR: >-
["manylinux2014", "manylinux_2_28"]
VERSIONS_MACOS_STR: >-
["macos-11", "macos-12"]
VERSIONS_WINDOWS_STR: >-
["windows-2022"]

- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+.dev[0-9]+"

jobs:
pass-env:
runs-on: ubuntu-latest
outputs:
py-versions-str: ${{ steps.set-env.outputs.py_versions_str }}
versions-linux-str: ${{ steps.set-env.outputs.versions_linux_str }}
versions-macos-str: ${{ steps.set-env.outputs.versions_macos_str }}
versions-windows-str: ${{ steps.set-env.outputs.versions_windows_str }}
is-from-tag-str: ${{ steps.set-env.outputs.is_from_tag_str }}
is-for-release-str: ${{ steps.set-env.outputs.is_for_release_str }}
steps:
- id: set-env
run: |
echo "py_versions_str=${{ toJSON(env.PY_VERSIONS_STR) }}" >> "$GITHUB_OUTPUT"
echo "versions_linux_str=${{ toJSON(env.VERSIONS_LINUX_STR) }}" >> "$GITHUB_OUTPUT"
echo "versions_macos_str=${{ toJSON(env.VERSIONS_MACOS_STR) }}" >> "$GITHUB_OUTPUT"
echo "versions_windows_str=${{ toJSON(env.VERSIONS_WINDOWS_STR) }}" >> "$GITHUB_OUTPUT"
echo "is_from_tag_str=${{ toJSON(github.ref_type == 'tag') }}" >> "$GITHUB_OUTPUT"
echo "is_for_release_str=${{ toJSON(!contains(github.ref_name, 'dev')) }}" >> "$GITHUB_OUTPUT"
build-linux:
needs: pass-env
strategy:
fail-fast: false
matrix:
image-name: ${{ fromJSON(needs.pass-env.outputs.versions-linux-str) }}
image-arch:
- x86_64
py-version: ${{ fromJSON(needs.pass-env.outputs.py-versions-str) }}
runs-on: ubuntu-latest
container:
image: quay.io/pypa/${{ matrix.image-name }}_${{ matrix.image-arch }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: ./.github/actions/setup-poetry
with:
key-base: ${{ matrix.image-name }}_${{ matrix.image-arch }}-py${{ matrix.py-version }}
use-pipx: true
use-specific-python-version: true
specific-python-version: ${{ matrix.py-version }}
- run: make test
- uses: ./.github/actions/upload-artifacts
with:
make-binary: true
repair-manylinux: true
manylinux-target: ${{ matrix.image-name}}_${{ matrix.image-arch }}
if: ${{ fromJSON(needs.pass-env.outputs.is-from-tag-str) }}
build-macos:
needs: pass-env
strategy:
fail-fast: false
matrix:
arch: ${{ fromJSON(needs.pass-env.outputs.versions-macos-str) }}
py-version: ${{ fromJSON(needs.pass-env.outputs.py-versions-str) }}
runs-on: ${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.py-version }}
- uses: ./.github/actions/setup-poetry
with:
key-base: ${{ matrix.arch }}-py${{ matrix.py-version }}
use-pipx: false
use-specific-python-version: false
- run: make test
- uses: ./.github/actions/upload-artifacts
with:
make-binary: true
if: ${{ fromJSON(needs.pass-env.outputs.is-from-tag-str) }}
build-windows:
needs: pass-env
build:
strategy:
fail-fast: false
matrix:
arch: ${{ fromJSON(needs.pass-env.outputs.versions-windows-str) }}
py-version: ${{ fromJSON(needs.pass-env.outputs.py-versions-str) }}
runs-on: ${{ matrix.arch }}
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, macos-13, macos-14, macos-15, windows-2022]
manylinux: [null, "manylinux_2_28_x86_64", "manylinux_2_28_aarch64"]
exclude:
# Exclude manylinux for non-Linux platforms
- os: macos-13
manylinux: "manylinux_2_28_x86_64"
- os: macos-13
manylinux: "manylinux_2_28_aarch64"
- os: macos-14
manylinux: "manylinux_2_28_x86_64"
- os: macos-14
manylinux: "manylinux_2_28_aarch64"
- os: macos-15
manylinux: "manylinux_2_28_x86_64"
- os: macos-15
manylinux: "manylinux_2_28_aarch64"
- os: windows-2022
manylinux: "manylinux_2_28_x86_64"
- os: windows-2022
manylinux: "manylinux_2_28_aarch64"
# Exclude null manylinux for Linux
- os: ubuntu-latest
manylinux: null

runs-on: ${{ matrix.os }}
container: ${{ matrix.manylinux != 'manylinux_2_28_aarch64' && matrix.manylinux && format('quay.io/pypa/{0}', matrix.manylinux) || null }}

steps:
- uses: actions/checkout@v3
# Set up QEMU for aarch64 emulation
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: matrix.manylinux == 'manylinux_2_28_aarch64'

- uses: actions/checkout@v4
with:
submodules: true

# Install libffi-devel for manylinux_2_28 and Python 3.13
- name: Install system dependencies
if: matrix.manylinux == 'manylinux_2_28_x86_64' && matrix.python-version == '3.13'
run: |
yum install -y libffi-devel
shell: bash

# Windows specific setup
- uses: ./.github/actions/setup-mingw
if: runner.os == 'Windows'
with:
key-base: ${{ matrix.arch }}-py${{ matrix.py-version }}
- uses: actions/setup-python@v3
key-base: ${{ matrix.os }}-py${{ matrix.python-version }}

# Setup Python (not for Linux containers)
- uses: actions/setup-python@v4
if: runner.os != 'Linux' || !matrix.manylinux
with:
python-version: ${{ matrix.py-version }}
python-version: ${{ matrix.python-version }}

- uses: ./.github/actions/setup-poetry
if: matrix.manylinux != 'manylinux_2_28_aarch64'
with:
key-base: ${{ matrix.arch }}-py${{ matrix.py-version }}
use-pipx: false
use-specific-python-version: false
key-base: ${{ matrix.os }}-${{ matrix.manylinux || 'native' }}-py${{ matrix.python-version }}
use-pipx: ${{ matrix.manylinux && 'true' || 'false' }}
use-specific-python-version: ${{ matrix.manylinux && 'true' || 'false' }}
specific-python-version: ${{ matrix.python-version }}

# Run tests for aarch64 in Docker
- name: Run tests in aarch64 container
if: matrix.manylinux == 'manylinux_2_28_aarch64'
run: |
docker run --rm -v ${{ github.workspace }}:/work -w /work \
--platform linux/arm64 \
quay.io/pypa/manylinux_2_28_aarch64 \
bash -c "
# Install Python if needed
if ! command -v python${{ matrix.python-version }} &> /dev/null; then
PYTHON_VERSION=\"${{ matrix.python-version }}\"
yum install -y python\${PYTHON_VERSION//./-} python\${PYTHON_VERSION//./-}-devel
fi

# Install pipx and poetry
python${{ matrix.python-version }} -m pip install pipx
python${{ matrix.python-version }} -m pipx install poetry
export PATH=\"\$HOME/.local/bin:\$PATH\"

# Configure poetry
poetry config --local virtualenvs.in-project true
poetry env use python${{ matrix.python-version }}
poetry install

# Run tests
make test
"

# Run tests
- run: make test
if: matrix.manylinux != 'manylinux_2_28_aarch64'

# Upload artifacts for tagged builds
- uses: ./.github/actions/upload-artifacts
with:
make-binary: true
if: ${{ fromJSON(needs.pass-env.outputs.is-from-tag-str) }}
repair-manylinux: ${{ matrix.manylinux && 'true' || 'false' }}
manylinux-target: ${{ matrix.manylinux }}
if: github.ref_type == 'tag'

package-source:
needs:
- pass-env
- build-linux
- build-macos
- build-windows
needs: build
runs-on: ubuntu-latest
if: ${{ fromJSON(needs.pass-env.outputs.is-from-tag-str) }}
if: github.ref_type == 'tag'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ fromJSON(needs.pass-env.outputs.py-versions-str)[0] }}
python-version: "3.8"
- uses: ./.github/actions/setup-poetry
with:
key-base: source_linux-py${{ fromJSON(needs.pass-env.outputs.py-versions-str)[0] }}
key-base: source_linux-py3.8
use-pipx: false
use-specific-python-version: false
- uses: ./.github/actions/upload-artifacts
with:
make-binary: false

upload-pypi:
needs:
- pass-env
- build-linux
- build-macos
- build-windows
- package-source
needs: [build, package-source]
runs-on: ubuntu-latest
if: ${{ fromJSON(needs.pass-env.outputs.is-from-tag-str) }}
if: github.ref_type == 'tag'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ fromJSON(needs.pass-env.outputs.py-versions-str)[0] }}
- uses: actions/download-artifact@v2
python-version: "3.8"
- uses: actions/download-artifact@v3
with:
path: dist
- uses: ./.github/actions/setup-poetry
with:
key-base: source_linux-py${{ fromJSON(needs.pass-env.outputs.py-versions-str)[0] }}
key-base: source_linux-py3.8
use-pipx: false
use-specific-python-version: false
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: dist/artifact/
if: ${{ fromJSON(needs.pass-env.outputs.is-for-release-str) }}
if: ${{ !contains(github.ref_name, 'dev') }}
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TESTPYPI_API_TOKEN }}
packages_dir: dist/artifact/
repository_url: https://test.pypi.org/legacy/
if: ${{ !fromJSON(needs.pass-env.outputs.is-for-release-str) }}
if: ${{ contains(github.ref_name, 'dev') }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dist
quickjs.egg-info
*.so
*.pyd
/venv
Loading