-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (37 loc) · 1.21 KB
/
pypi-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
name: pypi-test
on:
push:
tags:
- 'v*'
jobs:
pypi-test:
name: Create Release and Deploy on TestPyPI
runs-on: ubuntu-latest
permissions:
contents: write
steps:
# make use of python & poetry
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install Poetry
run: pip install poetry
# build wheel and sdist
- name: Build Wheel
run: |
poetry build
echo "WHEEL=`ls dist/*.whl`" >> $GITHUB_ENV
# create a new draft release (so we only trigger the deployment pipeline after the draft has been published)
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "$GITHUB_REF_NAME" --title "$GITHUB_REF_NAME" --draft
gh release upload "$GITHUB_REF_NAME" "${{ env.WHEEL }}" --clobber
# release on TestPyPI (for release on regular PyPI, see deploy.yml)
- name: Publish Package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TEST_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/