Skip to content

changed order

changed order #6

# This workflow will build a test version of the package and publish it to TestPyPI for testing
name: Publish to TestPyPI
on:
push:
branches:
- dev_env
jobs:
# Job 1: Build the dist files
build-package:
name: Build dist
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v5
id: setuppython
with:
python-version: '3.x'
- name: Get pip cache dir
id: pip-cache
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: cache dependecies
uses: actions/cache@v4
id: cache
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Poetry
if: steps.cache.outputs.cache-hit != 'true'
run:
python -m pip install --upgrade pip
pip install poetry
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: poetry install
- name: Build package with poetry
run: poetry build
- name: Update package version
run: poetry version patch
- name: Publish package to TestPyPI
run: |
poetry publish -r testpypi --username __token__ --password ${{ secrets.TEST_PYPI_TOKEN }}