-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (32 loc) · 1.1 KB
/
pre-release.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
# This workflow will install Poetry, resolve Python dependencies, run tests,
# build and publish release candidate package versions to TestPyPI upon pushing
# tags of the form "*.*.*".
name: Publish to TestPyPI
on:
push:
tags:
- "*.*.*"
jobs:
TestPyPI-Release:
name: Build Using Poetry and Publish to TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install Poetry
run: |
# Run the installer
curl -sSL https://install.python-poetry.org | python3 -
# Add Poetry to path
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install
- name: Run tests
run: poetry run pytest
- name: Publish package to TestPyPI
run: |
# Configure the TestPyPI repository
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_API_TOKEN }}
# Build the and publish the package
poetry publish --build -r testpypi