diff --git a/.github/workflows/release-pontos-manually.yml b/.github/workflows/release-pontos-manually.yml deleted file mode 100644 index dbf512a7..00000000 --- a/.github/workflows/release-pontos-manually.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Manually release gvm-libs with pontos - -on: - workflow_dispatch: - inputs: - branch: - description: 'Select branch that should be used for releasing' - required: false - default: 'main' - -jobs: - build-and-release: - name: Build and release with pontos - runs-on: "ubuntu-latest" - steps: - - name: Release with release action - uses: greenbone/actions/release@v2 - with: - conventional-commits: true - ref: ${{ github.event.inputs.branch }} - github-user: ${{ secrets.GREENBONE_BOT }} - github-user-mail: ${{ secrets.GREENBONE_BOT_MAIL }} - github-user-token: ${{ secrets.GREENBONE_BOT_TOKEN }} - gpg-key: ${{ secrets.GPG_KEY }} - gpg-fingerprint: ${{ secrets.GPG_FINGERPRINT }} - gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} diff --git a/.github/workflows/release-pontos.yml b/.github/workflows/release-pontos.yml new file mode 100644 index 00000000..82f93e7e --- /dev/null +++ b/.github/workflows/release-pontos.yml @@ -0,0 +1,34 @@ +name: Release gvm-libs with pontos + +on: + pull_request: + types: [closed] + workflow_dispatch: + +jobs: + build-and-release: + name: Create a new release with pontos + # If the event is a workflow_dispatch or the label 'make release' is set and PR is closed because of a merge + if: (github.event_name == 'workflow_dispatch') || (contains( github.event.pull_request.labels.*.name, 'make release') && github.event.pull_request.merged == true) + runs-on: "ubuntu-latest" + steps: + - name: Setting the Reference + run: | + if [[ "${{ github.event_name }}" = "workflow_dispatch" ]]; then + echo "RELEASE_REF=${{ github.ref_name }}" >> $GITHUB_ENV + else + echo "RELEASE_REF=${{ github.base_ref }}" >> $GITHUB_ENV + fi + - name: Release with release action + uses: greenbone/actions/release@v2 + with: + python-version: "3.10" + conventional-commits: true + github-user: ${{ secrets.GREENBONE_BOT }} + github-user-mail: ${{ secrets.GREENBONE_BOT_MAIL }} + github-user-token: ${{ secrets.GREENBONE_BOT_TOKEN }} + gpg-key: ${{ secrets.GPG_KEY }} + gpg-fingerprint: ${{ secrets.GPG_FINGERPRINT }} + gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} + strategy: calendar + ref: ${{ env.RELEASE_REF }}