Skip to content

Commit 676a5a0

Browse files
committed
fix test release workflow to check build artifacts, not TestPyPI
1 parent 5f16f6b commit 676a5a0

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

.github/workflows/test-release.yml

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,50 @@
11
name: Test Release
22

33
on:
4-
workflow_run:
5-
workflows: ["CI"]
6-
types:
7-
- completed
4+
push:
5+
branches:
6+
- main
87

98
jobs:
10-
test-release:
11-
name: Build and Publish to TestPyPI
12-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
9+
sanity-check:
10+
name: Build and Verify Artifacts
11+
needs: ci
1312
runs-on: ubuntu-latest
1413

1514
steps:
16-
- uses: actions/checkout@v4
15+
- name: Checkout code
16+
uses: actions/checkout@v4
1717

1818
- name: Set up Python
1919
uses: actions/setup-python@v5
2020
with:
21-
python-version: '3.11'
21+
python-version: "3.11"
2222

2323
- name: Install Poetry
2424
run: |
2525
curl -sSL https://install.python-poetry.org | python3 -
2626
echo "$HOME/.local/bin" >> $GITHUB_PATH
2727
28-
- name: Configure Poetry for TestPyPI
28+
- name: Build package
2929
run: |
30-
poetry config repositories.testpypi https://test.pypi.org/legacy/
31-
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_API_TOKEN }}
32-
33-
- name: Install dependencies
34-
run: poetry install --only main
30+
poetry install --no-root
31+
poetry build
3532
36-
- name: Build and verify package
33+
- name: Check artifacts with twine
3734
run: |
38-
poetry build
39-
pip install --upgrade build twine
35+
pip install twine
4036
twine check dist/*
4137
42-
- name: Publish to TestPyPI
43-
run: poetry publish -r testpypi --skip-existing
38+
- name: Create test venv and install package
39+
run: |
40+
python -m venv testenv
41+
source testenv/bin/activate
42+
pip install dist/*.whl
43+
44+
python -c "import dstools"
45+
46+
dstools-extract-ds --help || echo "No CLI tool found"
47+
48+
- name: Clean up
49+
if: always()
50+
run: rm -rf testenv

0 commit comments

Comments
 (0)