Skip to content

Commit

Permalink
Improved release process (kedacore#918)
Browse files Browse the repository at this point in the history
  • Loading branch information
zroubalik authored Jul 8, 2020
1 parent 374adbe commit f738f6a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,16 @@ jobs:
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}

- name: Publish
- name: Publish KEDA images to Docker Hub
run: make publish
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}

- name: Release Deployment YAML files
run: make release
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}

# Get release information to determine id of the current release
- name: Get Release
id: get-release-info
Expand All @@ -46,7 +51,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Upload deployment YAML files as ZIP to GitHub release
- name: Upload Deployment YAML (zip)
- name: Upload Deployment YAML files (zip)
id: upload-deployment-yaml-zip
uses: actions/upload-release-asset@v1
env:
Expand All @@ -58,7 +63,7 @@ jobs:
asset_content_type: application/zip

# Upload deployment YAML files as TAR to GitHub release
- name: Upload Deployment YAML (tar.gz)
- name: Upload Deployment YAML files (tar.gz)
id: upload-deployment-yaml-tar
uses: actions/upload-release-asset@v1
env:
Expand Down
14 changes: 4 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,21 @@ publish: build
##################################################
K8S_DEPLOY_FILES = $(shell find ./deploy -name '*.yaml')

.PHONY: release
release: release_prepare release_file release_pkg

.PHONY: release_file
release_file:
.PHONY: set-version
set-version:
@sed -i 's@Version =.*@Version = "$(VERSION)"@g' ./version/version.go;
@for file in $(K8S_DEPLOY_FILES); do \
sed -i 's@app.kubernetes.io/version:.*@app.kubernetes.io/version: "$(VERSION)"@g' $$file; \
sed -i 's@image: docker.io/kedacore/keda:.*@image: docker.io/kedacore/keda:$(VERSION)@g' $$file; \
sed -i 's@image: docker.io/kedacore/keda-metrics-adapter:.*@image: docker.io/kedacore/keda-metrics-adapter:$(VERSION)@g' $$file; \
done

.PHONY: release_prepare
release_prepare:
.PHONY: release
release:
rm -rf ./keda-$(VERSION)
rm -f ./keda-$(VERSION).tar.gz
rm -f ./keda-$(VERSION).zip
mkdir -p ./keda-$(VERSION)/crds

.PHONY: release_pkg
release_pkg:
cp -r ./deploy/*.yaml ./keda-$(VERSION)
cp ./deploy/crds/*_crd.yaml ./keda-$(VERSION)/crds
tar -z -cf ./keda-$(VERSION).tar.gz keda-$(VERSION)/
Expand Down
10 changes: 6 additions & 4 deletions RELEASE-PROCESS.MD
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The next version will thus be 1.2.0

* Run the following command to update the version, setting the `VERSION` value to the next version, eg 1.2.0:
```bash
VERSION=1.2.0 make release
VERSION=1.2.0 make set-version
```
> Note: This will update the version labels and images in the yaml files located in the `deploy` folder as well as the version in `version.go`.
* Commit these changes.
Expand All @@ -23,11 +23,13 @@ Provide a new section in `CHANGELOG.md` for the new version that is being releas

It should not include every single change but solely what matters to our customers, for example issue template that has changed is not important.

## 3. Deploy the new KEDA images to Docker Hub
## 3. Create KEDA release on GitHub

The Docker Hub repo with all the different images can be seen here: https://hub.docker.com/r/kedacore/keda/tags
Creating a new release in the releases page (https://github.com/kedacore/keda/release) will trigger a GitHub workflow which will create a new image with the latest code and tagged with the next version (in this example 1.2.0) and also change the latest tag to point to this image as well.

Creating a new release in the the releases page (https://github.com/kedacore/keda/release) will trigger a GitHub workflow which will create a new image with the latest code and tagged with the next version (in this example 1.2.0) and also change the latest tag to point to this image as well.
Archives (.zip and .tar.gz) containing KEDA Deployment YAML files are also automatically created and attached to the Release as part of the workflow.

> Note: The Docker Hub repo with all the different images can be seen here: https://hub.docker.com/r/kedacore/keda/tags

## 4. Publish documentation for new version

Expand Down

0 comments on commit f738f6a

Please sign in to comment.