From ab490cb1d983d24928487de84fe8ae24e6dcd14d Mon Sep 17 00:00:00 2001 From: Ruben Vargas Date: Mon, 23 Oct 2023 23:13:39 -0600 Subject: [PATCH 1/2] Generate PR for release instead of commit to main Signed-off-by: Ruben Vargas --- .github/workflows/prepare-release.yaml | 53 ++++++++++++++++++++++++++ .github/workflows/release.yaml | 32 ++-------------- 2 files changed, 56 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/prepare-release.yaml diff --git a/.github/workflows/prepare-release.yaml b/.github/workflows/prepare-release.yaml new file mode 100644 index 000000000..c558835e3 --- /dev/null +++ b/.github/workflows/prepare-release.yaml @@ -0,0 +1,53 @@ +name: "Prepare the release" +on: + workflow_dispatch: + inputs: + version: + description: version of the operator to release + required: true + +jobs: + prepare-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${{ inputs.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${{ inputs.version }} + gh pr create --title='Prepare release v${{ inputs.version }}' --assignee=${{ github.actor }} --reviewer=${{ github.actor }} --body='v${{ inputs.version }}' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0f3ceeb8f..7d5642c97 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,11 +1,7 @@ -name: "Prepare the release" +name: "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: From 866b0b187ec282093175ad0e01f1c0db44890729 Mon Sep 17 00:00:00 2001 From: Ruben Vargas Date: Mon, 23 Oct 2023 23:41:02 -0600 Subject: [PATCH 2/2] update RELEASE.md documentation Signed-off-by: Ruben Vargas --- RELEASE.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index ebba87974..0c2001d4d 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -3,9 +3,10 @@ Steps to release a new version of the Tempo Operator: 1. Checkout the main branch, and make sure you have the latest changes. -1. Build, deploy and, run OpenShift tests locally against an OpenShift cluster `make e2e-openshift`. A locally installed [CRC](https://github.com/crc-org/crc) cluster can be used for testing. 1. Go to GitHub Actions Tab, In the left sidebar, choose "Prepare Release" Workflow, then push in the "Run workflow" button , select the main branch and type the version of operator to release -1. Push "Run workflow", this will trigger the process to generate the CHANGELOG and publish the images, and create the GitHub release +1. Push "Run workflow", this will trigger the process to generate the CHANGELOG and generate the bundle, this will create a PR with the title "Prepare Release vx.y.z`" +1. Once the PR is created, use that branch to build, deploy and, run OpenShift tests locally against an OpenShift cluster `make e2e-openshift`. A locally installed [CRC](https://github.com/crc-org/crc) cluster can be used for testing. +1. Once the PR above are merged and available in the `main` branch, tag it with the desired version, prefixed with `v`: `vx.y.z` (e.g. `git tag v0.1.0 && git push origin v0.1.0`) Note: The e2e tests require MinIO (`make deploy-minio`) and opentelemetry-operator to be installed in the cluster. ```