diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index dbffcfaed..0f3ceeb8f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,7 +1,11 @@ name: "Prepare the release" on: - push: - tags: [ 'v*' ] + workflow_dispatch: + inputs: + version: + description: version of the operator to release + required: true + jobs: release: @@ -11,9 +15,30 @@ jobs: uses: actions/setup-go@v4 with: 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: diff --git a/.gitignore b/.gitignore index af93dd08f..f591b5792 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,6 @@ kubeconfig website/public/* website/resources/* docs/prologue/contributing.md + +#IDE +.idea diff --git a/RELEASE.md b/RELEASE.md index e1f32d2bd..ebba87974 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -2,29 +2,13 @@ Steps to release a new version of the Tempo Operator: -1. Change the images tags to corresponding versions on `config/manager/controller_manager_config.yaml` the operator is usually aligned with the tempo versions. -1. Run `make bundle IMG_PREFIX=ghcr.io/grafana/tempo-operator OPERATOR_VERSION=x.y.z`, where `x.y.z` is the version that will be released +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 Note: The e2e tests require MinIO (`make deploy-minio`) and opentelemetry-operator to be installed in the cluster. ``` IMG_PREFIX=docker.io/your_username OPERATOR_VERSION=x.y.z BUNDLE_VARIANT=openshift OPERATOR_NAMESPACE=openshift-operators make bundle docker-build docker-push bundle-build bundle-push olm-deploy make e2e e2e-openshift ``` -1. Add the changes to the changelog, see Generating the changelog section. -1. Send a PR with the changes -1. Once the changes 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`) -1. The GitHub Workflow will take it from here, creating a GitHub release with the generated artifacts (manifests) and publishing the images -1. After the release, generate a new OLM bundle (`IMG_PREFIX=ghcr.io/grafana/tempo-operator make bundle`) and create two PRs against the `Community Operators repositories`: - 1. one for the `community-operators-prod`, used by OLM on OpenShift. Example: [`redhat-openshift-ecosystem/community-operators-prod`](https://github.com/redhat-openshift-ecosystem/community-operators-prod/pull/494) - 1. one for the `community-operators` directory, used by Operatorhub.io. Example: [`k8s-operatorhub/community-operators`](https://github.com/k8s-operatorhub/community-operators/pull/461) - -## Generating the changelog - -We use the chloggen to generate the changelog, simply run the following to generate the Changelog: - -```bash -OPERATOR_VERSION=x.y.z make chlog-update -``` - -This will delete all entries (other than the template) in the `.chloggen` directory and create a populated Changelog.md entry.