Merge pull request #122 from JSchmie/fix-pypi-ci

Fixed pypi.yaml to Trigger on Push for Correct Pre-Release Publishing
This commit is contained in:
Marko Henning
2024-09-10 15:42:36 +02:00
committed by GitHub
+11 -33
View File
@@ -1,18 +1,14 @@
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
on: on:
pull_request_target:
branches:
- develop
types:
- closed
paths:
- scraibe/**
- pyproject.toml
push: push:
tags: tags:
- 'v*.*.*' - 'v*.*.*'
branches:
- "develop"
paths:
- "scraibe/**"
- "pyproject.toml"
workflow_dispatch: workflow_dispatch:
inputs: inputs:
@@ -27,13 +23,7 @@ on:
jobs: jobs:
Build-and-publish-to-Test-PyPI: Build-and-publish-to-Test-PyPI:
if: | if: github.event_name != 'workflow_dispatch' || github.event.inputs.test == 'true'
(github.event_name == 'workflow_dispatch' &&
github.event.inputs.test == 'true') ||
(github.event_name == 'pull_request_target' &&
github.event.pull_request.merged &&
contains(github.event.pull_request.labels.*.name, 'release')) ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -72,28 +62,16 @@ jobs:
needs: Test-PyPi-install needs: Test-PyPi-install
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: | if: |
always() && always() &&
(( needs.Build-and-publish-to-Test-PyPI.result != 'failure' && (( needs.Build-and-publish-to-Test-PyPI.result != 'failure' &&
needs.Test-PyPi-install.result != 'failure' ) && needs.Test-PyPi-install.result != 'failure' ) ||
((github.event_name == 'workflow_dispatch' && ((github.event_name == 'workflow_dispatch' &&
github.event.inputs.publish_to_pypi == 'true') || github.event.inputs.publish_to_pypi == 'true')))
(github.event_name == 'pull_request_target' &&
github.event.pull_request.merged &&
contains(github.event.pull_request.labels.*.name, 'release')) ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))))
steps: steps:
- name: Checkout Repository Tags
uses: actions/checkout@v4
if: github.ref == 'refs/heads/main'
with:
fetch-depth: '0'
branch: 'main'
- name: Checkout Repository (Develop) - name: Checkout Repository (Develop)
uses: actions/checkout@v4 uses: actions/checkout@v4
if: github.ref == 'refs/heads/develop'
with: with:
fetch-depth: '0' fetch-depth: '0'
branch: 'develop'
- name: Set up Poetry 📦 - name: Set up Poetry 📦
uses: JRubics/poetry-publish@v1.16 uses: JRubics/poetry-publish@v1.16
with: with: