-
Notifications
You must be signed in to change notification settings - Fork 21
Add a [reusable] workflow for building wheels #42
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
Open
peytondmurray
wants to merge
12
commits into
google:master
Choose a base branch
from
peytondmurray:30-build-workflow
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b485d4f
Add a [reusable] workflow for building wheels
peytondmurray 4baf81c
Address review comments
peytondmurray 6402903
Address review comments
peytondmurray 24c5330
Merge remote-tracking branch 'upstream/master' into 30-build-workflow
smokestacklightnin 688942e
Add missing parentheses in workflow
smokestacklightnin 96ec2d8
Remove `pkginfo` from workflow
smokestacklightnin 5fe71b8
Use `cibuildwheel` instead of `manylinux` image
smokestacklightnin 3db7b79
Install `cibuildhweel` before using it
smokestacklightnin 3a7c8f3
Move composite workflow to `actions` directory
smokestacklightnin 5cf0ce0
Use `cibuildwheel` action with config in `pyproject.toml`
smokestacklightnin 45ffc58
Fix typo in wheel name
smokestacklightnin 6cc4637
Merge remote-tracking branch 'upstream/master' into 30-build-workflow
smokestacklightnin 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 hidden or 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,20 @@ | ||
name: Reusable action which builds struct2tensor | ||
|
||
inputs: | ||
python-version: | ||
description: 'Python version' | ||
required: true | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Build the package for Python ${{ inputs.python-version }} | ||
uses: pypa/[email protected] | ||
with: | ||
output-dir: dist | ||
|
||
- name: Upload wheel artifact for Python ${{ inputs.python-version }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: struct2tensor-py${{ inputs.python-version }} | ||
path: dist/*.whl | ||
if-no-files-found: error |
This file contains hidden or 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,68 @@ | ||
name: Build struct2tensor wheels | ||
|
||
on: | ||
pull_request: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Build package | ||
id: build-package | ||
uses: ./.github/actions/reusable-build | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: List and check wheels | ||
shell: bash | ||
run: | | ||
pip install twine | ||
ls -lh dist/ | ||
twine check dist/* | ||
|
||
upload_to_pypi: | ||
name: Upload to PyPI | ||
runs-on: ubuntu-latest | ||
if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch') | ||
needs: [build] | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/struct2tensor/ | ||
permissions: | ||
id-token: write | ||
contents: read | ||
attestations: write | ||
steps: | ||
- name: Retrieve wheels | ||
uses: actions/download-artifact@v4 | ||
with: | ||
merge-multiple: true | ||
path: wheels | ||
|
||
- name: List the build artifacts | ||
run: | | ||
ls -lAs wheels/ | ||
|
||
peytondmurray marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Generate artifact attestations for wheels | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-path: "wheels/*" | ||
|
||
- name: Upload to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
packages_dir: wheels/ |
This file contains hidden or 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,8 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools", | ||
"wheel", | ||
] | ||
|
||
[tool.cibuildwheel] | ||
environment = { TF_VERSION="RELEASED_TF_2" } |
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.
Uh oh!
There was an error while loading. Please reload this page.