-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(release): update pypi packaging (#604)
* feat: first pass at new packaging * fix: skip pypy3.9 * fix: add wildcard on pp39 * fix: no pypy * fix: add in separate publish step * fix: update requirements.txt * fix: pipe * fix: ls first * fix: wheelhouse * fix: change the name * fix: download all artifacts * fix: update tool.setuptools * fix: split the pypi and asset building * fix: use CODECOV_ENV * fix: do some more jiggling * fix: remove log * fix: make it a file * fix: maybe like this * fix: remove setup.py cases * fix: show all files * fix: add push tags * Update pyproject.toml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]> * fix: address some comments * fix: more comments * fix: versioning * fix: versioning * fix: remove dynamic * fix: change pattern * fix: update the patterns * fix: dist/ * fix: just dist * fix: ls * fix: oops * fix: whats in the dist * fix: how about wildcard now * fix: now with codecov * fix: hack it * fix: use steps * fix: address comments * fix: add env to cibuildwheel * fix: formatting * fix: nope * fix: try with manifest * fix: address comments * Update .github/workflows/create_release.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]> * Update pyproject.toml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]> * Update .github/workflows/build_for_pypi.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]> * Update .github/workflows/build_for_pypi.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]> --------- Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
- Loading branch information
1 parent
781d11f
commit 1bd492c
Showing
15 changed files
with
214 additions
and
159 deletions.
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
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,47 +1,87 @@ | ||
--- | ||
name: Build and Optionally Publish to PyPi | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
publish: | ||
type: boolean | ||
default: false | ||
description: "Publish to PyPi" | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
# Pattern matched against refs/tags | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
build_for_pypi: | ||
build_src_for_pypi: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write # This is required for requesting the JWT | ||
contents: read # This is required for actions/checkout | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
submodules: true | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
python setup.py build | ||
python setup.py develop | ||
- name: Build distributions for different platforms | ||
pip install build | ||
- name: Build src dist | ||
run: | | ||
pip install wheel | ||
python setup.py sdist bdist_wheel --plat-name=manylinux2014_x86_64 | ||
python setup.py bdist_wheel --plat-name=macosx-12.6-universal2 | ||
python setup.py bdist_wheel --plat-name=win_amd64 | ||
- name: Move src file to match PEP625 | ||
python -m build --sdist | ||
env: | ||
PIP_CONSTRAINT: requirements.txt | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-sdist | ||
path: ./**/*.tar.gz | ||
|
||
build_dist_for_pypi: | ||
needs: | ||
- build_src_for_pypi | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- macos-13 | ||
- macos-latest | ||
- ubuntu-24.04-arm | ||
- ubuntu-latest | ||
- windows-latest | ||
steps: | ||
- name: Download the sdist | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: cibw-sdist | ||
- name: Get sdist filename | ||
id: get-sdist | ||
run: | | ||
cd dist | ||
ls | grep *.tar.gz | xargs -I x mv -- x "$(ls | grep *.tar.gz | sed 's/codecov-cli/codecov_cli/')" | ||
ls -al | ||
cd .. | ||
echo "sdist_filename=$(ls dist/)" >> "${GITHUB_OUTPUT}" | ||
shell: bash | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
with: | ||
package-dir: dist/${{ steps.get-sdist.outputs.sdist_filename }} | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-wheels-${{ matrix.os }} | ||
path: ./wheelhouse/*.whl | ||
|
||
|
||
publish_to_pypi: | ||
if: github.ref_type == 'tag' | ||
needs: | ||
- build_dist_for_pypi | ||
- build_src_for_pypi | ||
permissions: | ||
id-token: write # This is required for OIDC | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/codecov-cli | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: cibw-* | ||
- name: Publish package to PyPi | ||
if: inputs.publish == true | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
attestations: false | ||
verbose: true |
This file was deleted.
Oops, something went wrong.
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
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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[tool.pip-tools] | ||
all-build-deps = true | ||
all-extras = true |
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,2 +1,3 @@ | ||
include languages/treesitterjavascript/src/tree_sitter/parser.h | ||
include languages/treesitterpython/src/tree_sitter/parser.h | ||
include requirements.txt |
Oops, something went wrong.