From fe3095d51a5cbae0f05472014c01b7ee32e5f0e1 Mon Sep 17 00:00:00 2001 From: jdebacker Date: Mon, 4 Apr 2022 08:24:35 -0400 Subject: [PATCH] move pypi publish to separate action --- .github/workflows/deploy_docs.yml | 22 +--------------------- .github/workflows/publish_to_pypi.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/publish_to_pypi.yml diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index c3c7b829b..12dbdc784 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -35,24 +35,4 @@ jobs: with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages # The branch the action should deploy to. - FOLDER: docs/book/_build/html # The folder the action should deploy. - publish: - needs: build - name: Publish to PyPI - if: github.repository == 'PSLmodels/OG-Core' - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - name: Build package - run: make pip-package - - name: Publish a Python distribution to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI }} - skip_existing: true + FOLDER: docs/book/_build/html # The folder the action should deploy. \ No newline at end of file diff --git a/.github/workflows/publish_to_pypi.yml b/.github/workflows/publish_to_pypi.yml new file mode 100644 index 000000000..2ca0318f2 --- /dev/null +++ b/.github/workflows/publish_to_pypi.yml @@ -0,0 +1,27 @@ +name: Publish package to PyPI + +on: + push: + branches: + - master + +jobs: + deploy: + name: Publish to PyPI + if: github.repository == 'PSLmodels/OG-Core' + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Build package + run: make pip-package + - name: Publish a Python distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI }} + skip_existing: true \ No newline at end of file