Skip to content

Commit 8ab71bb

Browse files
authored
fix: chart could not be generated due to tagging. Use gh cli directly instead of chart-releaser-action (#111)
1 parent 642ec3b commit 8ab71bb

File tree

4 files changed

+39
-25
lines changed

4 files changed

+39
-25
lines changed

.github/workflows/build-publish.yml

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
outputs:
3232
tag_name: ${{ steps.create_release.outputs.tag_name }}
3333
steps:
34+
3435
- uses: googleapis/release-please-action@v4
3536
id: create_release
3637
with:
@@ -49,13 +50,7 @@ jobs:
4950
runs-on: ubuntu-20.04
5051
environment: production
5152
if: ${{ needs.release-please.outputs.tag_name != '' }}
52-
5353
steps:
54-
- name: Checkout
55-
uses: actions/checkout@v3
56-
with:
57-
fetch-depth: 0
58-
5954
- name: Set up Go
6055
uses: actions/setup-go@v4
6156
with:
@@ -71,6 +66,29 @@ jobs:
7166
run: |-
7267
echo '${{ steps.auth.outputs.access_token }}' | docker login -u oauth2accesstoken --password-stdin https://$GAR_LOCATION-docker.pkg.dev
7368
69+
- name: Checkout
70+
uses: actions/checkout@v3
71+
with:
72+
fetch-depth: 0
73+
74+
- name: Configure Git
75+
run: |
76+
git config user.name "$GITHUB_ACTOR"
77+
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
78+
79+
- name: Install Helm
80+
uses: azure/setup-helm@v3
81+
with:
82+
version: "v3.13.3"
83+
84+
- name: build chart
85+
env:
86+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
run: |-
88+
cd shibuya
89+
make helm_charts
90+
sh chart_releaser.sh
91+
7492
# Build the Docker image
7593
- name: Build api
7694
env:
@@ -84,19 +102,6 @@ jobs:
84102
run: |-
85103
cd shibuya && make controller_image component=controller
86104
87-
- name: Configure Git
88-
run: |
89-
git config user.name "$GITHUB_ACTOR"
90-
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
91105
92-
- name: Install Helm
93-
uses: azure/setup-helm@v3
94-
with:
95-
version: "v3.13.3"
96106
97-
- name: Run chart-releaser
98-
uses: helm/chart-releaser-action@v1.5.0
99-
with:
100-
charts_dir: shibuya/install
101-
env:
102-
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
107+

shibuya/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ controller_image: controller_build
3030

3131
.PHONY: helm_charts
3232
helm_charts:
33-
helm create shibuya-install
34-
helm package shibuya-install/
33+
helm package install/shibuya

shibuya/chart_releaser.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
chart_name=$(helm inspect chart install/shibuya | awk -F': ' '/^name:/ {print $2}')
4+
chart_version=$(helm inspect chart install/shibuya | awk -F': ' '/^version:/ {print $2}')
5+
chart_output=$chart_name-$chart_version
6+
if gh release view $chart_output; then
7+
echo "Release already exists!"
8+
else
9+
gh release create $chart_output --latest=false $chart_output.tgz --notes $chart_output -t $chart_output
10+
fi

shibuya/install/shibuya/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
2-
name: shibuya
3-
description: A Helm chart for Kubernetes
2+
name: shibuya-chart
3+
description: A Helm chart for deploying Shibuya
44

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

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

0 commit comments

Comments
 (0)