-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Specify version when publishing to PyPI (#329)
* Fix python wheel classifiers * Specify version when release Python wheel * Trigger the workflow on push * Trigger the workflow on pull request * Test ref names * Testing ref names * Testing ref names * Test again * Fix substitution * Fix format * Don't trigger the workflow on pull request
- Loading branch information
Showing
3 changed files
with
38 additions
and
35 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 |
---|---|---|
@@ -1,37 +1,46 @@ | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
|
||
name: PyPI release | ||
name: Publish 🐍 to PyPI.org | ||
|
||
on: | ||
push: | ||
branches: ["release/*"] | ||
branches: [ main, "release/*" ] | ||
release: | ||
types: [published] | ||
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.8 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --user --upgrade setuptools wheel | ||
- name: Build package | ||
run: python setup.py sdist bdist_wheel | ||
|
||
# We do this, since failures on test.pypi aren't that bad | ||
- name: Publish distribution 📦 to Test PyPI | ||
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
verbose: true | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --user --upgrade setuptools wheel | ||
- name: Build package | ||
run: | | ||
BUILD_VERSION=${GITHUB_REF:11} python setup.py sdist bdist_wheel | ||
ls -lh dist/ | ||
# We do this, since failures on test.pypi aren't that bad | ||
- name: Publish distribution 📦 to Test PyPI | ||
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
verbose: true | ||
|
||
- name: Publish distribution 📦 to PyPI | ||
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
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 |
---|---|---|
@@ -1,6 +1,3 @@ | ||
[bdist_wheel] | ||
universal=1 | ||
|
||
[metadata] | ||
license_file = LICENSE | ||
description-file = README.md | ||
|
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