Skip to content

Commit

Permalink
feat(ci): create release via release-please (#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwrau authored Dec 20, 2023
1 parent 1e9777a commit eb64f8b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 30 deletions.
2 changes: 0 additions & 2 deletions .github/cr.yaml

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/create-release-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ jobs:
- uses: google-github-actions/release-please-action@v3
with:
path: charts/${{ inputs.chart }}
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
release-type: helm
monorepo-tags: true
changelog-types: '[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","section":"Miscellaneous Chores"}]'
pull-request-title-pattern: "chore${scope}: [bot] release${component}:${version}"
separate-pull-requests: true
package-name: ${{ inputs.chart }}
command: release-pr
changelog-types: '[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","section":"Miscellaneous Chores"}]'
last-release-sha: ${{ steps.getLatestReleaseHash.outputs.hash }}
monorepo-tags: true
pull-request-title-pattern: "chore${scope}: [bot] release${component}:${version}"
release-type: helm
separate-pull-requests: true
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
38 changes: 16 additions & 22 deletions .github/workflows/release-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,32 @@ jobs:
needs: getChangedChart
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.ACTIONS_BOT_TOKEN }}

- name: Configure Git
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'

- run: pip install yq
- name: Extract and add helm repos and single out the changed chart
- name: Extract and add helm repos
id: helm-repos
env:
CHART: ${{ needs.getChangedChart.outputs.chart }}
run: |
set -ex
set -o pipefail
mkdir changed_charts
chart_dir="charts/${CHART}"
file="${chart_dir}/Chart.yaml"
yq -r '.dependencies[] | .repository' "$file" | sort -u | awk '{print NR " " $1}' | xargs -r -n 2 helm repo add
mv "${chart_dir}" changed_charts/
rm -rf charts
mv changed_charts charts
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.ACTIONS_BOT_TOKEN }}"
config: .github/cr.yaml
- name: Login to GitHub Container Registry
- run: helm package --dependency-update charts/${{ needs.getChangedChart.outputs.chart }}
- run: helm registry login ghcr.io --username teutonet-bot --password ${{ secrets.ACTIONS_BOT_TOKEN }}
- run: helm push ${{ needs.getChangedChart.outputs.chart }}-* "oci://ghcr.io/${GITHUB_REPOSITORY}"
- name: Change to github-actions[bot]
run: |
helm registry login ghcr.io --username teutonet-bot --password ${{ secrets.ACTIONS_BOT_TOKEN }}
- name: push chart to GHCR
run: helm push .cr-release-packages/${{ needs.getChangedChart.outputs.chart }}-* "oci://ghcr.io/${GITHUB_REPOSITORY}"
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: google-github-actions/release-please-action@v3
with:
path: charts/${{ needs.getChangedChart.outputs.chart }}
package-name: ${{ needs.getChangedChart.outputs.chart }}
command: github-release
changelog-types: '[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","section":"Miscellaneous Chores"}]'
release-type: helm
token: ${{ secrets.ACTIONS_BOT_TOKEN }}

0 comments on commit eb64f8b

Please sign in to comment.