From 09101b1e320f389a15208cd34df913f356a64555 Mon Sep 17 00:00:00 2001 From: dachafra Date: Fri, 12 Jan 2024 11:32:34 +0100 Subject: [PATCH] fixing #75 --- .github/workflows/pypi-publish.yml | 50 ++++++++++++++++++++++++ .github/workflows/python-publish-rel.yml | 32 --------------- .github/workflows/testgha.yml | 2 +- src/setup.py | 8 ++-- 4 files changed, 55 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/pypi-publish.yml delete mode 100644 .github/workflows/python-publish-rel.yml diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml new file mode 100644 index 0000000..407eb6a --- /dev/null +++ b/.github/workflows/pypi-publish.yml @@ -0,0 +1,50 @@ +name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI + +on: push + +jobs: + build: + name: Build distribution 📦 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Install pypa/build + run: | + python -m pip install --upgrade pip + pip install setuptools wheel + - name: Build a binary wheel and a source tarball + run: | + cd src + python setup.py -k rel sdist bdist_wheel + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: >- + Publish Python 🐍 distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + needs: + - build + runs-on: ubuntu-latest + environment: + name: release + url: https://pypi.org/p/yatter # Replace with your PyPI project name + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/python-publish-rel.yml b/.github/workflows/python-publish-rel.yml deleted file mode 100644 index 4def144..0000000 --- a/.github/workflows/python-publish-rel.yml +++ /dev/null @@ -1,32 +0,0 @@ -# This workflows will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - -name: Upload Python Package - -on: - release: - types: [created] - -jobs: - deploy: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - cd src - python setup.py -k rel sdist bdist_wheel - twine upload dist/* diff --git a/.github/workflows/testgha.yml b/.github/workflows/testgha.yml index 6524389..cc67652 100644 --- a/.github/workflows/testgha.yml +++ b/.github/workflows/testgha.yml @@ -20,7 +20,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine pytest DeepDiff + pip install setuptools wheel pytest DeepDiff pip install -r requirements.txt - name: Build yatter run: | diff --git a/src/setup.py b/src/setup.py index b6be05c..77c3c9d 100644 --- a/src/setup.py +++ b/src/setup.py @@ -26,15 +26,15 @@ name="yatter", version=vers_taged, author="David Chaves-Fraga", - author_email="david.chaves@upm.es", + author_email="david.chaves@usc.es", license="Apache 2.0", description="A translator from YARRRML to RML mappings.", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/oeg-upm/yarrrml-translator", + url="https://github.com/oeg-upm/yatter", project_urls={ - 'Source code': 'https://github.com/oeg-upm/yarrrml-translator', - 'Issue tracker': 'https://github.com/oeg-upm/yarrrml-translator/issues', + 'Source code': 'https://github.com/oeg-upm/yatter', + 'Issue tracker': 'https://github.com/oeg-upm/yatter/issues', }, include_package_data=True, packages=setuptools.find_packages(),