From 3d1820520552ae2d6b75fa61ddda73d9907cdb0c Mon Sep 17 00:00:00 2001 From: Conrad Date: Tue, 29 Oct 2024 15:06:31 +0100 Subject: [PATCH 1/3] fix: fixed github pipeline --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82223a5..32cc355 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: tag_and_publish: runs-on: ubuntu-latest - if: github.head_ref == 'master' || github.head_ref == 'dev' + if: github.ref_name == 'dev' || github.ref_name == 'master' && github.event_name == 'push' needs: test permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing @@ -56,7 +56,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-tags: true - ref: ${{ github.head_ref }} + ref: ${{ github.ref_name }} fetch-depth: 0 - name: setup git @@ -67,7 +67,7 @@ jobs: - name: set version format id: version_format run: | - if [[ ${{ github.head_ref }} == 'master' ]]; then + if [[ ${{ github.ref_name }} == 'master' ]]; then echo "version_format=\${major}.\${minor}.\${patch}" >> $GITHUB_OUTPUT else echo "version_format=\${major}.\${minor}.\${patch}rc\${increment}" >> $GITHUB_OUTPUT @@ -84,7 +84,7 @@ jobs: version_format: ${{ steps.version_format.outputs.version_format }} - name: Create & Push Tag - if: github.head_ref == 'master' || github.head_ref == 'dev' + if: github.ref_name == 'master' || github.ref_name == 'dev' run: | git tag ${{ steps.git_version.outputs.version }} git push origin ${{ steps.git_version.outputs.version }} From eb64874c478fa7b6b97b0f893b3d349ebabc16f0 Mon Sep 17 00:00:00 2001 From: Conrad Date: Tue, 29 Oct 2024 15:13:36 +0100 Subject: [PATCH 2/3] fix: minor adjustment to the pipeline --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32cc355..3bc80e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,7 @@ on: jobs: lint: runs-on: ubuntu-latest + if: github.ref_name != 'master' steps: - uses: actions/checkout@v4 - uses: psf/black@stable @@ -35,6 +36,7 @@ jobs: test: runs-on: ubuntu-latest needs: lint + if: github.ref_name != 'master' steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -46,7 +48,7 @@ jobs: tag_and_publish: runs-on: ubuntu-latest - if: github.ref_name == 'dev' || github.ref_name == 'master' && github.event_name == 'push' + if: github.ref_name == 'dev' || github.ref_name == 'master' needs: test permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing From a6ded91185d3472bb6aea880dcd4363f7cc7b8ee Mon Sep 17 00:00:00 2001 From: Conrad Date: Tue, 29 Oct 2024 15:18:57 +0100 Subject: [PATCH 3/3] fix: syncing back tags to dev --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bc80e5..2f50bba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,6 +91,15 @@ jobs: git tag ${{ steps.git_version.outputs.version }} git push origin ${{ steps.git_version.outputs.version }} + - name: Sync tag to dev branch + if: github.ref_name == 'master' + run: | + git fetch origin dev + git checkout dev + git merge --no-ff ${{ steps.git_version.outputs.version }} + git push origin dev + git checkout master + - name: Set up Python uses: actions/setup-python@v5 with: