Skip to content

Create a better/more indepth changelog #70

Create a better/more indepth changelog

Create a better/more indepth changelog #70

Workflow file for this run

name: Version-Checker Release
on:
push:
branches:
- "release-v*"
tags:
- "v*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
prepair-release:
# Don't push back to a tag!
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
name: Prepair release
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v4
- uses: bhowell2/[email protected]
id: release_number
with:
value: ${{github.ref_name}}
index_of_str: "release-"
- name: Find and Replace Helm Chart Version
uses: jacobtomlinson/gha-find-replace@v3
with:
find: 'v(\d+)\.(\d+)\.(\d+)(-rc(\d)+)?'
replace: "${{steps.release_number.outputs.substring}}"
include: "deploy/charts/version-checker/Chart.yaml"
regex: true
- name: Find and Replace Kubernetes Manifests
uses: jacobtomlinson/gha-find-replace@v3
with:
find: 'v(\d+)\.(\d+)\.(\d+)(-rc(\d)+)?'
replace: "${{steps.release_number.outputs.substring}}"
include: "deploy/yaml/deploy.yaml"
regex: true
- name: Find and Replace Makefile versions
uses: jacobtomlinson/gha-find-replace@v3
with:
find: 'v(\d+)\.(\d+)\.(\d+)(-rc(\d)+)?'
replace: "${{steps.release_number.outputs.substring}}"
include: "Makefile"
regex: true
- name: Install Helm Docs
uses: envoy/[email protected]
with:
version: 1.11.0
- name: Update Helm Docs
run: |
set -ex
cd deploy/charts/version-checker
helm-docs
- name: Detect any Local Changes
uses: dorny/paths-filter@v3
id: filter
with:
base: HEAD
filters: |
versions:
- 'Makefile'
- 'deploy/yaml/deploy.yaml'
- 'deploy/charts/version-checker/Chart.yaml'
- name: Commit files
if: steps.filter.outputs.versions == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git status
git commit -a -m "Bump versions to ${{steps.release_number.outputs.substring}} "
- name: Push changes
if: steps.filter.outputs.versions == 'true'
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref_name }}
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v5
- name: Create Release PR
uses: devops-infra/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
target_branch: main
title: "Release ${{steps.release_number.outputs.substring}}"
body: |-
"**Automated Release Pull Request**
## Change log:
${{steps.github_release.outputs.changelog}}
draft: false
get_diff: false
allow_no_diff: false
helm-release:
runs-on: ubuntu-latest
steps:
# Checkout our Repo
- uses: actions/checkout@v4
with:
path: version-checker
- name: checkout jetstack-charts
uses: actions/checkout@v4
with:
token: ${{ secrets.JETSTACK_CHARTS_PAT }}
repository: jetstack/jetstack-charts
ref: main
path: jetstack-charts
- uses: azure/setup-helm@v4
with:
token: ${{ github.token }}
- name: package helm chart
run: |
helm package version-checker/deploy/charts/version-checker -d jetstack-charts/charts/
- name: Creating PR
if: startsWith(github.ref, 'refs/tags/')
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.JETSTACK_CHARTS_PAT }}
title: "Release version-checker ${{github.ref_name }}"
commit-message: "Release version-checker ${{github.ref_name }}"
branch: version-checker/${{github.ref_name}}
path: jetstack-charts
add-paths: charts/*.tgz
delete-branch: true
signoff: true
base: main
draft: ${{ !startsWith(github.ref, 'refs/tags/') }}
docker-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ matrix.platform }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
- name: Build and push (if applicable)
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ startsWith(github.ref, 'refs/tags/') }}
pull: true
tags: quay.io/jetstack/version-checker:${{github.ref_name}}
cache-from: type=gha
cache-to: type=gha,mode=max
github-release:
name: Create/Update GitHub Release
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create Release / Change Logs
uses: softprops/action-gh-release@v2
with:
draft: ${{ !startsWith(github.ref, 'refs/tags/') }}
prerelease: ${{ contains('-rc', github.ref_name) || !startsWith(github.ref, 'refs/tags/') }}
generate_release_notes: true