Skip to content

Commit 214fccc

Browse files
committed
updated push to pypi if a new tag was pushed
1 parent c1eee71 commit 214fccc

1 file changed

Lines changed: 4 additions & 18 deletions

File tree

.github/workflows/build_test_publish.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ on:
44
push:
55
branches:
66
- '*'
7-
7+
tags:
8+
- '*'
89
jobs:
910
tox:
1011
name: Run Tox python-${{ matrix.version }}
@@ -36,28 +37,13 @@ jobs:
3637
- name: Run tox checks
3738
run: tox
3839

39-
check_branch:
40-
name: Check if the current branch is able to upload to PYPI
41-
runs-on: ubuntu-24.04
42-
43-
needs: tox
44-
45-
outputs:
46-
is_main: ${{ steps.check.outputs.is_main }}
47-
48-
steps:
49-
- name: check is main
50-
id: check
51-
# from: https://stackoverflow.com/questions/60589373/how-to-force-job-to-exit-in-github-actions-step
52-
run: echo "is_main=${{ github.ref == 'refs/heads/main' }}" >> $GITHUB_OUTPUT
53-
5440
publish:
5541
name: Upload package to PYPI
5642
runs-on: ubuntu-24.04
5743

58-
needs: check_branch
44+
needs: tox
5945

60-
if: needs.check_branch.outputs.is_main == 'true'
46+
if: startsWith(github.ref, 'refs/tags/')
6147

6248
environment:
6349
name: pypi

0 commit comments

Comments
 (0)