From c61e687c3bfb91e3e1f720b6146a3234b0cfcb6c Mon Sep 17 00:00:00 2001 From: Etienne Trimaille Date: Mon, 3 May 2021 13:09:05 +0700 Subject: [PATCH] Update --- .github/workflows/release.yml | 86 +++++++++++++++++++++++++---------- .gitignore | 2 + dependabot.yml | 14 ++++++ setup.py | 2 +- 4 files changed, 79 insertions(+), 25 deletions(-) create mode 100644 dependabot.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c15d6f4..b899b4b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,49 +10,87 @@ on: - master env: - PROJECT_FOLDER: "qgis_plugin_repo" + # PROJECT_FOLDER: "qgis_plugin_repo" PYTHON_VERSION: 3.8 jobs: -# tests: -# name: "Tests" -# runs-on: ubuntu-latest -# -# steps: -# - name: Get source code -# uses: actions/checkout@v2 -# -# - name: Set up Python -# uses: actions/setup-python@v1 -# with: -# python-version: ${{ env.PYTHON_VERSION }} -# -# - name: Install Python requirements -# run: python -m pip install -U pip setuptools wheel -# + tests: + name: "Tests" + runs-on: ubuntu-latest + + steps: + - name: Get source code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Install Python requirements + run: python -m pip install -U pip setuptools wheel + + - name: Debug + run: ls -la + # - name: Run tests # working-directory: tests # run: python -m unittest release: name: "Release on tag 🚀" - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 needs: [tests] - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') steps: - name: Get source code uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: Setup run: | VERSION=${GITHUB_REF:-0.0.0} VERSION=${VERSION##*/} - sed "s/__VERSION__/${VERSION}/" setup.py > setup.py + sed -i "s/__VERSION__/${VERSION}/g" setup.py + + - name: Build package + run: | + python setup.py sdist - - name: Deploy to PyPI - uses: pypa/gh-action-pypi-publish@master + - name: Debug + run: | + ls -al dist + + - name: Create release on GitHub + id: create_release + uses: ncipollo/release-action@v1.8.4 with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} + allowUpdates: true + artifacts: "dist/*.tar.gz" + # tag_name: ${{ github.ref }} + # release_name: ${{ github.ref }} + # body_path: release.md + +# - name: Deploy to PyPI +# uses: pypa/gh-action-pypi-publish@master +# with: +# user: __token__ +# password: ${{ secrets.PYPI_API_TOKEN }} + +# +# - name: Upload Release Asset +# id: upload-release-asset +# uses: actions/upload-release-asset@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps +# asset_path: ./my-artifact.zip +# asset_name: my-artifact.zip +# asset_content_type: application/zip diff --git a/.gitignore b/.gitignore index df7b1fd..de7bdb7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ .idea/ # Python +build/ +dist/ __pycache__/ *.egg-info .venv diff --git a/dependabot.yml b/dependabot.yml new file mode 100644 index 0000000..17ebe18 --- /dev/null +++ b/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + +# - package-ecosystem: pip +# directory: "/requirements" +# schedule: +# interval: monthly +# time: "04:00" +# timezone: Europe/Paris + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" diff --git a/setup.py b/setup.py index 42d1091..1a2667e 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ "Intended Audience :: Information Technology", ], install_requires=["requests"], - extra_require=dict(tests=['pytest']), + # extra_require=dict(tests=['pytest']), python_requires=">={vmaj}.{vmin}".format( vmaj=python_min_version[0], vmin=python_min_version[1] ),