Skip to content

Release Polyglot Piranha #98

Release Polyglot Piranha

Release Polyglot Piranha #98

name: Release Polyglot Piranha
on: workflow_dispatch
env:
# We suspect we need 20.04 due to glibc not being new enough on Debian/devpod.
OS_JSON: '{"linux-x86":"ubuntu-20.04","linux-arm":"ubuntu-latest","macos-arm":"macos-latest"}'
# many_linux_2_28 is compatible with Debian 10: https://github.com/pypa/manylinux/tree/8e297ac3813be400a9a244a2828c18d3dd7e6969?tab=readme-ov-file#manylinux_2_28-almalinux-8-based
MATURIN_TARGET_JSON: '{"linux-x86":"manylinux_2_28","linux-arm":"aarch64-unknown-linux-gnu","macos-arm":"universal2-apple-darwin"}'
jobs:
release:
strategy:
matrix:
target: [linux-x86, linux-arm, macos-arm]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: ${{ fromJSON(env.OS_JSON)[matrix.target] }}

Check failure on line 14 in .github/workflows/polyglot_release.yml

View workflow run for this annotation

GitHub Actions / Release Polyglot Piranha

Invalid workflow file

The workflow is not valid. .github/workflows/polyglot_release.yml (Line: 14, Col: 14): Unrecognized named-value: 'env'. Located at position 10 within expression: fromJSON(env.OS_JSON)[matrix.target]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: pip install --upgrade maturin
run: |
pip install --upgrade maturin
- name: Setup rustup target linux aarch64
if: ${{ matrix.target == 'linux-arm' }}
run: |
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu
rustup target add aarch64-unknown-linux-gnu
mkdir -p .cargo
touch .cargo/config.toml
echo "[target.aarch64-unknown-linux-gnu]" >> .cargo/config.toml
echo "linker = \"aarch64-linux-gnu-gcc\"" >> .cargo/config.toml
- name: Setup rustup target macOS
if: ${{ matrix.target == 'macos-arm' }}
run: |
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
- name: Build wheel with Maturin ${{ matrix.target }}
if: ${{ matrix.target == 'linux-x86' }}
run: |
maturin build --release -o dist --target ${{ fromJSON(env.MATURIN_TARGET_JSON)[matrix.target] }} -i ${{ matrix.python-version }}
- name: Build source distribution
if: ${{ matrix.target == 'linux-x86' }}
run: |
maturin build --sdist -o dist
- name: Pypi Release
run: |
pip install twine
twine upload --repository testpypi --skip-existing -u __token__ -p ${{ secrets.TEST_PYPI_TOKEN }} dist/*