Skip to content

Commit dba18b1

Browse files
committed
workflow upload code change
1 parent f8d21cb commit dba18b1

3 files changed

Lines changed: 53 additions & 12 deletions

File tree

β€Ž.github/workflows/release_package.ymlβ€Ž

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,18 @@ jobs:
5353
- name: Build package
5454
run: python -m build
5555

56-
- name: Publish to TestPyPI
57-
uses: pypa/gh-action-pypi-publish@release/v1
58-
with:
59-
repository-url: https://test.pypi.org/legacy/
60-
user: __token__
61-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
56+
- name: Upload to TestPyPI
57+
run: ./scripts/upload_testpypi.sh
58+
env:
59+
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
6260

6361
- name: Verify install from TestPyPI
6462
run: |
6563
python -m pip install --upgrade pip
6664
pip install --index-url https://test.pypi.org/simple/ --no-deps pytest-htmlx
6765
python -c "import pytest_htmlx; print(pytest_htmlx.__version__)"
68-
66+
6967
- name: Publish to PyPI
70-
if: success()
71-
uses: pypa/gh-action-pypi-publish@release/v1
72-
with:
73-
user: __token__
74-
password: ${{ secrets.PYPI_API_TOKEN }}
68+
run: ./scripts/upload_pypi.sh
69+
env:
70+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}

β€Žscripts/upload_pypi.shβ€Ž

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
PACKAGE_NAME="pytest-htmlx"
5+
6+
echo "πŸ“¦ Building $PACKAGE_NAME ..."
7+
8+
# Clean old builds
9+
rm -rf dist/ build/ *.egg-info
10+
11+
# Build (source + wheel)
12+
python -m build
13+
14+
echo "πŸš€ Uploading to PyPI ..."
15+
16+
twine upload \
17+
-u __token__ \
18+
-p "$PYPI_API_TOKEN" \
19+
dist/*
20+
21+
echo "βœ… Uploaded to PyPI!"

β€Žscripts/upload_testpypi.shβ€Ž

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
PACKAGE_NAME="pytest-htmlx"
5+
6+
echo "πŸ“¦ Building $PACKAGE_NAME ..."
7+
8+
# Clean old builds
9+
rm -rf dist/ build/ *.egg-info
10+
11+
# Build (source + wheel)
12+
python -m build
13+
14+
echo "πŸš€ Uploading to TestPyPI ..."
15+
16+
twine upload \
17+
--repository-url https://test.pypi.org/legacy/ \
18+
-u __token__ \
19+
-p "$TEST_PYPI_API_TOKEN" \
20+
dist/*
21+
22+
echo "βœ… Uploaded to TestPyPI!"
23+
echo "πŸ” Verify install with:"
24+
echo "pip install --index-url https://test.pypi.org/simple/ --no-deps $PACKAGE_NAME"

0 commit comments

Comments
Β (0)