From aba0b0773f1a1d677beec86775f72de10ef92d44 Mon Sep 17 00:00:00 2001 From: Adrian Cederberg Date: Wed, 21 Aug 2024 16:45:23 -0600 Subject: [PATCH] fix(package): Added option to only bump semver tag. Tests should only run when sources, tests, or workflows are changed. --- .github/workflows/pr_checks.yaml | 5 +++++ .github/workflows/version.yaml | 26 ++++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 73294b0..ad8b33f 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -5,6 +5,11 @@ on: branches: - master - develop + paths: + - ./src/** + - ./tests/** + - ./docker/** + pull_request: branches: - master diff --git a/.github/workflows/version.yaml b/.github/workflows/version.yaml index 6583472..8f56a1c 100644 --- a/.github/workflows/version.yaml +++ b/.github/workflows/version.yaml @@ -9,23 +9,25 @@ on: kind: default: patch required: true - description: Segment of the version to increment. + description: | + Segment of the version to increment. A value of `tag` indicates + that only the tag should be updated. options: + - tag - patch - minor - major kind_tag: - default: final + default: alpha required: true description: | Tag of the new version. Cannot go backwards, ordered like - ``final > alpha > beta``. ``final`` indicates no tag. + ``final > beta > alpha``. ``final`` indicates no tag. options: - final - alpha - beta - tag_message: required: true description: | @@ -60,10 +62,18 @@ jobs: git config user.name "github-actions" git config user.email "<>" - python -m bumpver update "--${{ github.event.inputs.kind }}" \ - --tag "${{ github.event.inputs.kind_tag }}" \ - --tag-message "${{ github.event.inputs.tag_message }}" \ - --commit + if [[ "${{ github.event.inputs.kind}}" == "tag" ]]; + then + python -m bumpver update \ + --tag "${{ github.event.inputs.kind_tag }}" \ + --tag-message "${{ github.event.inputs.tag_message }}" \ + --commit + else + python -m bumpver update "--${{ github.event.inputs.kind }}" \ + --tag "${{ github.event.inputs.kind_tag }}" \ + --tag-message "${{ github.event.inputs.tag_message }}" \ + --commit + fi echo "CAPTURA_VERSION=$( python -m bumpver --version )" >> $GITHUB_ENV