File tree Expand file tree Collapse file tree 2 files changed +71
-0
lines changed
Expand file tree Collapse file tree 2 files changed +71
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Release to Test PyPI
2+
3+ on :
4+ push :
5+ tags :
6+ - ' *'
7+ jobs :
8+ release :
9+ environment : TEST_PYPI_API_TOKEN
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - uses : actions/checkout@v4
14+ - name : Set up Python 3.10
15+ uses : actions/setup-python@v4
16+ with :
17+ python-version : " 3.10"
18+ - name : Install Tools
19+ run : |
20+ python -m pip install --upgrade pip
21+ pip install setuptools wheel twine build
22+ pip install .
23+ - name : Test version/tag correspondence
24+ id : version-check
25+ run : |
26+ neo_version=$(python -c "import neo; print(neo.__version__)")
27+ if [[ ${{ github.event.release.tag_name }} == $neo_version ]]; then
28+ echo "VERSION_TAG_MATCH=true" >> $GITHUB_OUTPUT
29+ echo "Version matches tag, proceeding with release to Test PyPI"
30+ else
31+ echo "VERSION_TAG_MATCH=false" >> $GITHUB_OUTPUT
32+ echo "Version does not match tag! Fix this before proceeding."
33+ exit 1
34+ fi
35+ - name : Package and Upload
36+ env :
37+ STACKMANAGER_VERSION : ${{ github.event.release.tag_name }}
38+ TWINE_USERNAME : __token__
39+ TWINE_PASSWORD : ${{ secrets.TEST_PYPI_API_TOKEN }}
40+ if : ${{ steps.version-check.outputs.VERSION_TAG_MATCH == 'true' }}
41+ run : |
42+ python -m build --sdist --wheel
43+ twine upload --repository testpypi dist/*
Original file line number Diff line number Diff line change 1+ name : Release to PyPI
2+
3+ on :
4+ workflow_dispatch :
5+
6+ jobs :
7+ release :
8+ environment : PYPI_API_TOKEN
9+ runs-on : ubuntu-latest
10+
11+ steps :
12+ - uses : actions/checkout@v4
13+ - name : Set up Python 3.10
14+ uses : actions/setup-python@v4
15+ with :
16+ python-version : " 3.10"
17+ - name : Install Tools
18+ run : |
19+ python -m pip install --upgrade pip
20+ pip install setuptools wheel twine build
21+ - name : Package and Upload
22+ env :
23+ STACKMANAGER_VERSION : ${{ github.event.release.tag_name }}
24+ TWINE_USERNAME : __token__
25+ TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
26+ run : |
27+ python -m build --sdist --wheel
28+ twine upload dist/*
You can’t perform that action at this time.
0 commit comments