Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build wheels for Python package #549

Merged
merged 26 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b4c6fd5
ci: publish `taplo-cli` to PyPI with maturin.rs
redeboer Feb 4, 2024
58f8b54
chore: update to `actions/checkout@v4`
redeboer Feb 4, 2024
c2a0124
chore: update upload/download actions
redeboer Feb 4, 2024
28305eb
ci: merge wheel files in intermediate job
redeboer Feb 4, 2024
55c7e96
chore: update locked dependencies
redeboer Feb 4, 2024
2ef0d97
fix: build openssl
redeboer Feb 4, 2024
d975aa1
TEMP: build Python package on all branches
redeboer Feb 4, 2024
438003f
ci: build linux distributions with and without vendored openssl
redeboer Feb 4, 2024
a10ac6a
ci: test pip package on different OS
redeboer Feb 4, 2024
66cc4e4
ci: bump `taplo-cli` to 0.9.1-rc.1
redeboer Feb 4, 2024
a998432
TEMP: rename Python package to `taplo-test`
redeboer Feb 4, 2024
ebe50e3
fix: upload files from `wheels/*` folder
redeboer Feb 4, 2024
72f4b60
Revert "TEMP: rename Python package to `taplo-test`"
redeboer Feb 7, 2024
dd14809
chore: clean up `.gitignore`
redeboer Feb 7, 2024
ebdb3e3
Revert "TEMP: build Python package on all branches"
redeboer Feb 7, 2024
3487ebe
Merge branch 'master' into linux-shared-and-static-openssl
redeboer Apr 18, 2024
3b4b7c6
Merge branch 'master' into linux-shared-and-static-openssl
redeboer Aug 19, 2024
b57045a
chore: update `openssl`
redeboer Aug 19, 2024
a24682a
chore: fix formatting
redeboer Aug 19, 2024
ffd444a
ci: merge Python workflow into release workflow
redeboer Aug 19, 2024
a9e7a4a
Merge branch 'master' into linux-shared-and-static-openssl
redeboer Aug 19, 2024
2ed2723
fix: only publish on tags
redeboer Aug 19, 2024
cdb6a3a
ci: publish via `pypa/gh-action-pypi-publish`
redeboer Aug 20, 2024
52376a4
fix: remove unnecessary changes
panekj Aug 20, 2024
26e00f9
ci: fix artefact names, clean-up naming
panekj Aug 20, 2024
48175dc
ci: fix sdist check [ci skip]
panekj Aug 21, 2024
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
163 changes: 163 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
name: Python package

on:
push:
branches:
- main
- master
tags:
- release-*cli-*
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- x86
- x86_64
steps:
- uses: actions/checkout@v4
- if: matrix.target == 'x86_64'
name: Build wheels (static openssl)
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --features vendored-openssl
sccache: "true"
manylinux: auto
before-script-linux: |
yum install -y perl-IPC-Cmd
- if: matrix.target == 'x86'
name: Build wheels (shared openssl)
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: "true"
manylinux: auto
before-script-linux: |
yum install -y openssl-devel
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ github.job }}-${{ matrix.target }}
path: dist

windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
target:
- x64
- x86
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ github.job }}-${{ matrix.target }}
path: dist

macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
target:
- aarch64
- x86_64
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ github.job }}-${{ matrix.target }}
path: dist

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-${{ github.job }}
path: dist

merge:
name: Merge wheels
runs-on: ubuntu-latest
needs: [linux, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: wheels
- uses: actions/upload-artifact@v4
with:
name: wheels
path: wheels

test-pip:
needs: merge
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-latest
steps:
- uses: actions/download-artifact@v4
with:
name: wheels
path: wheels
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install taplo --no-index --find-links wheels/
- run: taplo help

release:
name: Release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: test-pip
steps:
- uses: actions/download-artifact@v4
with:
name: wheels
path: wheels
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing wheels/*
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ target
.vscode/settings.json
.cargo/config.toml
yarn-error.log

# Python
__pycache__/
*venv/
dist/
wheels/
Loading
Loading