From 9c0d8948a32b0ad9bc2060daf02c522386c09c12 Mon Sep 17 00:00:00 2001 From: Meysam Azad Date: Mon, 11 Nov 2024 11:09:07 +0700 Subject: [PATCH] feat(CI): add release please --- .github/workflows/ci.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b7f58f..dc4d864 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,8 +52,26 @@ jobs: kubescape: true kubescape-upload-sarif: true + release-please: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + outputs: + releases_created: ${{ steps.release-please.outputs.releases_created }} + tag_name: ${{ steps.release-please.outputs.tag_name }} + steps: + - id: release-please + name: Release please + uses: googleapis/release-please-action@v4 + with: + release-type: simple + build-tag: - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + needs: + - release-please + if: needs.release-please.outputs.releases_created == 'true' runs-on: ubuntu-latest permissions: contents: read @@ -63,7 +81,7 @@ jobs: with: image-name: ghcr.io/${{ github.repository }} image-extra-tags: | - ghcr.io/${{ github.repository }}:${{ github.ref_name }} + ghcr.io/${{ github.repository }}:${{ needs.release-please.outputs.tag_name }} platforms: linux/amd64,linux/arm64 kubescape: true