Skip to content

Commit 576f101

Browse files
author
Sergio Soto
committed
build: updates workflows
1 parent 0c0c1bf commit 576f101

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

.github/workflows/publish.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,15 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v4
2121

22+
- name: Debug workflow context
23+
run: |
24+
echo "Event name: ${{ github.event_name }}"
25+
echo "Event action: ${{ github.event.action }}"
26+
echo "Publish to PyPI input: ${{ inputs.publish_to_pypi }}"
27+
echo "Release published: ${{ github.event_name == 'release' && github.event.action == 'published' }}"
28+
2229
- name: Set up Python
23-
uses: actions/setup-python@v4
30+
uses: actions/setup-python@v5
2431
with:
2532
python-version: "3.x"
2633

@@ -33,14 +40,14 @@ jobs:
3340
run: python -m build
3441

3542
- name: Upload distribution artifacts
36-
uses: actions/upload-artifact@v3
43+
uses: actions/upload-artifact@v4
3744
with:
3845
name: python-package-distributions
3946
path: dist/
4047

4148
publish-to-pypi:
4249
name: Publish to PyPI
43-
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_to_pypi == 'true')
50+
if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' && inputs.publish_to_pypi == true)
4451
needs: build
4552
runs-on: ubuntu-latest
4653

@@ -49,7 +56,7 @@ jobs:
4956

5057
steps:
5158
- name: Download distribution artifacts
52-
uses: actions/download-artifact@v3
59+
uses: actions/download-artifact@v4
5360
with:
5461
name: python-package-distributions
5562
path: dist/
@@ -59,7 +66,7 @@ jobs:
5966

6067
publish-to-testpypi:
6168
name: Publish to TestPyPI
62-
if: github.event_name == 'workflow_dispatch' && github.event.inputs.publish_to_pypi == 'false'
69+
if: github.event_name == 'workflow_dispatch' && inputs.publish_to_pypi == false
6370
needs: build
6471
runs-on: ubuntu-latest
6572

@@ -68,7 +75,7 @@ jobs:
6875

6976
steps:
7077
- name: Download distribution artifacts
71-
uses: actions/download-artifact@v3
78+
uses: actions/download-artifact@v4
7279
with:
7380
name: python-package-distributions
7481
path: dist/

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
token: ${{ secrets.GITHUB_TOKEN }}
2222

2323
- name: Set up Python
24-
uses: actions/setup-python@v4
24+
uses: actions/setup-python@v5
2525
with:
2626
python-version: "3.x"
2727

0 commit comments

Comments
 (0)