-
Notifications
You must be signed in to change notification settings - Fork 228
Migrate PyPI release to GitHub Actions #679
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f97de80
Migrate PyPI release to GitHub Actions
seisman 56b66b4
Fetch all commit history
seisman 0632e74
Merge branch 'master' into pypi-action
seisman a51bdc6
Update .github/workflows/publish-to-pypi.yml
seisman 8d39c36
Remove PyPI release job from Travis CI
seisman 7f2d438
Update the workflow
seisman bbb581e
Merge branch 'master' into pypi-action
seisman 9d6212c
Enable the workflow for pushes to master branch
seisman 212134e
Update MAINTENANCE.md
seisman 35d01ad
Update .github/workflows/publish-to-pypi.yml
seisman 89bdac1
Update MAINTENANCE.md
seisman f9ec676
Disable the workflow for pull requests
seisman 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,65 @@ | ||
# Publish archives to PyPI and TestPyPI using GitHub Actions | ||
|
||
name: Publish to PyPI | ||
|
||
# Only run for pushes to the master branch and releases. | ||
on: | ||
push: | ||
branches: | ||
- master | ||
release: | ||
types: | ||
- published | ||
# Runs for pull requests should be disabled other than for testing purposes | ||
#pull_request: | ||
# branches: | ||
# - master | ||
|
||
jobs: | ||
publish-pypi: | ||
name: Publish to PyPI | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
# fecth all history so that versioneer works | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install dependencies | ||
run: python -m pip install setuptools wheel | ||
|
||
- name: Fix up version string | ||
run: | | ||
# Change the versioneer format to "pre" so that the commit hash isn't | ||
# included (PyPI doesn't allow it). Can't do this permanently because | ||
# we rely on the hash to tell the tests that this is a local version | ||
# instead of a published version. | ||
# | ||
# The step is only necessary for testing purpose | ||
sed --in-place "s/pep440/pep440-pre/g" setup.cfg | ||
|
||
- name: Build source and wheel distributions | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
echo "" | ||
echo "Generated files:" | ||
ls -lh dist/ | ||
|
||
- name: Publish to Test PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
password: ${{ secrets.test_pypi_password }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
|
||
- name: Publish to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/[email protected] | ||
with: | ||
password: ${{ secrets.pypi_password }} |
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
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.