From 922301924c64c77462cd14e919ed4c0277434d6e Mon Sep 17 00:00:00 2001 From: Sebastian Blum <64776588+seblum@users.noreply.github.com> Date: Wed, 3 Jul 2024 11:21:36 +0200 Subject: [PATCH] feat: add release-please pipeline (#28) --- .github/workflows/build-and-push-on-merge.yml | 34 +++++++++++++++++++ .github/workflows/create-release.yaml | 4 +-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-push-on-merge.yml b/.github/workflows/build-and-push-on-merge.yml index 8db2806..f4d319e 100644 --- a/.github/workflows/build-and-push-on-merge.yml +++ b/.github/workflows/build-and-push-on-merge.yml @@ -60,3 +60,37 @@ jobs: file: ./poetry.Dockerfile push: true tags: ${{ env.DOCKERREPO }}:${{ matrix.tags }} + + release: + name: 🚀 Release + runs-on: ubuntu-latest + needs: + - docker + permissions: + contents: write # to be able to publish a GitHub release + issues: write # to be able to comment on released issues + pull-requests: write # to be able to comment on released pull requests + steps: + - + uses: googleapis/release-please-action@v4 + name: 📦 Release + id: release + with: + release-type: "python" + - + uses: actions/checkout@v4 + - + name: 🏷️ Tag Major and Minor Versions + if: ${{ steps.release.outputs.release_created }} + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git" + git tag -d v${{ steps.release.outputs.major }} || true + git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true + git push origin :v${{ steps.release.outputs.major }} || true + git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true + git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}" + git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}" + git push origin v${{ steps.release.outputs.major }} + git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml index 41bfd81..af13005 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yaml @@ -1,9 +1,7 @@ name: Create release notes on: - push: - tags: - - 'v*.*.*' + workflow_dispatch: permissions: contents: write