From c8c0bd186a5eebd0fe7374833584785cfda817eb Mon Sep 17 00:00:00 2001 From: Stefano Fusai Date: Tue, 2 Apr 2024 23:16:40 +0200 Subject: [PATCH] Setup .github --- .github/dependabot.yml | 13 ++++++++ .github/workflows/python-publish.yml | 48 ++++++++++++++++++++++++++++ pyproject.toml | 2 +- 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..b240fac --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + target-branch: "main" + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + target-branch: "main" \ No newline at end of file diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..4a110a8 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,48 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + deploy: + + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: [3.11] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + + - name: Build package + run: python -m build + + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index 3ef5c44..e9a17a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "scrapy-influxdb-exporter" -version = "1.0.2" +version = "1.0.3" authors = [{ "name" = "Stefano Fusai", "email" = "stefanofusai@gmail.com" }] description = "A simple package to export Scrapy spider stats to InfluxDB" readme = "README.md"