Skip to content

Commit

Permalink
Create publish-test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nowke authored Jan 1, 2022
1 parent 80e618a commit 6e4fa0a
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/publish-test.yml
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

0 comments on commit 6e4fa0a

Please sign in to comment.