chore(deps): update github-actions #361
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: "Chart - Release - Chores" | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- .github/workflows/chart-release-chores.yml | |
- .github/config/release-please/release-please-config.json | |
- .github/config/release-please/.release-please-manifest.json | |
permissions: | |
contents: write | |
pull-requests: write | |
env: | |
RELEASE_PLEASE_CONFIG: ".github/config/release-please/release-please-config.json" | |
RELEASE_PLEASE_MANIFEST: ".github/config/release-please/.release-please-manifest.json" | |
jobs: | |
chores: | |
if: github.head_ref == 'release-please--branches--main' | |
name: Generate release files | |
runs-on: ubuntu-latest | |
steps: | |
# | |
# Checkout. | |
# | |
- name: Generate GitHub token | |
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2 | |
id: generate-github-token | |
with: | |
app_id: ${{ secrets.GH_APP_ID_DISTRO_CI }} | |
private_key: ${{ secrets.GH_APP_PRIVATE_KEY_DISTRO_CI }} | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 0 | |
# | |
# Dependencies. | |
# | |
- name: Install dependencies | |
uses: asdf-vm/actions/install@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 # v3 | |
- name: Install readme-generator-for-helm | |
run: | | |
npm install -g @bitnami/readme-generator-for-helm | |
- name: Add Helm repos | |
run: | | |
make helm.repos-add | |
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
~/.asdf/installs/golang/*/packages/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
# | |
# Release chores. | |
# | |
- name: Set vars | |
run: | | |
echo "CHANGED_CHARTS=$(ct list-changed | tr '\n' ' ')" | tee -a $GITHUB_ENV | |
- name: Update PR info | |
env: | |
GH_TOKEN: '${{ steps.generate-github-token.outputs.token }}' | |
run: | | |
git fetch origin main:main | |
# Update PR title with changed versions. | |
versions="$(git log -p main..HEAD -- ${RELEASE_PLEASE_MANIFEST} | | |
awk -F ": " '/^+ /{gsub(/[",]/,""); printf "%s%s",sep,$2; sep=", "} END{print ""}')" | |
pr_nubmer="$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" }; { print $3 }')" | |
gh pr edit "${pr_nubmer}" --title "chore(release): Camunda Platform Helm Chart ${versions}" | |
# Set PR project. | |
gh pr edit "${pr_nubmer}" --add-project "Distribution Team" | |
# We use git-chglog to generate the release notes and release-please | |
# doesn't have an option to disable the generation of CHANGELOG.md files. | |
# https://github.com/googleapis/release-please/issues/2007 | |
- name: Clean up changelog files | |
run: | | |
rm -f charts/camunda-platform-*/CHANGELOG.md | |
- name: Update golden files | |
run: | | |
chartPath="${CHANGED_CHARTS}" \ | |
make go.update-golden-only | |
- name: Update README | |
run: | | |
chartPath="${CHANGED_CHARTS}" \ | |
make helm.readme-update | |
- name: Generate release notes | |
run: | | |
chartPath="${CHANGED_CHARTS}" \ | |
make release.generate-notes | |
- name: Generate release note footer | |
run: | | |
chartPath="${CHANGED_CHARTS}" \ | |
make release.generate-notes-footer | |
- name: Git pull | |
run: git pull --rebase --autostash . | |
- uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 | |
with: | |
author_name: "distro-ci[bot]" | |
author_email: "122795778+distro-ci[bot]@users.noreply.github.com" | |
message: "chore(release): update chart files" |