-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df865e9
commit 826ed43
Showing
1 changed file
with
69 additions
and
0 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,69 @@ | ||
# 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 | ||
|
||
name: Upload Python Package | ||
|
||
on: | ||
push: | ||
tags: | ||
- '**' | ||
|
||
env: | ||
POETRY_VERSION: 1.4.0 | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
# Run on a push to a tag or master | ||
if: > | ||
github.event_name == 'push' && | ||
(startsWith(github.event.ref, 'refs/tags') || | ||
github.event.ref == 'refs/heads/master') | ||
steps: | ||
- name: Set up Python 3 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install latest setuptools, wheel, pip | ||
run: python3 -m pip install -U pip setuptools wheel | ||
|
||
- name: Cache Installations | ||
id: cache-installs | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.local | ||
key: install-${{ env.INSTALL_CACHE_HASH }}-3 | ||
|
||
- name: Install Poetry | ||
if: steps.cache-installs.outputs.cache-hit != 'true' | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - --version ${{ env.POETRY_VERSION }} | ||
- name: Test poetry | ||
run: poetry --version | ||
|
||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Install rfinder | ||
run: poetry install | ||
|
||
- name: Build distribution | ||
run: poetry build | ||
|
||
- name: Publish distribution 📦 to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
continue-on-error: true | ||
|
||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |