-
Notifications
You must be signed in to change notification settings - Fork 195
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
Release Workflow: multiple py versions and arm #678
Changes from 2 commits
3a57776
c1d6eae
68da8f0
6aedda7
e6ba923
a0a8619
dbe3d24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,34 +3,53 @@ on: | |
workflow_dispatch: | ||
jobs: | ||
build_ubuntu: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, ubuntu-20.04] | ||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v4 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
python-version: ${{ matrix.python-version }} | ||
- name: Build wheel with Maturin | ||
run: | | ||
pip install --upgrade maturin | ||
maturin build --release -o dist | ||
maturin build --sdist -o dist | ||
- name: Pypi Release for ubuntu-latest | ||
- name: Pypi Release | ||
run: | | ||
pip install twine | ||
twine upload --skip-existing -u __token__ -p ${{ secrets.PYPI_TOKEN }} dist/* | ||
build_ubuntu_20: | ||
runs-on: ubuntu-20.04 | ||
build_ubuntu_arm: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, ubuntu-20.04] | ||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v4 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
python-version: ${{ matrix.python-version }} | ||
- name : Install rustup targets | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install gcc-aarch64-linux-gnu | ||
rustup target add aarch64-unknown-linux-gnu | ||
- name: Setup cargo target and linker | ||
run: | | ||
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: Build wheel with Maturin | ||
run: | | ||
pip install --upgrade maturin | ||
maturin build --release -o dist | ||
maturin build --release -o dist --target aarch64-unknown-linux-gnu -i ${{ matrix.python-version }} | ||
maturin build --sdist -o dist | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets maybe have a separate step for the source distribution? It doesn't seem like it belongs with Linux x86 necessarily. If we do that, we can combine all matrin steps (other than src) into one. |
||
- name: Pypi Release for ubuntu-latest | ||
- name: Pypi Release | ||
run: | | ||
pip install twine | ||
twine upload --skip-existing -u __token__ -p ${{ secrets.PYPI_TOKEN }} dist/* | ||
|
@@ -39,21 +58,17 @@ jobs: | |
runs-on: [macos-12] | ||
strategy: | ||
matrix: | ||
arch: ['x86_64'] | ||
env: | ||
# Polyglot depends on tree-sitter-python which tries to compile c++ files stdlibc++ which is depreciated in newer version of mac. | ||
MACOSX_DEPLOYMENT_TARGET: 10.16 | ||
CXXFLAGS: -stdlib=libc++ -mmacosx-version-min=10.16 | ||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v4 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
python-version: ${{ matrix.python-version }} | ||
- name: Build wheel with Maturin | ||
run: | | ||
pip install --upgrade maturin | ||
maturin build --release -o dist | ||
- name: Pypi Release for macos-latest | ||
- name: Pypi Release | ||
run: | | ||
pip install twine | ||
twine upload --skip-existing -u __token__ -p ${{ secrets.PYPI_TOKEN }} dist/* | ||
|
@@ -62,21 +77,21 @@ jobs: | |
runs-on: [macos-latest] | ||
strategy: | ||
matrix: | ||
arch: ['arm64'] | ||
env: | ||
# Polyglot depends on tree-sitter-python which tries to compile c++ files stdlibc++ which is depreciated in newer version of mac. | ||
CXXFLAGS: -stdlib=libc++ | ||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v4 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
- name: Build wheel with Maturin | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install rustup targets | ||
run: | | ||
rustup target add x86_64-apple-darwin | ||
rustup target add aarch64-apple-darwin | ||
- name: Build wheel with Maturin | ||
run: | | ||
pip install --upgrade maturin | ||
maturin build --release -o dist --target universal2-apple-darwin | ||
- name: Pypi Release for macos-latest | ||
maturin build --release -o dist --target universal2-apple-darwin -i ${{ matrix.python-version }} | ||
- name: Pypi Release | ||
run: | | ||
pip install twine | ||
twine upload --skip-existing -u __token__ -p ${{ secrets.PYPI_TOKEN }} dist/* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[project] | ||
name = "polyglot_piranha" | ||
requires-python = ">=3.7" | ||
requires-python = ">=3.8" | ||
description = "Polyglot Piranha is a library for performing structural find and replace with deep cleanup." | ||
authors = [ | ||
{ name = "Ameya Ketkar", email = "[email protected]" }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While we are here, maybe remove these two author entries since the emails don't work. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could maybe use this:
fromJSON('{"linux-x86": "ubuntu-20.04", "linux-arm": "ubuntu-latest", "macos": "macos-latest"}')[matrix.target]
And lets add a comment saying "We suspect we need 20.04 due to glibc not being new enough on Debian/devpod."