From 399d521a88acc2e4752d49a00efa52bb855e70ed Mon Sep 17 00:00:00 2001 From: 2bndy5 <2bndy5@gmail.com> Date: Sun, 25 Jul 2021 05:27:28 -0700 Subject: [PATCH] ready for release to pypi --- .github/workflows/main.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 62b6e8c..a11bf6f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,13 +4,15 @@ name: CI # events but only for the master branch on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] + release: + types: [published] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - Check_Python_pkg: + Python_pkg: runs-on: ubuntu-latest steps: - name: Checkout this Repo @@ -23,14 +25,27 @@ jobs: - name: Install Dependencies run: | + python -m pip install --upgrade pip pip install -r requirements.txt pip install pylint - name: Check formatting run: pylint rmskin_builder.py + - name: Prepare for pypi + if: github.event_name == 'release' + run: pip install setuptools wheel twine + + - name: Build and publish + if: github.event_name == 'release' + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.pypi_token }} + run: | + python setup.py sdist + twine upload dist/* + Build: - # needs: Check_Python_pkg runs-on: ubuntu-latest steps: - name: Checkout this Repo