From 62ecc4e986d717ebdfbcc8eef5440cfecab51c78 Mon Sep 17 00:00:00 2001 From: Cian Hughes Date: Fri, 23 May 2025 13:01:56 +0100 Subject: [PATCH] Improved workflows --- .github/workflows/publish.yml | 26 ++++++++++++++++++++++++++ .github/workflows/tagging.yml | 20 ++++++++++++++++++++ .github/workflows/tests.yml | 11 +++++------ 3 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/tagging.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..b43be1b --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,26 @@ +name: Publish to PyPI + +on: + workflow_run: + workflows: + - Auto Version Tag + types: + - completed + +jobs: + publish: + runs-on: ubuntu-latest + environment: release + steps: + - uses: actions/checkout@v4 + - name: Set up uv + uses: astral-sh/setup-uv@v6 + with: + python-version: "${{ matrix.python-version }}" + enable-cache: true + cache-dependency-glob: | + pyproject.toml + - name: Build package + run: uv build + - name: Publish to PyPI + run: uv publish --token ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/tagging.yml b/.github/workflows/tagging.yml new file mode 100644 index 0000000..c6e8043 --- /dev/null +++ b/.github/workflows/tagging.yml @@ -0,0 +1,20 @@ +name: Auto Version Tag + +on: + workflow_run: + workflows: + - Tests + types: + - completed + +jobs: + tag: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Version tag + uses: Jorricks/action-python-autotagging@1.0.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + path: invenio_theme_iform/__about__.py + variable: __version__ diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6a1bf28..15658e8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,16 +6,15 @@ # modify it under the terms of the MIT License; see LICENSE file for more # details. -name: CI +name: Tests on: push: - branches: master + branches: + - master pull_request: - branches: master - schedule: - # * is a special character in YAML so you have to quote this string - - cron: "0 3 * * 6" + branches: + - master workflow_dispatch: inputs: reason: