-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue in release workflow (#236)
Signed-off-by: Sergio Castaño Arteaga <[email protected]>
- Loading branch information
Showing
3 changed files
with
32 additions
and
5 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 |
---|---|---|
|
@@ -55,6 +55,33 @@ jobs: | |
- name: Install Helm | ||
uses: azure/setup-helm@v3 | ||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
run: | | ||
# From: https://github.com/metallb/metallb/blob/293f43c1f78ab1b5fa8879a76746b094bd9dd3ca/.github/workflows/publish.yaml#L134-L163 | ||
# Ref: https://github.com/helm/chart-releaser-action/issues/60 | ||
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" | ||
tar -xzf cr.tar.gz | ||
rm -f cr.tar.gz | ||
repo=$(basename "$GITHUB_REPOSITORY") | ||
owner=$(dirname "$GITHUB_REPOSITORY") | ||
tag="${GITHUB_REF_NAME:1}" | ||
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) | ||
if [[ $exists != "200" ]]; then | ||
echo "Creating release..." | ||
# package chart | ||
./cr package charts/$repo | ||
# upload chart to github releases | ||
./cr upload \ | ||
--owner "$owner" \ | ||
--git-repo "$repo" \ | ||
--release-name-template "{{ .Name }}-chart-{{ .Version }}" \ | ||
--token "${{ secrets.GITHUB_TOKEN }}" | ||
# Update index and push to github pages | ||
./cr index \ | ||
--owner "$owner" \ | ||
--git-repo "$repo" \ | ||
--index-path index.yaml \ | ||
--release-name-template "{{ .Name }}-chart-{{ .Version }}" \ | ||
--push | ||
else | ||
echo "Release already exists" | ||
fi |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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