Skip to content

specify test-pypi repository (versus default pypi) #18

specify test-pypi repository (versus default pypi)

specify test-pypi repository (versus default pypi) #18

Workflow file for this run

name: CI Workflows
on:
push:
branches: ["main"]
tags:
- "v*"
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Stuff Goes Here In The Future
run: echo "black, isort, flake8, mypy still to come..."
build_and_publish:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [lint]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Extract Version from Tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Install poetry
run: pip install poetry
- name: Install Dependencies
run: poetry install
- name: Update project.toml Version
run: poetry version $VERSION
- name: Build and Publish
env:
TEST_PYPI_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
run: |
poetry config pypi-token.test-pypi $TEST_PYPI_TOKEN
poetry config repositories.test-pypi https://test.pypi.org/legacy/
poetry publish --build --repository test-pypi