-
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3a57776
Release Workflow: multiple py versions and arm
dvmarcilio c1d6eae
Release workflow: reducing duplication
dvmarcilio 68da8f0
Release: single job with conditional steps for each platform
dvmarcilio 6aedda7
pyproject.toml: only Uber as author
dvmarcilio e6ba923
Release: matrix w/ target
dvmarcilio a0a8619
Release: merging build wheel steps w/ maturin
dvmarcilio dbe3d24
Release: better step name for sdist
dvmarcilio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,45 @@ | ||
name: Release Polyglot Piranha | ||
on: | ||
workflow_dispatch: | ||
on: workflow_dispatch | ||
jobs: | ||
build_ubuntu: | ||
runs-on: ubuntu-latest | ||
release: | ||
strategy: | ||
matrix: | ||
target: [linux-x86, linux-arm, macos-arm] | ||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
# We need 20.04 due to glibc not being new enough on Debian/devpod | ||
# It has glibc 2.28+ (manylinux_2_28), which is compatible with Debian 10: https://github.com/pypa/manylinux/tree/8e297ac3813be400a9a244a2828c18d3dd7e6969?tab=readme-ov-file#manylinux_2_28-almalinux-8-based | ||
runs-on: ${{ fromJSON('{"linux-x86":"ubuntu-20.04","linux-arm":"ubuntu-latest","macos-arm":"macos-latest"}')[matrix.target] }} | ||
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: pip install --upgrade maturin | ||
run: | | ||
pip install --upgrade maturin | ||
maturin build --release -o dist | ||
maturin build --sdist -o dist | ||
- name: Pypi Release for ubuntu-latest | ||
- name: Setup rustup target linux-arm | ||
if: ${{ matrix.target == 'linux-arm' }} | ||
run: | | ||
pip install twine | ||
twine upload --skip-existing -u __token__ -p ${{ secrets.PYPI_TOKEN }} dist/* | ||
build_ubuntu_20: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
- name: Build wheel with Maturin | ||
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-arm | ||
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 }} | ||
run: | | ||
maturin build --release -o dist --target ${{ fromJSON('{"linux-x86":"x86_64-unknown-linux-gnu","linux-arm":"aarch64-unknown-linux-gnu","macos-arm":"universal2-apple-darwin"}')[matrix.target] }} -i ${{ matrix.python-version }} | ||
- name: Build source distribution | ||
if: ${{ matrix.target == 'linux-x86' }} | ||
run: | | ||
pip install --upgrade maturin | ||
maturin build --release -o dist | ||
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/* | ||
macos_build_x86: | ||
name: 'macos-x86' | ||
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 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
- name: Build wheel with Maturin | ||
run: | | ||
pip install --upgrade maturin | ||
maturin build --release -o dist | ||
- name: Pypi Release for macos-latest | ||
run: | | ||
pip install twine | ||
twine upload --skip-existing -u __token__ -p ${{ secrets.PYPI_TOKEN }} dist/* | ||
macos_build_arm: | ||
name: 'macos-arm64' | ||
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++ | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
- name: Build wheel with Maturin | ||
run: | | ||
rustup target add aarch64-apple-darwin | ||
pip install --upgrade maturin | ||
maturin build --release -o dist --target universal2-apple-darwin | ||
- name: Pypi Release for macos-latest | ||
run: | | ||
pip install twine | ||
twine upload --skip-existing -u __token__ -p ${{ secrets.PYPI_TOKEN }} dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
[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]" }, | ||
{ name = "Lazaro Clapp", email = "[email protected]" }, | ||
{ name = "Uber Technologies Inc." }, | ||
] | ||
authors = [{ name = "Uber Technologies Inc." }] | ||
license = "Apache-2.0" | ||
readme = "README.md" | ||
keywords = [ | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe say "Build source distribution (only once)" or add a comment next to the if to say why we are doing this only once.