Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): chart release workflow (backport #71) #86

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/helm-release-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
release-name-template: "v{{ .Version }}"
release-notes-file: release-notes.md
62 changes: 0 additions & 62 deletions .github/release-drafter.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
changelog:
categories:
- title: '🚀 Features'
labels:
- 'feat'
- title: '🔧 Fixes'
labels:
- 'fix'
- title: '📄 Documentation'
labels:
- 'docs'
- title: '⚙️ Maintenance'
labels:
- 'chore'
- 'ci'
- 'perf'
- 'test'
- 'build'
- title: 'Others'
labels:
- "*"
48 changes: 48 additions & 0 deletions .github/workflows/helm-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release Helm Chart

on:
workflow_dispatch:

jobs:
helm-release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Get release version
id: release-version
run: |
echo "tag=v$(yq .version charts/cryostat/Chart.yaml)" >> $GITHUB_OUTPUT
- name: Get previous version
id: previous-version
run: |
# Filter tags by regex, combine with the Chart version, sort by version number, and output the preceeding version.
chart_version="${{ steps.release-version.outputs.tag }}"
previous_version="$({ echo v${chart_version}; git tag -l | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$'; } | sort -V | grep -B1 "${chart_version}" | head -n1)"
echo "tag=${previous_version}" >> $GITHUB_OUTPUT
- name: Generate release notes
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: |
gh api --method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${GITHUB_REPOSITORY}/releases/generate-notes \
-f tag_name="${{ steps.release-version.outputs.tag }}" \
-f target_commitish="${GITHUB_REF_NAME}" \
-f previous_tag_name="${{ steps.previous-version.outputs.tag }}" | jq -r .body > charts/cryostat/release-notes.md
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.5.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
version: v1.5.0
charts_dir: charts
config: .github/helm-release-config.yml
23 changes: 0 additions & 23 deletions .github/workflows/release-drafter.yml

This file was deleted.

1 change: 1 addition & 0 deletions charts/cryostat/release-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- Release notes generated using configuration in .github/release.yml -->