release #127
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "release" | |
on: | |
release: {} | |
schedule: | |
- cron: 0 7 * * * | |
workflow_dispatch: | |
inputs: | |
release: | |
description: "the version to publish, if you just want to regen the changelog.md set 0.0.0" | |
required: true | |
type: string | |
check: | |
required: false | |
type: boolean | |
default: false | |
description: "check that everything is published correctly" | |
env: | |
CHARTS_REPO: "kumahq/charts" | |
LEGACY_BINARIES: "centos-amd64,darwin-amd64,darwin-arm64,debian-amd64,darwin-amd64,rhel-amd64,ubuntu-amd64,ubuntu-arm64" | |
BINARIES: "darwin-amd64,darwin-arm64,linux-amd64,linux-arm64" | |
DOCKER_REPO: "kumahq" | |
PULP_URL: "https://download.konghq.com/kuma-binaries-release/" | |
DOCKER_IMAGES: "kumactl,kuma-cp,kuma-dp,kuma-init,kuma-cni" | |
RELEASE: ${{ inputs.release || '0.0.0' }} | |
CHECK: ${{ inputs.check || 'false' }} | |
EDITION: kuma | |
MIN_VERSION: "1.2.0" | |
permissions: | |
contents: read | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
ref: "master" | |
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | |
with: | |
go-version-file: go.mod | |
- name: install-kuma-ci-tools | |
run: | | |
echo $(go env GOPATH)/bin >> $GITHUB_PATH | |
go install github.com/kumahq/ci-tools/cmd/release-tool@latest | |
- name: Generate GitHub app token | |
id: github-app-token | |
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: create-release | |
if: env.RELEASE != '0.0.0' | |
env: | |
GITHUB_TOKEN: ${{ steps.github-app-token.outputs.token }} | |
run: | | |
release-tool release changelog --repo ${{ github.repository }} --release ${{ env.RELEASE }} | |
- name: check-helm | |
if: env.RELEASE != '0.0.0' && fromJSON(env.CHECK) | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
run: | | |
release-tool release helm-chart --repo ${{ github.repository }} --charts-repo ${{ env.CHARTS_REPO }} --release ${{ env.RELEASE }} | |
- name: check-pulp-legacy | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
if: fromJSON(env.CHECK) && (startsWith(env.RELEASE, '2.1') || startsWith(env.RELEASE, '2.0') || startsWith(env.RELEASE, '1.')) | |
run: | | |
release-tool release pulp-binaries --repo ${{ github.repository }} --release ${{ env.RELEASE }} --binaries ${{ env.LEGACY_BINARIES }} | |
- name: check-pulp | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
if: fromJSON(env.CHECK) && !(startsWith(env.RELEASE, '2.1') || startsWith(env.RELEASE, '2.0') || startsWith(env.RELEASE, '1.')) | |
run: | | |
release-tool release pulp-binaries --repo ${{ github.repository }} --release ${{ env.RELEASE }} --binaries ${{ env.BINARIES }} --base-url ${{ env.PULP_URL }} | |
- name: check-docker | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
if: fromJSON(env.CHECK) | |
run: | | |
release-tool release docker --repo ${{ github.repository }} --release ${{ env.RELEASE }} --docker-repo ${{env.DOCKER_REPO }} --images ${{ env.DOCKER_IMAGES }} | |
- name: update-active-branches.json | |
env: | |
GITHUB_TOKEN: ${{ steps.github-app-token.outputs.token }} | |
run: | | |
release-tool version-file --repo ${{ github.repository }} --active-branches > active-branches.json | |
- name: update-versions.yml | |
env: | |
GITHUB_TOKEN: ${{ steps.github-app-token.outputs.token }} | |
run: | | |
release-tool version-file --repo ${{ github.repository }} --edition ${{ env.EDITION }} --min-version ${{ env.MIN_VERSION }} > versions.yml | |
- name: update-CHANGELOG.md | |
env: | |
GITHUB_TOKEN: ${{ steps.github-app-token.outputs.token }} | |
run: | | |
release-tool changelog.md --repo ${{ github.repository }} > CHANGELOG.md | |
- name: "Create Pull Request" | |
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2 | |
with: | |
commit-message: "docs(CHANGELOG.md): updating changelog and version files" | |
signoff: true | |
branch: chore/update-changelog | |
base: master | |
delete-branch: true | |
title: "docs(CHANGELOG.md): updating changelog and version files" | |
draft: false | |
labels: ci/skip-test,ci/auto-merge | |
token: ${{ steps.github-app-token.outputs.token }} | |
committer: kumahq[bot] <110050114+kumahq[bot]@users.noreply.github.com> | |
author: kumahq[bot] <110050114+kumahq[bot]@users.noreply.github.com> |