From 0f1fce4a7b2d08a72d8705c86cffc8fdc1e2d0af Mon Sep 17 00:00:00 2001 From: Bastien Gerard Date: Wed, 16 Dec 2020 21:52:49 +0100 Subject: [PATCH] Add separate jobs for test-pypi and pypi in github actions --- .github/workflows/github-actions.yml | 39 +++++++++++++++++++--------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 43a70a85..1205e7c5 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -35,6 +35,8 @@ jobs: - run: pre-commit run -a test: + # Test suite run against recent python versions + # and against a few combination of MongoDB and pymongo runs-on: ubuntu-latest strategy: fail-fast: false @@ -75,6 +77,7 @@ jobs: build_doc_dryrun: # ensures that readthedocs can be built continuously + # to avoid that it breaks when new releases are being created runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -103,6 +106,26 @@ jobs: message: | Build ${{ job.status }} - ${{ github.actor }} ${{ github.event_name }} ${{ github.event.ref }} + build-n-publish-dummy: + runs-on: ubuntu-latest + needs: [linting, test] + steps: + - uses: actions/checkout@master + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: build dummy wheel for test-pypi + run: | + pip install wheel + python setup.py egg_info -b ".dev`date '+%Y%m%d%H%M%S'`" build sdist bdist_wheel + - name: publish test-pypi + if: github.event_name != 'pull_request' + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.test_pypi_token }} + repository_url: https://test.pypi.org/legacy/ + build-n-publish: runs-on: ubuntu-latest needs: [linting, test] @@ -117,17 +140,9 @@ jobs: - name: build dummy wheel for test-pypi run: | pip install wheel - python setup.py egg_info -b ".dev`date '+%Y%m%d%H%M%S'`" build sdist bdist_wheel -# python setup.py sdist bdist_wheel - - name: publish test-pypi - if: github.event_name != 'pull_request' + python setup.py sdist bdist_wheel + - name: publish pypi uses: pypa/gh-action-pypi-publish@master + if: github.event_name == 'create' && startsWith(github.ref, 'refs/tags/v') with: - password: ${{ secrets.test_pypi_token }} - repository_url: https://test.pypi.org/legacy/ - ## Must clean prev files and rebuild here -# - name: publish pypi -# uses: pypa/gh-action-pypi-publish@master -# if: github.event_name == 'create' && startsWith(github.ref, 'refs/tags/v') -# with: -# password: ${{ secrets.pypi_token }} + password: ${{ secrets.pypi_token }} \ No newline at end of file