forked from tkellogg/fossil
-
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.
Add GitHub Action for PyPi packages (tkellogg#6)
- Implemented a GitHub Action to automatically publish the package to PyPI upon new tag releases. - Action builds the package, creates distribution files, and uploads them to PyPI. Closes tkellogg#6
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 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,56 @@ | ||
name: Publish to PyPI | ||
on: | ||
push | ||
|
||
jobs: | ||
pypi-publish: | ||
name: Upload release to PyPI | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/fossil | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade setuptools wheel | ||
pip install --upgrade twine | ||
- name: Build and publish wheel | ||
run: | | ||
python -m build | ||
twine upload dist/*.whl | ||
- name: Get tag name | ||
id: tag_name | ||
run: echo "##vso[task.setvariable variable=tag_name;isOutput=true]" & | ||
git describe --tags --abbrev=0 | ||
|
||
build: | ||
name: Build distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade setuptools wheel | ||
pip install --upgrade twine | ||
- name: Build and publish wheel | ||
run: | | ||
python -m build | ||
twine upload dist/*.whl |