diff options
author | nicolargo <nicolas@nicolargo.com> | 2021-04-19 13:55:09 +0200 |
---|---|---|
committer | nicolargo <nicolas@nicolargo.com> | 2021-04-19 13:55:09 +0200 |
commit | ea6c1c8b600c546fdcf52a359836ab2b72b78c18 (patch) | |
tree | 95d2d435748b95c63d82e33a64594d16950b9d5c | |
parent | d5cd4da07bb79eed68aca1f7e6041c670bbc1596 (diff) |
Add Pypi pipeline in Github Actions
-rw-r--r-- | .github/workflows/build.yml | 20 | ||||
-rw-r--r-- | .github/workflows/main.yml | 33 |
2 files changed, 43 insertions, 10 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6255250d..be30b710 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,13 +44,13 @@ jobs: name: wheels path: dist - linters: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - name: 'Run linters' - run: | - python3 -m pip install flake8 - python3 -m flake8 . - echo "Flake8 linting OK" + # linters: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # - uses: actions/setup-python@v2 + # - name: 'Run linters' + # run: | + # python3 -m pip install flake8 + # python3 -m flake8 . + # echo "Flake8 linting OK" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d58e3e41..d36e25f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -83,3 +83,36 @@ jobs: platforms: ${{env.DOCKER_PLATFORMS}} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache,mode=max + + pypi: + runs-on: ubuntu-latest + steps: + + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + + - name: Publish distribution package to Test PyPI + uses: pypa/gh-action-pypi-publish@master + with: + user: ${{ secrets.PYPI_USERNAME }} + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + + - name: Publish distribution package to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + user: ${{ secrets.PYPI_USERNAME }} + password: ${{ secrets.PYPI_API_TOKEN }}
\ No newline at end of file |