Skip to content

Commit

Permalink
fix: chart could not be generated due to tagging. Use gh cli directly…
Browse files Browse the repository at this point in the history
… instead of chart-releaser-action (#111)
  • Loading branch information
iandyh authored Jul 18, 2024
1 parent 642ec3b commit 8ab71bb
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 25 deletions.
45 changes: 25 additions & 20 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
outputs:
tag_name: ${{ steps.create_release.outputs.tag_name }}
steps:

- uses: googleapis/release-please-action@v4
id: create_release
with:
Expand All @@ -49,13 +50,7 @@ jobs:
runs-on: ubuntu-20.04
environment: production
if: ${{ needs.release-please.outputs.tag_name != '' }}

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
Expand All @@ -71,6 +66,29 @@ jobs:
run: |-
echo '${{ steps.auth.outputs.access_token }}' | docker login -u oauth2accesstoken --password-stdin https://$GAR_LOCATION-docker.pkg.dev
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: "v3.13.3"

- name: build chart
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |-
cd shibuya
make helm_charts
sh chart_releaser.sh
# Build the Docker image
- name: Build api
env:
Expand All @@ -84,19 +102,6 @@ jobs:
run: |-
cd shibuya && make controller_image component=controller
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: "v3.13.3"
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: shibuya/install
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
3 changes: 1 addition & 2 deletions shibuya/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ controller_image: controller_build

.PHONY: helm_charts
helm_charts:
helm create shibuya-install
helm package shibuya-install/
helm package install/shibuya
10 changes: 10 additions & 0 deletions shibuya/chart_releaser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

chart_name=$(helm inspect chart install/shibuya | awk -F': ' '/^name:/ {print $2}')
chart_version=$(helm inspect chart install/shibuya | awk -F': ' '/^version:/ {print $2}')
chart_output=$chart_name-$chart_version
if gh release view $chart_output; then
echo "Release already exists!"
else
gh release create $chart_output --latest=false $chart_output.tgz --notes $chart_output -t $chart_output
fi
6 changes: 3 additions & 3 deletions shibuya/install/shibuya/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: shibuya
description: A Helm chart for Kubernetes
name: shibuya-chart
description: A Helm chart for deploying Shibuya

# A chart can be either an 'application' or a 'library' chart.
#
Expand All @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: chart-v0.1.0
version: v0.1.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down

0 comments on commit 8ab71bb

Please sign in to comment.