From 05481ee00224c27c194fdc631f64dffecdaf904c Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Wed, 18 May 2022 12:32:40 -0300 Subject: [PATCH 1/2] publish to pypi --- .github/workflows/pypi.yml | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/pypi.yml diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..75f2c37 --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,52 @@ +name: Publish to PyPI + +on: + pull_request: + push: + branches: + - main + release: + types: + - published + +jobs: + packages: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.x" + + - name: Get tags + run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* + shell: bash + + - name: Install build tools + run: | + python -m pip install --upgrade pip wheel setuptools setuptools_scm build twine + + shell: bash + + - name: Build binary wheel + run: python -m build --sdist --wheel . --outdir dist + + - name: CheckFiles + run: | + ls dist + shell: bash + + - name: Test wheels + run: | + cd dist && python -m pip install ctd*.whl + python -m twine check * + shell: bash + + - name: Publish a Python distribution to PyPI + if: success() && github.event_name == 'release' + uses: pypa/gh-action-pypi-publish@v1 + with: + user: __token__ + password: ${{ secrets.PYPI_PASSWORD }} From cd1716704014bfe979fa8dc8104e4d243d5345bb Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Wed, 18 May 2022 12:51:39 -0300 Subject: [PATCH 2/2] fix GHA name --- .github/workflows/pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 75f2c37..6676875 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -46,7 +46,7 @@ jobs: - name: Publish a Python distribution to PyPI if: success() && github.event_name == 'release' - uses: pypa/gh-action-pypi-publish@v1 + uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.PYPI_PASSWORD }}