diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e86bf26..42113f0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,7 +9,11 @@ updates: directory: "/" # Location of package manifests schedule: interval: "weekly" - + commit-message: + # Prefix all commit messages with "npm: " + prefix: "chore(pyproject.toml): " + + - package-ecosystem: "github-actions" # See documentation for possible values directory: "/" # Location of package manifests schedule: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 090c4c3..7808231 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,9 +5,13 @@ name: Python package on: push: - branches: [ "main" ] + branches: + - "main" + - "develop" pull_request: - branches: [ "main" ] + branches: + - "main" + - "develop" jobs: test: @@ -37,3 +41,37 @@ jobs: gist-id: ${{ vars.GIST_ID_BADGES }} token: ${{ secrets.GIST_TOKEN }} prefix: ${{ github.event.repository.name }}_${{ matrix.python-version }} + + - name: Upload Test Results + if: always() + uses: actions/upload-artifact@v4 + with: + name: Test Results (Python ${{ matrix.python-version }}) + path: report.xml + + report: + name: Comment test results + runs-on: ubuntu-latest + needs: test + permissions: + checks: write + + # only needed unless run with comment_mode: off + pull-requests: write + + # only needed for private repository + contents: read + + # only needed for private repository + issues: read + + if: always() + + steps: + - name: Download Test Results + uses: actions/download-artifact@v4 + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + files: "**/*.xml" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..efe906e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: Release a new version + +on: + push: + branches: + - main + +jobs: + release: + name: Release + runs-on: ubuntu-latest + concurrency: release + permissions: + id-token: write + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Python semantic release + uses: python-semantic-release/python-semantic-release@v9.8.8 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile index 64c312d..d89ba11 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ setup: test: pytest --cov=web_watchr --cov-report term-missing -.PHONY: setup-ci +.PHONY: run-ci run-ci: pip install --upgrade pip pip install uv diff --git a/pyproject.toml b/pyproject.toml index 3f64cc5..d7d8efe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,10 +12,10 @@ keywords = ["bot", "scraping", "telegram"] license = { text = "MIT" } classifiers = ["Programming Language :: Python :: 3"] dependencies = [ - "python-telegram-bot==21.5", - "pydantic==2.9.0", + "python-telegram-bot==21.6", + "pydantic==2.9.2", "loguru==0.7.2", - "playwright==1.46.0", + "playwright==1.47.0", ] dynamic = ["version"] @@ -51,3 +51,13 @@ Documentation = "https://Emrys-Merlin.github.io/web_watchr/" Repository = "https://github.com/Emrys-Merlin/web_watchr.git" "Bug Tracker" = "https://github.com/Emrys-Merlin/web_watchr/issues" # Changelog = "https://github.com/me/spam/blob/master/CHANGELOG.md" + +[tool.semantic_release] +version_variable = [ + "src/web_watchr/__init__.py:__version__" +] +major_on_zero = true +branch = "main" +upload_to_PyPI = true +upload_to_release = true +build_command = "make setup && make build"