-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds automatic build and publish workflows (#32)
* made sure build package installs pip and uses the test pypi repo url * corrected init and setup to have a placeholder for version * added workflow for automated publication on release
- Loading branch information
1 parent
17bfce1
commit 17592b3
Showing
4 changed files
with
60 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# This workflows will upload a Python Package using Twine when a release is created | ||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
# from https://github.com/grst/python-ci-versioneer/blob/master/.github/workflows/python-publish.yml | ||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.x" | ||
- name: Autobump version | ||
run: | | ||
# from refs/tags/v1.2.3 get 1.2.3 | ||
VERSION=$(echo $GITHUB_REF | sed 's#.*/v##') | ||
PLACEHOLDER='__version__ = "develop"' | ||
VERSION_FILE='tf_fastmri_data/__init__.py' | ||
# ensure the placeholder is there. If grep doesn't find the placeholder | ||
# it exits with exit code 1 and github actions aborts the build. | ||
grep "$PLACEHOLDER" "$VERSION_FILE" | ||
sed -i "s/$PLACEHOLDER/__version__ = \"${VERSION}\"/g" "$VERSION_FILE" | ||
shell: bash | ||
- name: Build and publish to testpypi | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
run: | | ||
sh build_package.sh | ||
- name: Publish to pypi | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: | | ||
twine upload dist/* |
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,8 @@ | ||
"""Package info""" | ||
|
||
__version__ = "develop" | ||
__author__ = 'Zaccharie Ramzi' | ||
__author_email__ = 'zaccharie.ramzi@gmail.com' | ||
__license__ = 'MIT' | ||
__homepage__ = 'https://github.com/zaccharieramzi/tf-fastmri-data' | ||
__docs__ = 'Data pipelines for the fastMRI dataset in TensorFlow.' |