Skip to content

[main]: added publish workflow #1

[main]: added publish workflow

[main]: added publish workflow #1

Workflow file for this run

name: Publish to TestPyPI
on:
push:
branches:
- main
env:
REPO_ALIAS: rz-sample
TEST_PYPI_URL: https://test.pypi.org/legacy/
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Configure Poetry for TestPyPI
run: |
# Use the variables defined in the 'env' section
poetry config repositories.${{ env.REPO_ALIAS }} ${{ env.TEST_PYPI_URL }}
poetry config pypi-token.${{ env.REPO_ALIAS }} ${{ secrets.TEST_PYPI_TOKEN }}
- name: Build and Publish
run: |
# Automatically uses the alias for the -r flag
poetry publish -r ${{ env.REPO_ALIAS }} --build