Skip to content

Merge pull request #114 from smkent/manage-cookie #9

Merge pull request #114 from smkent/manage-cookie

Merge pull request #114 from smkent/manage-cookie #9

Workflow file for this run

---
name: Release
env:
ENABLE_PYPI_PUBLISH: true
ENABLE_TEST_PYPI_PUBLISH: true
RELEASE_PYTHON_VERSION: "3.12"
RELEASE_POETRY_VERSION: "2.0"
on:
push:
tags:
- '*'
jobs:
Publish:
name: Publish package for ${{ github.ref_name }}
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/Cookiecutter template for new Python projects
permissions:
id-token: write
steps:
- name: πŸ’Ύ Check out repository
uses: actions/checkout@v4
- name: πŸ“œ Fetch full repository history for unit tests
run: git fetch --unshallow
- name: 🐍 Set up Python project with Poetry
uses: ./.github/workflows/actions/python-poetry
with:
python_version: ${{ env.RELEASE_PYTHON_VERSION }}
poetry_version: ${{ env.RELEASE_POETRY_VERSION }}
- name: πŸ”₯ Test
run: poetry run poe test
- name: πŸš’ Create test summary
uses: test-summary/action@v1
if: success() || failure()
with:
paths: ./.pytest_results.xml
- name: πŸ“¦ Build package
if: |
env.ENABLE_PYPI_PUBLISH == 'true'
|| env.ENABLE_TEST_PYPI_PUBLISH == 'true'
run: poetry build
- name: πŸ”Ό Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ env.ENABLE_TEST_PYPI_PUBLISH == 'true' }}
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
- name: ☒️ Publish to PyPI
if: ${{ env.ENABLE_PYPI_PUBLISH == 'true' }}
uses: pypa/gh-action-pypi-publish@release/v1
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false