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

Fix release workflow #14

Merged
merged 1 commit into from
Aug 14, 2024
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
16 changes: 16 additions & 0 deletions .github/updatecli/helm-appversion.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
sources:
steampipe:
kind: dockerimage
spec:
image: turbot/steampipe
architecture: linux/amd64
versionfilter:
kind: semver
conditions: {}
targets:
chartVersion:
name: bump appversion
kind: yaml
spec:
file: charts/Chart.yaml
key: $.appVersion
26 changes: 14 additions & 12 deletions .github/workflows/check-changes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,32 @@ jobs:
with:
fetch-depth: 0

- name: Get latest release
id: latest_release
run: |
latest_release=$(curl -s https://api.github.com/repos/turbot/steampipe/releases | jq -r '.[0].name')
echo "latest_release=$latest_release" >> $GITHUB_OUTPUT

- name: Get current release
id: current_release
run: |
current_release=$(grep appVersion charts/Chart.yaml | awk '{ print $2 }')
echo "current_release=$current_release" >> $GITHUB_OUTPUT

- name: Install updatecli
uses: updatecli/updatecli-action@v2

- name: Update dependencies
run: |
updatecli apply --config .github/updatecli/helm-appversion.yaml --commit=false

- name: Get latest release
id: latest_release
run: |
latest_release=$(grep appVersion charts/Chart.yaml | awk '{ print $2 }')
echo "latest_release=$latest_release" >> $GITHUB_OUTPUT

- name: Check if release changed
id: check_changes
run: |
if [ ${{ steps.latest_release.outputs.latest_release }} != ${{ steps.current_release.outputs.current_release }} ]; then
echo "release_changed=true" >> $GITHUB_OUTPUT
fi

- name: Set new Chat.yaml appVersion
if: steps.check_changes.outputs.release_changed == 'true'
run: |
sed -i "s/appVersion: .*/appVersion: ${{ steps.latest_release.outputs.latest_release }}/g" charts/Chart.yaml

- name: Update README.md Helm Chart
if: steps.check_changes.outputs.release_changed == 'true'
uses: losisin/helm-docs-github-action@v1
Expand All @@ -59,7 +61,7 @@ jobs:
- :information_source: Current: `${{ steps.current_release.outputs.current_release }}`
- :up: Upgrade: `${{ steps.latest_release.outputs.latest_release }}`

Changelog: https://api.github.com/repos/turbot/steampipe/releases/tag/${{ steps.latest_release.outputs.latest_release }}
Changelog: https://github.com/turbot/steampipe/releases/tag/v${{ steps.latest_release.outputs.latest_release }}
labels: |
auto-pr-bump-version
team-reviewers: devops-ia
2 changes: 1 addition & 1 deletion charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: steampipe
description: A Helm chart for Kubernetes to deploy Steampipe
type: application
version: 1.0.0
appVersion: "0.22.0"
appVersion: 0.22.0
home: https://github.com/devops-ia/helm-steampipe
sources:
- https://github.com/turbot/steampipe
Expand Down