-
Notifications
You must be signed in to change notification settings - Fork 7
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
Showing
1 changed file
with
41 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,41 @@ | ||
name: Upload Python Package to test.pypi.org | ||
|
||
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.8" | ||
|
||
- name: Install dependencies | ||
run: | | ||
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - | ||
$HOME/.poetry/bin/poetry install | ||
- name: Build package | ||
run: $HOME/.poetry/bin/poetry build | ||
|
||
- name: Setup Test PyPI in poetry | ||
env: | ||
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
run: | | ||
touch $HOME/.pypirc | ||
echo "[testpypi]" >> $HOME/.pypirc | ||
echo " username = __token__" >> $HOME/.pypirc | ||
echo " password = $TEST_PYPI_API_TOKEN" >> $HOME/.pypirc | ||
$HOME/.poetry/bin/poetry config repositories.test-pypi https://test.pypi.org/legacy/ | ||
$HOME/.poetry/bin/poetry config pypi-token.test-pypi "$TEST_PYPI_API_TOKEN" | ||
- name: Publish package to test.pypi.org | ||
run: | | ||
$HOME/.poetry/bin/poetry publish -r test-pypi | ||