-
Notifications
You must be signed in to change notification settings - Fork 893
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wheels: convert versions to match pypa spec, add uploading
* wheel versions now replace `+` with `.post` to match spec at https://packaging.python.org/en/latest/specifications/version-specifiers/ * CI updates: * Bump action versions * Disabled Windows for now and documented why * Added a new job to upload all wheels * Added new variable, `PYPI_INDEX`: fallback 'https://pypi.org/' if unset * Added new secret, `PYPI_TOKEN` * .editorconfig now uses 2 spaces for YML (it kept setting mine to tabs and GitHub Actions doesn't like that)
- Loading branch information
Showing
3 changed files
with
40 additions
and
15 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,8 +1,7 @@ | ||
name: Build Wheels for PyPI | ||
on: | ||
workflow_dispatch: | ||
push: | ||
# tags: ["yosys-*"] | ||
|
||
jobs: | ||
build_wheels: | ||
strategy: | ||
|
@@ -37,24 +36,27 @@ jobs: | |
runner: "macos-14", | ||
archs: "arm64", | ||
}, | ||
{ | ||
name: "Windows Server 2019", | ||
family: "windows", | ||
runner: "windows-2019", | ||
archs: "AMD64", | ||
}, | ||
## Windows is disabled because of an issue with compiling FFI as | ||
## under MinGW in the GitHub Actions environment (SHELL variable has | ||
## whitespace.) | ||
# { | ||
# name: "Windows Server 2019", | ||
# family: "windows", | ||
# runner: "windows-2019", | ||
# archs: "AMD64", | ||
# }, | ||
] | ||
name: Build Wheels | ${{ matrix.os.name }} | ${{ matrix.os.archs }} | ||
runs-on: ${{ matrix.os.runner }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: true | ||
- if: ${{ matrix.os.family == 'linux' }} | ||
name: "[Linux] Set up QEMU" | ||
uses: docker/setup-qemu-action@v2 | ||
- uses: actions/setup-python@v3 | ||
uses: docker/setup-qemu-action@v3 | ||
- uses: actions/setup-python@v5 | ||
- name: Get Boost Source | ||
shell: bash | ||
run: | | ||
|
@@ -73,7 +75,7 @@ jobs: | |
brew install flex bison | ||
echo "PATH=$(brew --prefix flex)/bin:$PATH" >> $GITHUB_ENV | ||
echo "PATH=$(brew --prefix bison)/bin:$PATH" >> $GITHUB_ENV | ||
- if : ${{ matrix.os.family == 'windows' }} | ||
- if: ${{ matrix.os.family == 'windows' }} | ||
name: "[Windows] Flex/Bison" | ||
run: | | ||
choco install winflexbison3 | ||
|
@@ -86,7 +88,7 @@ jobs: | |
uses: pypa/[email protected] | ||
env: | ||
# * APIs not supported by PyPy | ||
# * Musllinux temporarily disabled because it takes too much time | ||
# * Musllinux disabled because it increases build time from 48m to ~3h | ||
CIBW_SKIP: > | ||
pp* | ||
*musllinux* | ||
|
@@ -109,6 +111,25 @@ jobs: | |
makeFlags='BOOST_PYTHON_LIB=./boost/pfx/lib/libboost_python*.a CONFIG=clang' | ||
CIBW_BEFORE_BUILD: bash ./.github/workflows/wheels/cibw_before_build.sh | ||
CIBW_TEST_COMMAND: python3 -c "from pyosys import libyosys as ys;d=ys.Design();ys.run_pass('help', d)" | ||
- uses: actions/upload-artifact@v3 | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-wheels | ||
path: ./wheelhouse/*.whl | ||
upload_wheels: | ||
name: Upload Wheels | ||
runs-on: ubuntu-latest | ||
needs: build_wheels | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: python-wheels | ||
path: "." | ||
- run: | | ||
ls | ||
mkdir -p ./dist | ||
mv *.whl ./dist | ||
- name: Publish | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
repository-url: ${{ vars.PYPI_INDEX || 'https://upload.pypi.org/legacy/' }} |
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