Skip to content

Commit

Permalink
fix: step to run chart releaser
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Falconieri committed Mar 17, 2023
1 parent 2c71891 commit f104670
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions .github/workflows/helm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,31 @@ jobs:
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.5.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Chart releaser
run: |
# Download chart releaser
curl -sSLo cr.tar.gz "https://github.com/helm/chart-releaser/releases/download/v1.2.1/chart-releaser_1.2.1_linux_amd64.tar.gz"
tar -xzf cr.tar.gz
rm -f cr.tar.gz
repo=$(cut -d '/' -f 2 <<< "$GITHUB_REPOSITORY")
owner=$(cut -d '/' -f 1 <<< "$GITHUB_REPOSITORY")
exists=$(curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/{{repo_name}}$repo/releases/tags/$repo-${{ steps.fix_tag.outputs.tag }} -w %{http_code} -o /dev/null)
if [[ $exists != "200" ]]; then
echo "Creating release..."
# package chart
./cr package ${{ inputs.chart_path }}/$repo
# upload chart to github releases
./cr upload \
--owner "$owner" \
--git-repo "$repo" \
--token "${{ secrets.GITHUB_TOKEN }}"
# Update index and push to github pages
./cr index \
--owner "$owner" \
--git-repo "$repo" \
--token "${{ secrets.GITHUB_TOKEN }}" \
--charts-repo ${{ inputs.chart_url }} \
--push
else
echo "Release already exists"
fi

0 comments on commit f104670

Please sign in to comment.