-
Notifications
You must be signed in to change notification settings - Fork 56
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
Move release pipeline to a separate file | chore(release) #619
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a9c61e9
Move release pipeline to a separate file | chore(release)
justinchuby d71391d
Update release.yaml
justinchuby 9a8c433
Update release.yaml
justinchuby 9f6fc94
Update release.yaml
justinchuby e72df7a
Update requirements-dev.txt
justinchuby 167334e
Update release.yaml
justinchuby 1c47ff7
Update release.yaml
justinchuby 2019773
Merge branch 'main' into justinchu/release
justinchuby 05c37b9
Pin version
justinchuby 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 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,82 @@ | ||
name: Release | ||
|
||
on: | ||
schedule: | ||
# Run weekly on Mondays and Wednesdays 00:00 | ||
- cron: '00 00 * * MON,WED' | ||
push: | ||
branches: [main, rel-*] | ||
pull_request: | ||
branches: [main, rel-*] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
if: github.event_name != 'pull_request' || startsWith( github.base_ref, 'rel-') || contains( github.event.pull_request.labels.*.name, 'run release CIs') | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.10'] | ||
steps: | ||
- name: Checkout ONNX Script | ||
uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Python build dependencies | ||
run: | | ||
python -m pip install --upgrade pip build wheel | ||
- name: Build ONNX Script wheel dev version | ||
run: | | ||
python -m build | ||
if: (!(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))) | ||
- name: Build ONNX Script wheel release version | ||
run: | | ||
python -m build | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
env: | ||
ONNX_SCRIPT_RELEASE: 1 | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: dist | ||
- name: Install ONNX Script wheel | ||
run: | | ||
python -m pip install dist/*.whl | ||
|
||
publish-dev: | ||
needs: [release] | ||
runs-on: ubuntu-latest | ||
environment: PyPI Dev | ||
# Publish only when it is a scheduled run (dev builds) | ||
if: github.event_name == 'schedule' && !startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
# TODO: Check the version number is a dev version | ||
- name: Publish dev version to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
publish-release: | ||
needs: [release] | ||
runs-on: ubuntu-latest | ||
environment: PyPI | ||
# Publish only when it is a tag push with version number | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
# TODO: Check the tag name matches the VERSION file | ||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
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.
Different environments are used here