-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a workflow to manually publish to pypi
- Loading branch information
Showing
2 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# This workflow will upload a Python Package using Twine to Test PyPi (Full release) when a workflow_dispatch event is triggered. | ||
|
||
name: Manually Publish Package | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
publish: | ||
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.10' | ||
|
||
- name: Install tools | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install hatch twine | ||
- name: Build package | ||
run: | | ||
hatch build | ||
- name: Run package validators | ||
run: | | ||
twine check dist/* | ||
# Test install from wheel | ||
pip install dist/*.whl | ||
python -c "import uni2ts; print(uni2ts.__version__)" | ||
- name: Upload to PyPI | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: | | ||
twine upload --verbose dist/* | ||
- name: Verify PyPI publication | ||
run: | | ||
sleep 60 | ||
# Extract version from tag | ||
VERSION=${GITHUB_REF#refs/tags/} # removes refs/tags/ | ||
echo "Installing version: $VERSION" | ||
pip install uni2ts==$VERSION | ||
python -c "import uni2ts; print(uni2ts.__version__)" |