2023-06-27 19:16:40 +03:00
|
|
|
name: Release Charts
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-11-15 10:46:50 +03:00
|
|
|
branches: [canary]
|
2023-06-30 05:02:46 +03:00
|
|
|
paths:
|
|
|
|
- '.github/helm/**/Chart.yml'
|
2023-06-27 19:16:40 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-29 06:02:26 +03:00
|
|
|
uses: actions/checkout@v4
|
2023-06-27 19:16:40 +03:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Checkout Helm chart repo
|
2023-09-29 06:02:26 +03:00
|
|
|
uses: actions/checkout@v4
|
2023-06-27 19:16:40 +03:00
|
|
|
with:
|
|
|
|
repository: toeverything/helm-charts
|
|
|
|
path: .helm-chart-repo
|
|
|
|
ref: gh-pages
|
|
|
|
token: ${{ secrets.HELM_RELEASER_TOKEN }}
|
|
|
|
|
|
|
|
- name: Install Helm
|
|
|
|
uses: azure/setup-helm@v3
|
|
|
|
|
|
|
|
- name: Install chart releaser
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
arch="$(dpkg --print-architecture)"
|
|
|
|
curl -s https://api.github.com/repos/helm/chart-releaser/releases/latest \
|
|
|
|
| yq --indent 0 --no-colors --input-format json --unwrapScalar \
|
|
|
|
".assets[] | select(.name | test("\""^chart-releaser_.+_linux_${arch}\.tar\.gz$"\"")) | .browser_download_url" \
|
|
|
|
| xargs curl -SsL \
|
|
|
|
| tar zxf - -C /usr/local/bin
|
|
|
|
|
|
|
|
- name: Package charts
|
2023-06-28 15:30:02 +03:00
|
|
|
working-directory: .helm-chart-repo
|
|
|
|
run: |
|
|
|
|
mkdir -p .cr-index
|
|
|
|
helm repo add bitnami https://charts.bitnami.com/bitnami
|
|
|
|
helm repo update
|
|
|
|
|
2023-06-30 05:02:46 +03:00
|
|
|
helm dependencies build ../.github/helm/affine
|
2023-06-28 15:30:02 +03:00
|
|
|
helm dependencies build ../.github/helm/affine-cloud
|
2023-06-30 05:02:46 +03:00
|
|
|
cr package ../.github/helm/affine
|
2023-06-28 15:30:02 +03:00
|
|
|
cr package ../.github/helm/affine-cloud
|
|
|
|
|
2023-06-30 05:02:46 +03:00
|
|
|
- name: Publish charts
|
2023-06-27 19:16:40 +03:00
|
|
|
working-directory: .helm-chart-repo
|
|
|
|
run: |
|
|
|
|
set -ex
|
|
|
|
git config --local user.name "$GITHUB_ACTOR"
|
|
|
|
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
|
|
|
owner=$(cut -d '/' -f 1 <<< '${{ github.repository }}')
|
|
|
|
repo=helm-charts
|
|
|
|
git_hash=$(git rev-parse HEAD)
|
|
|
|
cr upload --commit "$git_hash" \
|
|
|
|
--git-repo "$repo" --owner "$owner" \
|
|
|
|
--token '${{ secrets.HELM_RELEASER_TOKEN }}' \
|
|
|
|
--skip-existing
|
|
|
|
cr index --git-repo "$repo" --owner "$owner" \
|
|
|
|
--token '${{ secrets.HELM_RELEASER_TOKEN }}' \
|
|
|
|
--index-path .cr-index --push
|