Skip to content

Commit

Permalink
Automate release process (#581)
Browse files Browse the repository at this point in the history
* Automate release process

Signed-off-by: Ruben Vargas <[email protected]>

* Update RELEASE.md

Signed-off-by: Ruben Vargas <[email protected]>

* Remove third party dependency

Signed-off-by: Ruben Vargas <[email protected]>

* fix git command

Signed-off-by: Ruben Vargas <[email protected]>

* set username, email and author on commit

Signed-off-by: Ruben Vargas <[email protected]>

* more fixes

Signed-off-by: Ruben Vargas <[email protected]>

* more fixes

Signed-off-by: Ruben Vargas <[email protected]>

* fix tag push

Signed-off-by: Ruben Vargas <[email protected]>

* Delete .idea folder

Signed-off-by: Ruben Vargas <[email protected]>

* ignore .idea folder

Signed-off-by: Ruben Vargas <[email protected]>

---------

Signed-off-by: Ruben Vargas <[email protected]>
  • Loading branch information
rubenvp8510 authored Sep 15, 2023
1 parent e9922ec commit 8f5cc4e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 22 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ kubeconfig
website/public/*
website/resources/*
docs/prologue/contributing.md

#IDE
.idea
22 changes: 3 additions & 19 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 8f5cc4e

Please sign in to comment.