-
Notifications
You must be signed in to change notification settings - Fork 45
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 variety of platforms using cibuildwheel #109
Conversation
# tags: | ||
# - 'v*' |
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.
On my repos I have this uncommented so that it only runs when I push a newly tagged release.
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.
Just out of curiousity: Is there a reason to use push
instead of the release
event?
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.
I'm not sure when the release
event is called. Does pushing a new tag create a release? Or do you have to make a "release" manually through the Github UI?
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.
My understanding is that it happens when:
- A person manually makes/modifies a release in GitHub (
releases/new
) - Or it is done via the releases API
Docs on the release webhook event
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.
Interesting! I've never researched that before. It just occurred to me you'd likely be able to do the same things with the github cli:
> gh release create --help
Create a new GitHub Release for a repository.
A list of asset files may be given to upload to the new release. To define a
display label for an asset, append text starting with `#` after the file name.
If a matching git tag does not yet exist, one will automatically get created
from the latest state of the default branch. Use `--target` to override this.
To fetch the new tag locally after the release, do `git fetch --tags origin`.
To create a release from an annotated git tag, first create one locally with
git, push the tag to GitHub, then run this command.
USAGE
gh release create <tag> [<files>...]
FLAGS
-d, --draft Save the release as a draft instead of publishing it
-n, --notes string Release notes
-F, --notes-file file Read release notes from file
-p, --prerelease Mark the release as a prerelease
--target branch Target branch or full commit SHA (default: main branch)
-t, --title string Release title
INHERITED FLAGS
--help Show help for command
-R, --repo [HOST/]OWNER/REPO Select another repository using the [HOST/]OWNER/REPO format
EXAMPLES
Interactively create a release
$ gh release create v1.2.3
Non-interactively create a release
$ gh release create v1.2.3 --notes "bugfix release"
Use release notes from a file
$ gh release create v1.2.3 -F changelog.md
Upload all tarballs in a directory as release assets
$ gh release create v1.2.3 ./dist/*.tgz
Upload a release asset with a display label
$ gh release create v1.2.3 '/path/to/asset.zip#My display label'
LEARN MORE
Use 'gh <command> <subcommand> --help' for more information about a command.
Read the manual at https://cli.github.com/manual
# upload_pypi: | ||
# needs: [build_wheels, build_sdist] | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/download-artifact@v2 | ||
# with: | ||
# name: artifact | ||
# path: dist | ||
# | ||
# - uses: pypa/gh-action-pypi-publish@master | ||
# with: | ||
# user: __token__ | ||
# password: ${{ secrets.PYPI_PASSWORD }} | ||
# # To test: repository_url: https://test.pypi.org/legacy/ |
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.
This will automatically push a new release to PyPI if uncommented. You need to add an api token for this specific PyPI project to Github Actions' secrets.
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.
@kylebarron This looks really cool. ✨ I think this is good enough to merge for now. I'll probably end up customizing it a bit to add some additional checks and/or triggers, but this is a great starting point for me. 😍
Thanks for doing this (especially bringing cibuildwheel
to my attention. It seems like a much better solution than using manylinux
directly. 🙌 🙇
Yeah I expected that you'd want to customize this a bit. |
I just came across this project and saw #25. I've set up building wheels on CI for a variety of projects so figured I'd send over a quick PR. This PR provides a working demo of using
cibuildwheel
to build wheels on CI for a matrix of Python 3.6 through 3.9, PyPy, CPython, Windows, Linux, Mac, and Mac ARM.Example output from this Github Actions run: artifact.zip (you can only download output if it's your own repo I think)
Contains these files:
Notes:
cibuildwheel
was somewhat recently added to thepypa
organization, so it's likely to be well maintained into the future.pip install ./abc.whl
.Ref: #97