Skip to content

Commit f77d03b

Browse files
committed
fix: complete publish job in release workflow with build and TestPyPI steps
- Add missing Python setup and Poetry installation in publish job - Add poetry build step to create wheel and source distribution - Add TestPyPI publishing with proper repository configuration - Fix semantic-release build separation by using build: false parameter - Ensure publish job runs after semantic-release with proper checkout
1 parent cda7fd3 commit f77d03b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/workflows/release.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
tag: true # Tag the release
5050
push: true # Push changes back to the repository
5151
commit: true # Commit changes
52+
build: false # Skip build in semantic-release since we'll do it separately
5253

5354

5455
sbom-generation:
@@ -69,12 +70,15 @@ jobs:
6970
format: spdx-json # Use SPDX format for SBOM
7071
dependency-snapshot: true # Include dependency snapshot
7172

72-
publish-testpypi:
73+
publish:
7374
needs: semantic-release
7475
if: ${{ github.ref == 'refs/heads/main' }}
7576
runs-on: ubuntu-latest
7677
steps:
7778
- uses: actions/checkout@v4
79+
with:
80+
fetch-depth: 0
81+
ref: ${{ github.head_ref || github.ref_name }}
7882
- name: Set up Python
7983
uses: actions/setup-python@v5
8084
with:
@@ -87,8 +91,8 @@ jobs:
8791
run: |
8892
poetry build
8993
- name: Publish to TestPyPI
90-
continue-on-error: true # Don't fail if secret is not set
91-
uses: pypa/gh-action-pypi-publish@release/v1
92-
with:
93-
password: ${{ secrets.TESTPYPI_API_TOKEN }}
94-
repository-url: https://test.pypi.org/legacy/
94+
env:
95+
POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TEST_PYPI_API_TOKEN }}
96+
run: |
97+
poetry config repositories.testpypi https://test.pypi.org/legacy/
98+
poetry publish --repository testpypi

0 commit comments

Comments
 (0)