Skip to content

Commit

Permalink
Create pypi.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
webb-ben committed Jan 17, 2024
1 parent 2852459 commit 95fbcda
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build and Publish Python Package

on:
push:
branches:
- master
- pypi
release:
types: [published]


jobs:
build:
runs-on: ubuntu-latest

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 -r requirements.txt # Adjust accordingly
- name: Build package
run: python setup.py sdist bdist_wheel

publish:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install twine
run: pip install twine

- name: Publish to PyPI
run: |
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

0 comments on commit 95fbcda

Please sign in to comment.