Sync appVersion: 0.27.0 #39
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 charts | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- "charts/*/Chart.yaml" | |
permissions: {} | |
jobs: | |
prepare: | |
if: github.repository == 'Scalr/agent-helm' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
directory: [agent-k8s, agent-docker] | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get chart version | |
id: chart_version | |
run: | | |
set -euo pipefail | |
chart_version="$(grep -Po "(?<=^version: ).+" charts/${{ matrix.directory }}/Chart.yaml)" | |
echo "version=${chart_version}" >> $GITHUB_OUTPUT | |
- name: Get changelog entry | |
id: changelog_reader | |
uses: mindsers/changelog-reader-action@v2 | |
with: | |
path: charts/${{ matrix.directory }}/CHANGELOG.md | |
version: "v${{ steps.chart_version.outputs.version }}" | |
- name: Create release notes | |
run: | | |
set -euo pipefail | |
cat <<"EOF" > charts/${{ matrix.directory }}/RELEASE.md | |
${{ steps.changelog_reader.outputs.changes }} | |
EOF | |
- name: Upload RELEASE.md | |
uses: actions/upload-artifact@v3 | |
with: | |
name: release-notes-${{ matrix.directory }} | |
path: charts/${{ matrix.directory }}/RELEASE.md | |
release: | |
permissions: | |
contents: write # to push chart release and create a release (helm/chart-releaser-action) | |
if: github.repository == 'Scalr/agent-helm' | |
needs: prepare | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Download agent-k8s RELEASE.md | |
uses: actions/download-artifact@v3 | |
with: | |
name: release-notes-agent-k8s | |
path: charts/agent-k8s | |
- name: Download agent-docker RELEASE.md | |
uses: actions/download-artifact@v3 | |
with: | |
name: release-notes-agent-docker | |
path: charts/agent-docker | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
- name: Set-up Helm | |
uses: azure/setup-helm@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
version: latest | |
- name: Run chart-releaser | |
uses: helm/[email protected] | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
CR_SKIP_EXISTING: true | |
CR_MAKE_RELEASE_LATEST: false | |
CR_RELEASE_NOTES_FILE: RELEASE.md |