updated conditon to be triggert on.
Adjusted if conditions of jobs
This commit is contained in:
+34
-13
@@ -1,24 +1,35 @@
|
|||||||
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
|
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request_target:
|
||||||
types: [closed]
|
|
||||||
branches:
|
branches:
|
||||||
- develop
|
- develop
|
||||||
- main
|
types:
|
||||||
|
- closed
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*.*.*'
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
job:
|
test:
|
||||||
description: "Select job to run"
|
description: "Run tests"
|
||||||
required: true
|
default: true
|
||||||
type: choice
|
type: boolean
|
||||||
options:
|
publish_to_pypi:
|
||||||
- Build-and-publish-to-Test-PyPI
|
description: "Publish to PyPI"
|
||||||
- test-install
|
default: false
|
||||||
- publish-to-pypi
|
type: boolean
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Build-and-publish-to-Test-PyPI:
|
Build-and-publish-to-Test-PyPI:
|
||||||
|
if: |
|
||||||
|
(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
|
||||||
@@ -32,7 +43,7 @@ jobs:
|
|||||||
repository_name: "scraibe"
|
repository_name: "scraibe"
|
||||||
repository_url: "https://test.pypi.org/legacy/"
|
repository_url: "https://test.pypi.org/legacy/"
|
||||||
|
|
||||||
test-install:
|
Test-PyPi-install:
|
||||||
name: Test Installation from TestPyPI
|
name: Test Installation from TestPyPI
|
||||||
needs: Build-and-publish-to-Test-PyPI
|
needs: Build-and-publish-to-Test-PyPI
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -54,8 +65,18 @@ jobs:
|
|||||||
|
|
||||||
publish-to-pypi:
|
publish-to-pypi:
|
||||||
name: Publish to PyPI
|
name: Publish to PyPI
|
||||||
needs: test-install
|
needs: Test-PyPi-install
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: |
|
||||||
|
always() &&
|
||||||
|
(( needs.Build-and-publish-to-Test-PyPI.result != 'failure' &&
|
||||||
|
needs.Test-PyPi-install.result != 'failure' ) &&
|
||||||
|
((github.event_name == 'workflow_dispatch' &&
|
||||||
|
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
|
- name: Checkout Repository Tags
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|||||||
Reference in New Issue
Block a user