From 8852597819492638454c0003261f78576c24db20 Mon Sep 17 00:00:00 2001 From: pomo Date: Fri, 12 Apr 2024 13:29:51 +0200 Subject: [PATCH] fix: ci --- .github/workflows/bump_version.yaml | 25 +++++++++++++++++++++++++ .github/workflows/release.yaml | 28 ++-------------------------- 2 files changed, 27 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/bump_version.yaml diff --git a/.github/workflows/bump_version.yaml b/.github/workflows/bump_version.yaml new file mode 100644 index 0000000..a26c61f --- /dev/null +++ b/.github/workflows/bump_version.yaml @@ -0,0 +1,25 @@ +on: + pull_request: + branches: + - main + types: [closed] + +jobs: + bump_version: + if: ${{ github.event.pull_request.merged }} + runs-on: ubuntu-latest + name: "Bump version and create changelog with commitizen" + steps: + - name: Check out + uses: actions/checkout@v3 + with: + fetch-depth: 0 + token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}" + - id: cz + name: Create bump and changelog + uses: commitizen-tools/commitizen-action@master + continue-on-error: true + with: + github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + - name: Print Version + run: echo "Bumped to version ${{ steps.cz.outputs.version }}" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 031b39a..aa09a8c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,35 +1,11 @@ on: push: - branches: [main] + tags: + - "v*.*.*" jobs: - bump_version: - if: "!startsWith(github.event.head_commit.message, 'bump:')" - runs-on: ubuntu-latest - name: "Bump version and create changelog with commitizen" - steps: - - name: Check out - uses: actions/checkout@v3 - with: - fetch-depth: 0 - token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}" - - id: cz - name: Create bump and changelog - uses: commitizen-tools/commitizen-action@master - continue-on-error: true - with: - github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - name: Print Version - run: echo "Bumped to version ${{ steps.cz.outputs.version }}" - outputs: - outcome: ${{ steps.cz.outcome }} - conclusion: ${{ steps.cz.conclusion }} - release: - # if a bump version failed or was not executed, do not release - needs: bump_version runs-on: ubuntu-latest - if: needs.bump_version.outputs.outcome == 'success' || needs.bump_version.outputs.conclusion == 'success' steps: - name: Install Poetry uses: snok/install-poetry@v1