Skip to content

Commit

Permalink
Add GitHub Action for PyPi packages (tkellogg#6)
Browse files Browse the repository at this point in the history
- 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
baseely committed Jan 2, 2024
1 parent 31fba71 commit c0278c7
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/push_wheel_to_pypi.yml
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

0 comments on commit c0278c7

Please sign in to comment.