This repository was archived by the owner on Sep 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
Add wheel release workflow #238
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
a18c7bb
Set tfx upper limit to <2.0.0 (#1)
codesue a1e94fb
Create wheel-in-release.yml
calvinleungyk 3dabc54
Add files to build wheel on release
calvinleungyk b9310fe
Remove unnecessary files
calvinleungyk 5523791
Delete wheel-in-release.yml
calvinleungyk 8b4c004
Delete wheel-in-release.yml
calvinleungyk 99b2725
add workflows
calvinleungyk c0bfa32
Merge
calvinleungyk f450c39
move package config into dir
calvinleungyk e1b4f71
Merge pull request #225 from twitter-forks/calvinleungyk/add-package-…
codesue 78c84cd
Revert changes to setup.py
codesue c564e24
Add build steps to publish wheels to PyPI and test PyPI
codesue 5497bfb
Bump version to 1.3.3
codesue ce183b4
Trigger wheel release workflow on push
codesue bd23ce0
Test release workflow
codesue b38594d
Temp trigger release workflow on pr for testing
codesue 6844bf9
Revert changes to release workflow after testing
codesue 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,14 @@ | ||
| ## Description | ||
|
|
||
| <!-- Please describe what you changed and why. --> | ||
|
|
||
| Fixes [issue link] | ||
|
|
||
| ## Checklist | ||
|
|
||
| Before submitting a pull request, please be sure to do the following: | ||
| - [ ] Read the [How to Contribute guide](https://github.com/tensorflow/model-card-toolkit/blob/master/CONTRIBUTING.md) | ||
| if this is your first contribution. | ||
| - [ ] Open an issue to discuss this change. | ||
| - [ ] Update documentation if applicable. | ||
| - [ ] Write new tests if applicable. |
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,24 @@ | ||
| name: Cherry pick | ||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
| jobs: | ||
| cherry-pick: | ||
| name: Cherry Pick | ||
| # Only cherry pick if user is a release manager | ||
| # NB(gcasassaez): We unfortunately have to use fromJSON as GitHub doesn't have a way to specify constant arrays | ||
| # See: https://github.community/t/passing-an-array-literal-to-contains-function-causes-syntax-error/17213/3 | ||
| if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/cherry-pick') && contains(fromJson('["casassg", "hanneshapke", "codesue"]'), github.event.sender.login) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
|
|
||
| - name: Checkout the latest code | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| fetch-depth: 0 # otherwise, you will fail to push refs to the dest repo | ||
|
|
||
| - name: Automatic cherry pick | ||
| uses: vendoo/gha-cherry-pick@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,53 @@ | ||
| name: Release Model Card Toolkit package to PyPI and TestPyPI | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - 'model_card_toolkit/**' | ||
| - 'setup.py' | ||
| branches: | ||
| - master | ||
| - r* | ||
| release: | ||
| types: [published] | ||
| tags: | ||
| - v* | ||
|
|
||
| jobs: | ||
| build-and-publish: | ||
| name: Build Model Card Toolkit package and release to PyPI and Test PyPI | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: gcr.io/tfx-oss-public/tfx_base:py37-20200729 | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| - name: Build wheel | ||
| run: | | ||
| bash -x package_build/initialize.sh; \ | ||
| CFLAGS=$(/usr/bin/python-config --cflags) \ | ||
| python package_build/model-card-toolkit/setup.py bdist_wheel; \ | ||
| MCT_WHEEL=$(find dist -name 'model_card_toolkit-*.whl'); \ | ||
| - name: Publish Model Card Toolkit distribution package to Test PyPI | ||
| uses: pypa/gh-action-pypi-publish@v1.5.0 | ||
| with: | ||
| password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
codesue marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| repository_url: https://test.pypi.org/legacy/ | ||
| skip_existing: true | ||
|
|
||
| - name: Publish Model Card Toolkit distribution package to PyPI | ||
| if: github.event_name == 'release' | ||
| uses: pypa/gh-action-pypi-publish@v1.5.0 | ||
| with: | ||
| password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
|
||
| - name: Upload files to a GitHub release | ||
| uses: svenstaro/upload-release-action@2.2.1 | ||
| if: github.event_name == 'release' | ||
| with: | ||
| repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
| file: dist/* | ||
| tag: ${{ github.ref }} | ||
| overwrite: true | ||
| file_glob: true | ||
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
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
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.
@codesue This is very nit, so apologies. Do we need to the
tfx-baseimage here?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 image was convenient because it has the right versions of the tools need to build the wheel, e.g. bazel. It's used to build tfx wheels, which have similar build steps.
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.
Ah, perfect! Thank you for the explanation @codesue!