Skip to content

Commit fcd1c21

Browse files
committed
merged workflows to avoid pypi error on publish
1 parent af017c5 commit fcd1c21

File tree

2 files changed

+18
-40
lines changed

2 files changed

+18
-40
lines changed

.github/workflows/publish.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Create Release
1+
name: Create Release and Publish
22

33
on:
44
workflow_dispatch:
@@ -11,8 +11,10 @@ jobs:
1111
release:
1212
runs-on: ubuntu-latest
1313
if: github.ref == 'refs/heads/master'
14+
environment: pypi
1415
outputs:
1516
version: ${{ steps.changelog.outputs.version }}
17+
released: ${{ steps.check_tag.outputs.exists == 'false' }}
1618

1719
steps:
1820
- name: Checkout code
@@ -60,9 +62,18 @@ jobs:
6062
echo "⚠️ Tag v${{ steps.changelog.outputs.version }} already exists. Skipping release creation."
6163
exit 1
6264
63-
publish:
64-
needs: release
65-
uses: ./.github/workflows/publish.yml
66-
with:
67-
version: ${{ needs.release.outputs.version }}
68-
secrets: inherit
65+
- name: Set up Python
66+
uses: actions/setup-python@v5
67+
with:
68+
python-version: "3.x"
69+
70+
- name: Install dependencies
71+
run: |
72+
python -m pip install --upgrade pip
73+
pip install build
74+
75+
- name: Build package
76+
run: python -m build
77+
78+
- name: Publish to PyPI
79+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)