Skip to content

Commit 1b881fb

Browse files
authored
Fix release pipeline (#1232)
1 parent bc952a0 commit 1b881fb

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
name: release
22

33
on:
4-
workflow_call:
5-
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callinputs
6-
inputs:
7-
pypi:
8-
description: Publish to PyPI registry
9-
default: false
10-
type: boolean
4+
release:
5+
types: [published]
116

127
jobs:
138
pypi:
149
name: Publish to PyPI registry
15-
if: "${{ inputs.pypi }}"
1610
environment: release
1711
runs-on: ubuntu-20.04
1812

@@ -23,7 +17,6 @@ jobs:
2317
TOX_PARALLEL_NO_SPINNER: 1
2418

2519
steps:
26-
2720
- name: Switch to using Python 3.8 by default
2821
uses: actions/setup-python@v2
2922
with:
@@ -44,12 +37,16 @@ jobs:
4437
run: python -m tox
4538

4639
- name: Publish to test.pypi.org
40+
if: >- # "create" workflows run separately from "push" & "pull_request"
41+
github.event_name == 'release'
4742
uses: pypa/gh-action-pypi-publish@master
4843
with:
4944
password: ${{ secrets.testpypi_password }}
5045
repository_url: https://test.pypi.org/legacy/
5146

5247
- name: Publish to pypi.org
48+
if: >- # "create" workflows run separately from "push" & "pull_request"
49+
github.event_name == 'release'
5350
uses: pypa/gh-action-pypi-publish@master
5451
with:
5552
password: ${{ secrets.pypi_password }}

0 commit comments

Comments
 (0)