diff --git a/.github/workflows/prepare-release.yaml b/.github/workflows/prepare-release.yaml new file mode 100644 index 000000000..4a940226f --- /dev/null +++ b/.github/workflows/prepare-release.yaml @@ -0,0 +1,54 @@ +name: "Prepare the release" +on: + workflow_dispatch: + inputs: + version: + description: version of the operator to release + required: true + +jobs: + release: + runs-on: ubuntu-22.04 + steps: + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.20" + + - name: Generate token + id: generate_token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.PUBLISH_APP_ID }} + private_key: ${{ secrets.PUBLISH_APP_PRIVATE_KEY }} + installation_retrieval_payload: ${{ secrets.PUBLISH_APP_INSTALLATION_ID }} + installation_retrieval_mode: id + + - uses: actions/checkout@v4 + with: + token: ${{ steps.generate_token.outputs.token }} + + - name: Generate bundle + run: make bundle + env: + OPERATOR_VERSION: ${{inputs.version}} + IMG_PREFIX: ghcr.io/grafana/tempo-operator + + - name: Generate CHANGELOG + run: make chlog-update + env: + OPERATOR_VERSION: ${{inputs.version}} + + # Commit all changed files back to the repository + - name: Commit the changes to the repository and create PR + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git checkout -b release/v${OPERATOR_VERSION} + git add -A + git commit -m "Prepare Release ${{inputs.version}}" --author="${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" + git push -f --set-upstream origin release/v${OPERATOR_VERSION} + gh pr create --title='Prepare release v${OPERATOR_VERSION}' --assignee=${{ github.actor }} --reviewer=${{ github.actor }} --body='v${OPERATOR_VERSION}' + env: + OPERATOR_VERSION: ${{inputs.version}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0f3ceeb8f..7647a1abd 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,11 +1,7 @@ name: "Prepare the release" on: - workflow_dispatch: - inputs: - version: - description: version of the operator to release - required: true - + push: + tags: [ 'v*' ] jobs: release: @@ -17,28 +13,6 @@ jobs: go-version: "1.20" - uses: actions/checkout@v4 - - name: Generate bundle - run: make bundle - env: - OPERATOR_VERSION: ${{inputs.version}} - IMG_PREFIX: ghcr.io/grafana/tempo-operator - - - name: Generate CHANGELOG - run: make chlog-update - env: - OPERATOR_VERSION: ${{inputs.version}} - - # Commit all changed files back to the repository - - name: Commit the changes to the repository - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add -A - git commit -m "Release ${{inputs.version}}" --author="${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" - git push - git tag v${{inputs.version}} - git push origin v${{inputs.version}} - - name: "generate release resources" run: make release-artifacts env: