Skip to content

Commit a654dd5

Browse files
committed
update workflow
1 parent 0b96c66 commit a654dd5

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

.github/workflows/pypi.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,34 @@
1-
name: build an publish
1+
name: 'Build an push to pypi'
22

33
on:
44
push:
5-
branches:
6-
- release
5+
tags:
6+
- "*"
77
workflow_dispatch:
88

99
jobs:
10-
build-and-publish:
11-
name: build an publish
10+
validate-branch:
1211
runs-on: ubuntu-latest
12+
outputs:
13+
branch: ${{ steps.check_step.outputs.branch }}
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Get current branch
21+
id: check_step
22+
run: |
23+
raw=$(git branch -r --contains ${{ github.ref }})
24+
branch=${raw##*/}
25+
echo "branch=$branch" >> $GITHUB_OUTPUT
26+
echo "Commit on branch: $branch."
27+
28+
push-pypi:
29+
runs-on: ubuntu-latest
30+
needs: validate-branch
31+
if: contains(${{ needs.check.outputs.branch }}, 'main')`
1332
steps:
1433
- uses: actions/checkout@v4
1534
- name: Set up Python 3.8

0 commit comments

Comments
 (0)