File tree Expand file tree Collapse file tree 3 files changed +32
-5
lines changed Expand file tree Collapse file tree 3 files changed +32
-5
lines changed Original file line number Diff line number Diff line change 5555 - name : Install Helm
5656 uses : azure/setup-helm@v3
5757 - name : Run chart-releaser
58- 59- env :
60- CR_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
58+ run : |
59+ # From: https://github.com/metallb/metallb/blob/293f43c1f78ab1b5fa8879a76746b094bd9dd3ca/.github/workflows/publish.yaml#L134-L163
60+ # Ref: https://github.com/helm/chart-releaser-action/issues/60
61+ curl -sSLo cr.tar.gz "https://github.com/helm/chart-releaser/releases/download/v1.5.0/chart-releaser_1.5.0_linux_amd64.tar.gz"
62+ tar -xzf cr.tar.gz
63+ rm -f cr.tar.gz
64+ repo=$(basename "$GITHUB_REPOSITORY")
65+ owner=$(dirname "$GITHUB_REPOSITORY")
66+ tag="${GITHUB_REF_NAME:1}"
67+ exists=$(curl -s -H "Accept: application/vnd.github.v3+json" https://github.com/$GITHUB_REPOSITORY/releases/tag/$repo-chart-$tag -w %{http_code} -o /dev/null)
68+ if [[ $exists != "200" ]]; then
69+ echo "Creating release..."
70+ # package chart
71+ ./cr package charts/$repo
72+ # upload chart to github releases
73+ ./cr upload \
74+ --owner "$owner" \
75+ --git-repo "$repo" \
76+ --release-name-template "{{ .Name }}-chart-{{ .Version }}" \
77+ --token "${{ secrets.GITHUB_TOKEN }}"
78+ # Update index and push to github pages
79+ ./cr index \
80+ --owner "$owner" \
81+ --git-repo "$repo" \
82+ --index-path index.yaml \
83+ --release-name-template "{{ .Name }}-chart-{{ .Version }}" \
84+ --push
85+ else
86+ echo "Release already exists"
87+ fi
Original file line number Diff line number Diff line change 11[package ]
22name = " gitvote"
33description = " GitVote server"
4- version = " 0.1 .0"
4+ version = " 0.2 .0"
55license = " Apache-2.0"
66edition = " 2021"
77
You can’t perform that action at this time.
0 commit comments