Skip to content

Commit af877df

Browse files
committed
Replaced on.workflow_dispatch w/ release.types, used github.event.reease.tag_name, deleted echos
1 parent 001cab1 commit af877df

1 file changed

Lines changed: 7 additions & 13 deletions

File tree

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
name: Publish to PyPI on new release
22

33
on:
4-
workflow_dispatch:
4+
release:
5+
types: [published, edited]
56

67
jobs:
78
publish:
8-
if: ${{ startsWith(github.ref, 'refs/tags/ai-personas') == false }}
9+
if: ${{ startsWith(github.event.release.tag_name, 'ai-personas') == false }}
910
runs-on: ubuntu-24.04
1011
permissions:
1112
id-token: write
@@ -15,22 +16,15 @@ jobs:
1516
- uses: actions/setup-python@v6.2.0
1617
with:
1718
python-version: 3.x
18-
- id: project
19-
run: |
20-
git fetch --tags
21-
TAG=$(git describe --tags --abbrev=0)
22-
echo "The tag is: $TAG"
23-
PROJECT=$(echo "$TAG" | sed -E 's/-[0-9]+(\.[0-9]+)+$//')
19+
- run: |
20+
TAG="${{ github.event.release.tag_name }}"
21+
PROJECT="${TAG%-*}"
2422
echo "PROJECT=$PROJECT" >> $GITHUB_ENV
25-
echo "Project directory is: $PROJECT"
2623
- run: pip install build
2724
- run: |
28-
echo "Current directory:"
2925
pwd
30-
echo "Listing contents of the directory"
3126
ls -la
3227
cd ${{ env.PROJECT }} && python -m build
33-
- name: Publish to PyPI
34-
uses: pypa/gh-action-pypi-publish@release/v1.14
28+
- uses: pypa/gh-action-pypi-publish@release/v1.14
3529
with:
3630
packages-dir: ${{ env.PROJECT }}/dist

0 commit comments

Comments
 (0)