-
Notifications
You must be signed in to change notification settings - Fork 7
43 lines (34 loc) · 1.13 KB
/
publish-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Upload Python Package to test.pypi.org
on:
release:
types: [published]
branches:
- main
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://install.python-poetry.org | python -
$HOME/.local/bin/poetry install
- name: Build package
run: $HOME/.local/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/.local/bin/poetry config repositories.test-pypi https://test.pypi.org/legacy/
$HOME/.local/bin/poetry config pypi-token.test-pypi "$TEST_PYPI_API_TOKEN"
- name: Publish package to test.pypi.org
run: |
$HOME/.local/bin/poetry publish -r test-pypi