diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-04-13 12:33:43 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-04-13 12:49:50 +0300 |
commit | 0a1d55b32ad4f697219d87ad1959ccc23af4ec7a (patch) | |
tree | 2d43298ff8578a89fc34e8a61a3cfd7cf9ea4539 | |
parent | add packaging metadata (diff) | |
download | cgitize-0.1.tar.gz cgitize-0.1.zip |
workflows/test: add job for publishing to PyPIv0.1
-rw-r--r-- | .github/workflows/test.yml | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b97eea3..49a1c51 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,12 +6,12 @@ on: workflow_dispatch: jobs: - local: + test_local: runs-on: ubuntu-18.04 strategy: matrix: python-version: [3.6, 3.7, 3.8, 3.9] - name: 'Test locally / ${{ matrix.python-version }}' + name: 'Test: ${{ matrix.python-version }}' steps: - name: Checkout uses: actions/checkout@v2 @@ -26,19 +26,19 @@ jobs: - name: Test run: ./.ci/local/test.sh - docker: + test_docker: runs-on: ubuntu-18.04 - name: Test in Docker + name: 'Test: Docker' steps: - name: Checkout uses: actions/checkout@v2 - name: Test run: ./.ci/docker/test.sh - publish: - needs: [local, docker] + publish_docker: + needs: [test_local, test_docker] runs-on: ubuntu-18.04 - name: Publish + name: 'Publish: Docker Hub' if: github.ref == 'refs/heads/master' steps: - name: Set up QEMU @@ -56,3 +56,30 @@ jobs: platforms: linux/amd64,linux/armhf push: true tags: '${{ secrets.DOCKERHUB_USERNAME }}/cgitize:latest' + + publish_pypi: + needs: [test_local, test_docker] + runs-on: ubuntu-18.04 + name: 'Publish: PyPI' + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.6 + - name: Install tools + run: python3 -m pip install --upgrade build twine + - name: Build package + run: python3 -m build + - name: Upload dist + uses: actions/upload-artifact@v2 + with: + name: dist + path: dist + - name: Publish package + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} |