-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated sequential build-and-release workflows on GitHub.
- Loading branch information
1 parent
8588bd7
commit 45b69b4
Showing
3 changed files
with
46 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" # Trigger only when a tag like v1.2.3 is pushed | ||
|
||
jobs: | ||
pypi: | ||
runs-on: ubuntu-latest | ||
if: > | ||
${{ github.event.workflow_run.conclusion == 'success' && | ||
github.event.workflow_run.head_branch == 'main' }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Required for Git versioning | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install Hatch & Twine | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install uv | ||
python -m uv pip install hatch twine | ||
- name: Verify Version from Git Tag | ||
run: hatch version | ||
|
||
- name: Build Package | ||
run: hatch build | ||
|
||
- name: Publish to PyPI | ||
env: | ||
TWINE_USERNAME: "__token__" | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: twine upload dist/* |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
*# | ||
*.pyc | ||
*.DS_Store | ||
|
||
dist/* | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|