From fc713b66578bd1b5bf03386e920444d88a832ea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 18:31:02 +0300 Subject: [PATCH 01/18] Setup renovate workflow Based on file found on internet: - https://github.com/prskr/goveal/blob/90299a1405e95673bed349eb2847b918b014c73c/.gitea/workflows/renovate.yaml#L2 --- .github/workflows/renovate.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/renovate.yaml diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml new file mode 100644 index 0000000000..ccf7438832 --- /dev/null +++ b/.github/workflows/renovate.yaml @@ -0,0 +1,21 @@ +name: Renovate +on: + schedule: + # The "*" (#42, asterisk) character has special semantics in YAML, so this + # string has to be quoted. + - cron: '42 3 * * *' + +jobs: + renovate: + runs-on: ubuntu-latest + steps: + - uses: docker://code.icb4dc0.de/prskr/ci-images/renovate:latest + with: + args: renovate "${{ github.repository }}" + env: + RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }} + GITHUB_COM_TOKEN: ${{ secrets.RENOVATE_GITHUB_TOKEN }} + RENOVATE_PLATFORM: gitea + RENOVATE_AUTODISCOVER: "false" + RENOVATE_ENDPOINT: https://code.icb4dc0.de/api/v1 + LOG_LEVEL: info From 86ff7df3a5e771d973300395262c50cef6129ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 18:36:02 +0300 Subject: [PATCH 02/18] Setup to use renovate docker image --- .github/workflows/renovate.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml index ccf7438832..aa0c4d5dca 100644 --- a/.github/workflows/renovate.yaml +++ b/.github/workflows/renovate.yaml @@ -9,13 +9,14 @@ jobs: renovate: runs-on: ubuntu-latest steps: - - uses: docker://code.icb4dc0.de/prskr/ci-images/renovate:latest + - uses: docker://renovate/renovate:35.62 with: args: renovate "${{ github.repository }}" env: - RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }} - GITHUB_COM_TOKEN: ${{ secrets.RENOVATE_GITHUB_TOKEN }} - RENOVATE_PLATFORM: gitea - RENOVATE_AUTODISCOVER: "false" - RENOVATE_ENDPOINT: https://code.icb4dc0.de/api/v1 - LOG_LEVEL: info + RENOVATE_BASE_DIR: ${{ github.workspace }}/renovate + RENOVATE_GIT_AUTHOR: Renovate Bot + RENOVATE_OPTIMIZE_FOR_DISABLED: "true" + RENOVATE_REPOSITORY_CACHE: "enabled" + LOG_LEVEL: debug + +# vim:ts=2:sw=2:et From 4f308d2718d55a3ab77bc0822336f4aeb08a80c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 18:36:42 +0300 Subject: [PATCH 03/18] Enable run on this branch --- .github/workflows/renovate.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml index aa0c4d5dca..010c39bb01 100644 --- a/.github/workflows/renovate.yaml +++ b/.github/workflows/renovate.yaml @@ -4,6 +4,7 @@ on: # The "*" (#42, asterisk) character has special semantics in YAML, so this # string has to be quoted. - cron: '42 3 * * *' + pull_request: jobs: renovate: From 3afd6aac26bdf2cd63395f234f5da60b9833426c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 18:39:59 +0300 Subject: [PATCH 04/18] Upgrade renovate to 38.114.0 --- .github/workflows/renovate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml index 010c39bb01..82dc8c0363 100644 --- a/.github/workflows/renovate.yaml +++ b/.github/workflows/renovate.yaml @@ -10,7 +10,7 @@ jobs: renovate: runs-on: ubuntu-latest steps: - - uses: docker://renovate/renovate:35.62 + - uses: docker://ghcr.io/renovatebot/renovate:38.114.0 with: args: renovate "${{ github.repository }}" env: From 40abacbc78f678770b4a046d4010da81c2f28031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 18:42:10 +0300 Subject: [PATCH 05/18] Add GITHUB_COM_TOKEN variable --- .github/workflows/renovate.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml index 82dc8c0363..a0be442b68 100644 --- a/.github/workflows/renovate.yaml +++ b/.github/workflows/renovate.yaml @@ -14,6 +14,8 @@ jobs: with: args: renovate "${{ github.repository }}" env: + GITHUB_COM_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} RENOVATE_BASE_DIR: ${{ github.workspace }}/renovate RENOVATE_GIT_AUTHOR: Renovate Bot RENOVATE_OPTIMIZE_FOR_DISABLED: "true" From 2954037654dac9b4004414bbf66164cef12142d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 18:53:09 +0300 Subject: [PATCH 06/18] Use renovate github action --- .github/workflows/renovate.yaml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml index a0be442b68..9a52283840 100644 --- a/.github/workflows/renovate.yaml +++ b/.github/workflows/renovate.yaml @@ -7,19 +7,14 @@ on: pull_request: jobs: + renovate: runs-on: ubuntu-latest steps: - - uses: docker://ghcr.io/renovatebot/renovate:38.114.0 + - name: Self-hosted Renovate + uses: renovatebot/github-action@v40.3.4 with: - args: renovate "${{ github.repository }}" - env: - GITHUB_COM_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RENOVATE_BASE_DIR: ${{ github.workspace }}/renovate - RENOVATE_GIT_AUTHOR: Renovate Bot - RENOVATE_OPTIMIZE_FOR_DISABLED: "true" - RENOVATE_REPOSITORY_CACHE: "enabled" - LOG_LEVEL: debug + renovate-version: 38.114.0 + token: ${{ secrets.GITHUB_TOKEN }} # vim:ts=2:sw=2:et From 52d7af6f11c37c77b035207b69e413befe69f431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 18:57:20 +0300 Subject: [PATCH 07/18] Set log level debug/ --- .github/workflows/renovate.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml index 9a52283840..f624b1eb74 100644 --- a/.github/workflows/renovate.yaml +++ b/.github/workflows/renovate.yaml @@ -16,5 +16,7 @@ jobs: with: renovate-version: 38.114.0 token: ${{ secrets.GITHUB_TOKEN }} + env: + LOG_LEVEL: debug # vim:ts=2:sw=2:et From 4e717f3e83e7d4b4b5b82e6acc98e4d50b0ca856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 18:57:50 +0300 Subject: [PATCH 08/18] Pass configurationFile variable --- .github/workflows/renovate.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml index f624b1eb74..c51525178f 100644 --- a/.github/workflows/renovate.yaml +++ b/.github/workflows/renovate.yaml @@ -16,6 +16,7 @@ jobs: with: renovate-version: 38.114.0 token: ${{ secrets.GITHUB_TOKEN }} + configurationFile: renovate.json5 env: LOG_LEVEL: debug From c24fe962382ba4bac413a375a4c647b933323446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 18:58:43 +0300 Subject: [PATCH 09/18] Create renovate config based on - https://github.com/renovatebot/github-action/blob/2e30721a594e9d2a7643a69b1233ddb1c383e402/example/renovate-config.js --- renovate.json5 | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 renovate.json5 diff --git a/renovate.json5 b/renovate.json5 new file mode 100644 index 0000000000..2d3b74c873 --- /dev/null +++ b/renovate.json5 @@ -0,0 +1,25 @@ +{ + branchPrefix: "renovate-bot/", + username: "renovate-release", + gitAuthor: "Renovate Bot ", + onboarding: false, + platform: "github", + forkProcessing: "enabled", + dryRun: "full", + repositories: ['renovate-tests/cocoapods1', 'renovate-tests/gomod1'], + packageRules: [ + { + description: "lockFileMaintenance", + matchUpdateTypes: [ + "pin", + "digest", + "patch", + "minor", + "major", + "lockFileMaintenance", + ], + dependencyDashboardApproval: false, + minimumReleaseAge: 0, + }, + ], +} From 7b7962f5a122e008d321c6e9bcaf48639c2d30a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 19:02:41 +0300 Subject: [PATCH 10/18] Configure repositories --- renovate.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renovate.json5 b/renovate.json5 index 2d3b74c873..e498acda49 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -6,7 +6,7 @@ platform: "github", forkProcessing: "enabled", dryRun: "full", - repositories: ['renovate-tests/cocoapods1', 'renovate-tests/gomod1'], + repositories: ["Taxel/PlexTraktSync"], packageRules: [ { description: "lockFileMaintenance", From 87637a995eb66a6945b807c860a6d9af8922ad49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 19:05:09 +0300 Subject: [PATCH 11/18] Checkout is also needed --- .github/workflows/renovate.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml index c51525178f..37347ec697 100644 --- a/.github/workflows/renovate.yaml +++ b/.github/workflows/renovate.yaml @@ -11,6 +11,8 @@ jobs: renovate: runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v4.2.1 - name: Self-hosted Renovate uses: renovatebot/github-action@v40.3.4 with: From f49359ea4f8214ed7d5df11b1201b2e7b2bc77ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 19:09:09 +0300 Subject: [PATCH 12/18] Fix minimumReleaseAge type "message": "Configuration option `packageRules[0].minimumReleaseAge` should be a string" --- renovate.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renovate.json5 b/renovate.json5 index e498acda49..b388b63f91 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -19,7 +19,7 @@ "lockFileMaintenance", ], dependencyDashboardApproval: false, - minimumReleaseAge: 0, + minimumReleaseAge: "3", }, ], } From d9906a279115f09c1c34d4750c11b238d9243b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 19:11:10 +0300 Subject: [PATCH 13/18] Enable onboarding --- renovate.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renovate.json5 b/renovate.json5 index b388b63f91..2ced11fdeb 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -2,7 +2,7 @@ branchPrefix: "renovate-bot/", username: "renovate-release", gitAuthor: "Renovate Bot ", - onboarding: false, + onboarding: true, platform: "github", forkProcessing: "enabled", dryRun: "full", From 66eb67568208fe9bc5a2f0f37c539aed12d01d92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 19:17:46 +0300 Subject: [PATCH 14/18] Add schema to config --- renovate.json5 | 1 + 1 file changed, 1 insertion(+) diff --git a/renovate.json5 b/renovate.json5 index 2ced11fdeb..d2fe38a096 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -1,4 +1,5 @@ { + "$schema": "https://docs.renovatebot.com/renovate-schema.json", branchPrefix: "renovate-bot/", username: "renovate-release", gitAuthor: "Renovate Bot ", From 70879b68cc2a96652d8648e50ad5f83e0938ed55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 19:18:01 +0300 Subject: [PATCH 15/18] Remove dry-run flag --- renovate.json5 | 1 - 1 file changed, 1 deletion(-) diff --git a/renovate.json5 b/renovate.json5 index d2fe38a096..b394026e21 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -6,7 +6,6 @@ onboarding: true, platform: "github", forkProcessing: "enabled", - dryRun: "full", repositories: ["Taxel/PlexTraktSync"], packageRules: [ { From 3e72c80aef910067cbc7e9516d66b4daa05c03c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 19:24:26 +0300 Subject: [PATCH 16/18] Use dynamic repository path --- .github/workflows/renovate.yaml | 1 + renovate.json5 | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml index 37347ec697..51ba6c4dd1 100644 --- a/.github/workflows/renovate.yaml +++ b/.github/workflows/renovate.yaml @@ -20,6 +20,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} configurationFile: renovate.json5 env: + RENOVATE_REPOSITORIES: '["${{ github.repository }}"]' LOG_LEVEL: debug # vim:ts=2:sw=2:et diff --git a/renovate.json5 b/renovate.json5 index b394026e21..de328beaf2 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -6,7 +6,6 @@ onboarding: true, platform: "github", forkProcessing: "enabled", - repositories: ["Taxel/PlexTraktSync"], packageRules: [ { description: "lockFileMaintenance", From 2cb5b9d9d5d5e15c0292f7c58e7a807cf74049c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 19:26:07 +0300 Subject: [PATCH 17/18] Enable renovatebot/pre-commit-hooks --- .pre-commit-config.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f43d61a112..754dd8a9b4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,4 +34,9 @@ repos: # Optional extra validations from SchemaStore: additional_dependencies: ["validate-pyproject-schema-store[all]"] + - repo: https://github.com/renovatebot/pre-commit-hooks + rev: 38.128.3 + hooks: + - id: renovate-config-validator + # vim:ts=2:sw=2:et From e59440c379cd449f2022f111a1ebbb2a0f414a2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 20 Oct 2024 18:37:46 +0300 Subject: [PATCH 18/18] Temporarily remove other CI files --- .github/workflows/automerge.yml | 24 -------- .github/workflows/ci.yml | 29 --------- .github/workflows/docker-image.yml | 96 ------------------------------ .github/workflows/lint.yml | 13 ---- .github/workflows/pypi.yml | 68 --------------------- .github/workflows/test.yml | 31 ---------- 6 files changed, 261 deletions(-) delete mode 100644 .github/workflows/automerge.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/docker-image.yml delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/pypi.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml deleted file mode 100644 index 5d415a5ca4..0000000000 --- a/.github/workflows/automerge.yml +++ /dev/null @@ -1,24 +0,0 @@ -on: - workflow_call: - secrets: - github-token: - required: true - -jobs: - # https://github.com/fastify/github-action-merge-dependabot - automerge: - name: Dependabot auto-merge - runs-on: ubuntu-latest - if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }} - - permissions: - pull-requests: write - contents: write - - steps: - - uses: fastify/github-action-merge-dependabot@v3.11.2 - with: - target: minor - github-token: ${{ secrets.github-token }} - -# vim:ft=yaml:et:ts=2:sw=2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 42b9b2ac19..0000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: "CI" - -on: - push: - branches: - - main - tags: - - "*.*.*" - pull_request: - -jobs: - docker: - uses: ./.github/workflows/docker-image.yml - secrets: - github-token: ${{ secrets.GITHUB_TOKEN }} - - test: - uses: ./.github/workflows/test.yml - if: ${{ github.event_name == 'pull_request' }} - - automerge: - uses: ./.github/workflows/automerge.yml - needs: - - docker - - test - secrets: - github-token: ${{ secrets.GITHUB_TOKEN }} - -# vim:ft=yaml:et:ts=2:sw=2 diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml deleted file mode 100644 index bbfe2195af..0000000000 --- a/.github/workflows/docker-image.yml +++ /dev/null @@ -1,96 +0,0 @@ -# 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: Publish Docker image - -on: - workflow_call: - secrets: - github-token: - required: true - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - TEST_IMAGE: plextraktsync:ci-test - -jobs: - docker: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - name: Checkout repository - uses: actions/checkout@v5 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Set version variable - id: vars - run: | - if [[ "${GITHUB_REF#refs/heads/}" = "${GITHUB_REF}" ]]; then - APP_VERSION=${GITHUB_REF#refs/tags/} - else - git fetch --tags --unshallow - APP_VERSION=$(git describe --tags)_${GITHUB_REF#refs/heads/} - fi - echo "version=$APP_VERSION" >> $GITHUB_OUTPUT - - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.github-token }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=ref,event=branch - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/0.') }} - - - name: Build and export to Docker - uses: docker/build-push-action@v6 - env: - APP_VERSION: ${{ steps.vars.outputs.version }} - with: - context: . - load: true - tags: ${{ env.TEST_IMAGE }} - build-args: | - APP_VERSION=${{ env.APP_VERSION }} - cache-from: type=gha - cache-to: type=gha,mode=max - - - name: Self-test Docker image - run: | - docker run -e TRACE=1 --rm ${{ env.TEST_IMAGE }} test - - - name: Build and push Docker image - uses: docker/build-push-action@v6 - env: - APP_VERSION: ${{ steps.vars.outputs.version }} - with: - context: . - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - build-args: | - APP_VERSION=${{ env.APP_VERSION }} - cache-from: type=gha - cache-to: type=gha,mode=max -# vim:ts=2:sw=2:et diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index d79c627dfb..0000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Ruff Lint - -on: - - pull_request - -jobs: - ruff: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - uses: chartboost/ruff-action@v1 - -# vim:ts=2:sw=2:et diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml deleted file mode 100644 index bd77931a6b..0000000000 --- a/.github/workflows/pypi.yml +++ /dev/null @@ -1,68 +0,0 @@ -# This workflow 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: PyPI - -on: - workflow_dispatch: ~ - release: - types: [published] - push: - tags: - - "*.*.*" - -env: - DEFAULT_PYTHON: "3.10" - -jobs: - pypi: - name: Publish to PyPI - runs-on: ubuntu-latest - environment: - name: release - url: https://pypi.org/p/plextraktsync - steps: - - name: Checkout code - uses: actions/checkout@v5 - - - name: Set version variable - id: vars - run: | - if [[ "${GITHUB_REF#refs/heads/}" = "${GITHUB_REF}" ]]; then - APP_VERSION=${GITHUB_REF#refs/tags/} - else - git fetch --tags --unshallow - version=$(git describe --tags --abbrev=0) - subver=${{ github.run_number }} - APP_VERSION=$version.post$subver - fi - echo "version=$APP_VERSION" >> $GITHUB_OUTPUT - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: ${{ env.DEFAULT_PYTHON }} - - - name: Install dependencies and build - env: - APP_VERSION: ${{ steps.vars.outputs.version }} - run: | - set -x - # APP_VERSION=$(git describe --tags) - echo "__version__ = '$APP_VERSION'" > plextraktsync/__init__.py - cat plextraktsync/__init__.py - python -c "from plextraktsync import __version__; print(__version__)" - python -m pip install --upgrade build - # - # Patch requirements.txt fpor setuptools-declarative-requirements: - # https://github.com/s0undt3ch/setuptools-declarative-requirements/issues/6 - sed -i -e '/^-i/d' requirements.txt - python -m build - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_TOKEN }} -# vim:ts=2:sw=2:et diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 177b7d6157..0000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Test - -on: - workflow_call: - -env: - DEFAULT_PYTHON: "3.10" - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Check out source repository - uses: actions/checkout@v5 - - name: Set up Python environment - uses: actions/setup-python@v6 - with: - python-version: ${{ env.DEFAULT_PYTHON }} - cache: pip - - name: Install dependencies (pip) - run: python -m pip install -r requirements.txt -r requirements.pipenv.txt - - name: Install dependencies (pipenv) - run: pipenv install --deploy - - name: Install test dependencies - run: pip install -r tests/requirements.txt - - - name: "Test: info" - run: ./plextraktsync.sh info - - name: "Test: pytest" - run: pytest -# vim:ts=2:sw=2:et