-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
76379d8
commit f53add7
Showing
1 changed file
with
27 additions
and
50 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,56 +214,33 @@ jobs: | |
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Helm | ||
uses: azure/setup-helm@v4 | ||
|
||
- name: Generate Version | ||
id: version | ||
# - name: Install Helm | ||
# uses: azure/setup-helm@v4 | ||
|
||
# - name: Generate Version | ||
# id: version | ||
# run: | | ||
# # Use short commit SHA as the version | ||
# VERSION="0.1.0-$(git rev-parse --short HEAD)" | ||
# echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
|
||
# - name: Update chart version | ||
# run: | | ||
# for chart in deploy/helm/kubenetmon-agent deploy/helm/kubenetmon-server; do | ||
# sed -i "s/^version:.*/version: $VERSION/" $chart/Chart.yaml | ||
# sed -i "s/^appVersion:.*/appVersion: $VERSION/" $chart/Chart.yaml | ||
# done | ||
|
||
- name: Configure Git | ||
run: | | ||
# Use short commit SHA as the version | ||
VERSION="0.1.0-$(git rev-parse --short HEAD)" | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
- name: Run chart-releaser | ||
uses: helm/chart-releaser-action@v1.7.0 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Update chart version | ||
run: | | ||
for chart in deploy/helm/kubenetmon-agent deploy/helm/kubenetmon-server; do | ||
sed -i "s/^version:.*/version: $VERSION/" $chart/Chart.yaml | ||
sed -i "s/^appVersion:.*/appVersion: $VERSION/" $chart/Chart.yaml | ||
done | ||
- name: Package Helm charts | ||
run: | | ||
mkdir -p .cr-release-packages | ||
for chart in deploy/helm/kubenetmon-agent deploy/helm/kubenetmon-server; do | ||
helm package $chart --destination .cr-release-packages | ||
done | ||
- name: Upload Helm charts to GitHub Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: .cr-release-packages/* | ||
tag_name: latest | ||
generate_release_notes: true | ||
|
||
- name: Install Skopeo | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y skopeo | ||
- name: Push charts to GHCR | ||
run: | | ||
for chart in .cr-release-packages/*.tgz; do | ||
CHART_NAME=$(helm show chart $chart | grep '^name:' | awk '{print $2}') | ||
CHART_VERSION=$(helm show chart $chart | grep '^version:' | awk '{print $2}') | ||
helm push $chart oci://ghcr.io/clickhouse/kubenetmon/charts | ||
skopeo copy \ | ||
oci://ghcr.io/clickhouse/kubenetmon/charts/$CHART_NAME:$CHART_VERSION \ | ||
oci://ghcr.io/clickhouse/kubenetmon/charts/$CHART_NAME:latest | ||
done | ||
charts_dir: deploy/helm | ||
mark_as_latest: true | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
CR_GENERATE_RELEASE_NOTES: true |