-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease_package_to_test_pypi.yml
More file actions
57 lines (45 loc) · 1.36 KB
/
release_package_to_test_pypi.yml
File metadata and controls
57 lines (45 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Publish To TestPyPI
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release'
required: true
default: '0.1.0'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: |
rm -rf dist/ build/ *.egg-info
python -m build
- name: Upload to TestPyPI
env:
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
run: |
if [ -z "$TEST_PYPI_API_TOKEN" ]; then
echo "TEST_PYPI_API_TOKEN not set"; exit 1
fi
twine upload --verbose --repository-url https://test.pypi.org/legacy/ \
-u __token__ \
-p "$TEST_PYPI_API_TOKEN" \
dist/*
- name: Verify install from TestPyPI
run: |
python -m pip install --upgrade pip
pip install --index-url https://test.pypi.org/simple/ --no-deps pytest-htmlx
python -c "import pytest_htmlx; print('Installed version:', pytest_htmlx.__version__)"