Skip to content

Commit

Permalink
feat: add release to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Wazzabeee committed Apr 20, 2024
1 parent 42135bc commit 15b874f
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: CI Pipeline

on: [push]
on:
push:
branches:
- main # Ensures actions run on pushes to the main branch
tags:
- 'v*' # Ensures actions run on tag pushes that match the version pattern
pull_request:

jobs:
test:
Expand Down Expand Up @@ -37,3 +43,22 @@ jobs:
pylint scripts/ --rcfile=setup.cfg --fail-under=9
mypy -p scripts --ignore-missing-imports --disallow-incomplete-defs
continue-on-error: true

release:
needs: [ test, good-practices ]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11.5'
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install setuptools wheel twine
python setup.py sdist bdist_wheel
twine upload dist/*

0 comments on commit 15b874f

Please sign in to comment.