Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
liyaka committed Aug 27, 2024
1 parent d3d890b commit 3791aea
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 47 deletions.
69 changes: 23 additions & 46 deletions .github/workflows/publish_chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,20 @@ on:
paths:
- "charts/**"

env:
BASE_VERSION: "1.0"

jobs:
set-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Set version
id: version
run: |
BRANCH_NAME="${{ github.ref_name }}"
if [[ "${BRANCH_NAME}" == "main" ]]
then
echo 'version=${{env.BASE_VERSION}}.${{ github.run_number }}' | tee -a $GITHUB_OUTPUT
else
# Normalize branch name
fixedBranchName=$(echo "${BRANCH_NAME}" | sed 's/origin\///; s/\//-/g; s/_/-/g; s/.*/\L&/')
if [ ${#fixedBranchName} -gt 21 ]; then
fixedBranchName="${fixedBranchName:0:20}"
# remove dash at the end
while [ "${fixedBranchName: -1}" = "-" ]; do
fixedBranchName="${fixedBranchName%?}"
done
fi
VERSION="${{env.BASE_VERSION}}-${fixedBranchName}.${{ github.run_number }}"
echo "version=${VERSION}" | tee -a $GITHUB_OUTPUT
fi

publish-helm-chart:
needs:
- set-version
runs-on: ubuntu-latest
env:
VERSION_NAME: ${{ needs.set-version.outputs.version }}

steps:
- name: Checkout
uses: actions/[email protected]

- name: Install Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
version: v3.13.0

- name: Run lint on Helm chart
run: |
set -e
Expand All @@ -59,29 +32,33 @@ jobs:
helm lint --values values.yaml .
cd -
- name: Package helm chart
run: |
mkdir -p .cr-release-packages
cd .cr-release-packages
helm package --version ${{env.VERSION_NAME}} ../charts/public-test/
cd -
# - name: Package helm chart
# run: |
# mkdir -p .cr-release-packages
# cd .cr-release-packages
# helm package --version ${{env.VERSION_NAME}} ../charts/public-test/
# cd -

- name: Configure Git user
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions"
- name: Run chart-releaser
uses: helm/[email protected]
# with:
# skip_packaging: true
# skip_existing: true
# packages_with_index: true
uses: helm/chart-releaser-action@be16258da8010256c6e82849661221415f031968 # v1.5.0
with:
charts_dir: charts
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Summary
run: |
echo "Helm chart is published, version is : ${{env.VERSION_NAME}}" >> $GITHUB_STEP_SUMMARY
# - name: Run chart-releaser
# uses: helm/[email protected]
# # with:
# # skip_packaging: true
# # skip_existing: true
# # packages_with_index: true
# env:
# CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"



20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
# public-test
# public-test

## Usage
Helm must be installed to use the charts. Please refer to Helm’s documentation to get started.

Once Helm has been set up correctly, add the repo as follows:
``` bash
helm repo add public-test https://comet-ml.github.io/public-test
```
If you had already added this repo earlier, run helm repo update to retrieve the latest versions of the packages. You can then run helm search repo public-test to see the charts.

To install the public-test chart:
``` bash
helm install public-test public-test/public-test
```
To uninstall the chart:
```
helm delete public-test
```
Binary file removed charts/public-test/charts/nginx-13.2.9.tgz
Binary file not shown.

0 comments on commit 3791aea

Please sign in to comment.