Skip to content

Commit

Permalink
Upload pipy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
joancipria committed Sep 6, 2024
1 parent c7e61b6 commit a410918
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Python Package Build and Publish

on:
push:
tags:
- "v*" # Run the workflow when pushing a new tag
workflow_dispatch: # Allows manual triggering of the workflow

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x" # You can specify your desired Python version

- name: Install build tools
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel twine
- name: Build the package
run: |
python setup.py sdist bdist_wheel
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/

publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: dist

- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
python -m pip install --upgrade twine
twine upload dist/*

0 comments on commit a410918

Please sign in to comment.