Skip to content

Commit 4de883f

Browse files
committed
feat: streamline workflow to publish directly to PyPI
- Remove TestPyPI staging step - publish directly to production PyPI - Simplify workflow: build → test → PyPI → validation - Remove redundant TestPyPI installation testing - Workflow is now focused and efficient for production releases - All package validation done in local build step
1 parent b259bae commit 4de883f

1 file changed

Lines changed: 3 additions & 52 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -104,59 +104,10 @@ jobs:
104104
path-comment-hook --version
105105
path-comment-hook welcome
106106
107-
publish-test-pypi:
108-
name: Publish to Test PyPI
109-
runs-on: ubuntu-latest
110-
needs: build
111-
steps:
112-
- name: Download build artifacts
113-
uses: actions/download-artifact@v4
114-
with:
115-
name: dist-${{ needs.build.outputs.version }}
116-
path: dist/
117-
118-
- name: Publish to Test PyPI
119-
uses: pypa/gh-action-pypi-publish@release/v1
120-
with:
121-
repository-url: https://test.pypi.org/legacy/
122-
verbose: true
123-
124-
test-testpypi-installation:
125-
name: Test TestPyPI Installation
126-
runs-on: ubuntu-latest
127-
needs: [build, publish-test-pypi]
128-
steps:
129-
- name: Set up Python
130-
uses: actions/setup-python@v4
131-
with:
132-
python-version: "3.11"
133-
134-
- name: Wait for TestPyPI availability
135-
run: |
136-
echo "Waiting 2 minutes for TestPyPI to update..."
137-
sleep 120
138-
139-
- name: Install from TestPyPI
140-
run: |
141-
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ path-comment-hook==${{ needs.build.outputs.version }}
142-
143-
- name: Test installation
144-
run: |
145-
path-comment-hook --version
146-
path-comment-hook --help
147-
148-
- name: Test basic functionality
149-
run: |
150-
echo "print('hello')" > test.py
151-
path-comment-hook test.py
152-
grep -q "# test.py" test.py || (echo "Path comment not added!" && exit 1)
153-
echo "TestPyPI installation test passed!"
154-
155107
publish-pypi:
156-
name: Publish to PyPI (Manual Approval Required)
108+
name: Publish to PyPI
157109
runs-on: ubuntu-latest
158-
needs: [build, test-testpypi-installation]
159-
# environment: production-release # Configure this environment in GitHub repo settings for manual approval
110+
needs: build
160111
steps:
161112
- name: Download build artifacts
162113
uses: actions/download-artifact@v4
@@ -175,7 +126,7 @@ jobs:
175126
test-installation:
176127
name: Test PyPI Installation
177128
runs-on: ${{ matrix.os }}
178-
needs: publish-pypi
129+
needs: [build, publish-pypi]
179130
strategy:
180131
matrix:
181132
os: [ubuntu-latest, windows-latest, macos-latest]

0 commit comments

Comments
 (0)