From 88face8b6788acf38513808b204fb88bf79bac26 Mon Sep 17 00:00:00 2001 From: Lucas Vinicius Amaral de Oliveira Date: Mon, 20 Mar 2023 11:30:49 -0300 Subject: [PATCH 1/2] Add deploy job to publish new version of the lib --- .github/workflows/main.yml | 36 +++++++++++++++++++++++++++++++++++- setup.cfg | 4 ++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 800d429..a63f7b8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,14 @@ name: build -on: [push] +on: + push: + branches: + - master + - rb-* + tags: + - v* + + pull_request: jobs: build: @@ -28,4 +36,30 @@ jobs: - name: Upload codecov uses: codecov/codecov-action@v3 with: + token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true + + deploy: + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'ESSS/flask-restalchemy' + + runs-on: ubuntu-20.04 + + needs: build + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.6" + + - name: Build Package + run: | + python -m pip install --upgrade pip wheel setuptools + python setup.py sdist bdist_wheel + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_token }} diff --git a/setup.cfg b/setup.cfg index ee91939..6879d17 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,7 @@ +[metadata] +long_description = file: README.md +long_description_content_type= text/markdown + [bdist_wheel] python_tag = py3 From 30b9b9bcc4506f8c067060835e25f84bb15f5d7c Mon Sep 17 00:00:00 2001 From: Lucas Vinicius Amaral de Oliveira Date: Mon, 20 Mar 2023 16:32:06 -0300 Subject: [PATCH 2/2] Use release/v1 on pypi-publish action The master version has been sunsetted --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a63f7b8..ad14c99 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,7 +59,7 @@ jobs: python -m pip install --upgrade pip wheel setuptools python setup.py sdist bdist_wheel - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.pypi_token }}