Skip to content

Commit

Permalink
fix(ci): release yatai-image-builder-crds
Browse files Browse the repository at this point in the history
  • Loading branch information
yetone committed Jan 6, 2023
1 parent 1d7c393 commit 171ee6d
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ jobs:
- name: Set up chart-testing
uses: helm/[email protected]

- name: Render Helm Template
- name: Render yatai-image-builder-crds Helm Template
working-directory: ./helm/yatai-image-builder-crds
run: make template

- name: Render yatai-image-builder Helm Template
working-directory: ./helm/yatai-image-builder
run: make template
20 changes: 18 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,31 @@ jobs:
echo ::set-output name=match::true
fi
- name: Package, Index and Publish to public repo
- name: Package, Index and Publish yatai-image-builder-crds to public repo
working-directory: ./helm/yatai-image-builder-crds
if: steps.check-tag.outputs.match != 'true'
env:
VERSION: ${{ steps.tag.outputs.tag }}
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
run: make release

- name: Package, Index and Publish yatai-image-builder-crds to devel repo
working-directory: ./helm/yatai-image-builder-crds
if: steps.check-tag.outputs.match == 'true'
env:
VERSION: ${{ steps.tag.outputs.tag }}
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
run: make release-devel

- name: Package, Index and Publish yatai-image-builder to public repo
working-directory: ./helm/yatai-image-builder
if: steps.check-tag.outputs.match != 'true'
env:
VERSION: ${{ steps.tag.outputs.tag }}
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
run: make release

- name: Package, Index and Publish to devel repo
- name: Package, Index and Publish yatai-image-builder to devel repo
working-directory: ./helm/yatai-image-builder
if: steps.check-tag.outputs.match == 'true'
env:
Expand Down
44 changes: 44 additions & 0 deletions helm/yatai-image-builder-crds/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.DEFAULT_GOAL := help

ifndef VERSION
VERSION := "0.0.1-dummy.1"
endif

ifndef CLONE_DIR
CLONE_DIR := $(shell mktemp -d)
endif

help: ## Show all Makefile targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

lint:
ct lint --all

cleanup:
rm yatai-image-builder-crds-*.tgz || true

release: cleanup
helm package . --version ${VERSION} --app-version ${VERSION}
if [ ${GITHUB_ACTIONS} ]; then git config --global user.name "github-actions[bot]"; fi
if [ ${GITHUB_ACTIONS} ]; then git config --global user.email "github-actions[bot]@users.noreply.github.com"; fi
if [ ${GITHUB_ACTIONS} ]; then git config --global credential.helper store; fi
git clone --single-branch --branch gh-pages "https://x-access-token:${API_TOKEN_GITHUB}@github.com/bentoml/helm-charts.git" "${CLONE_DIR}"
cp yatai-image-builder-crds-${VERSION}.tgz ${CLONE_DIR}/packages/
cd ${CLONE_DIR}; helm repo index .
cd ${CLONE_DIR}; git add . && git commit --message "release yatai-image-builder-crds ${VERSION}" && git push -f origin HEAD:gh-pages || exit 1
rm -rf ${CLONE_DIR} || true

release-devel: cleanup
helm package . --version ${VERSION} --app-version ${VERSION}
if [ ${GITHUB_ACTIONS} ]; then git config --global user.name "github-actions[bot]"; fi
if [ ${GITHUB_ACTIONS} ]; then git config --global user.email "github-actions[bot]@users.noreply.github.com"; fi
if [ ${GITHUB_ACTIONS} ]; then git config --global credential.helper store; fi
git clone --single-branch --branch gh-pages "https://x-access-token:${API_TOKEN_GITHUB}@github.com/bentoml/helm-charts-devel.git" "${CLONE_DIR}"
cp yatai-image-builder-crds-${VERSION}.tgz ${CLONE_DIR}/packages/
cd ${CLONE_DIR}; helm repo index .
cd ${CLONE_DIR}; git add . && git commit --message "release yatai-image-builder-crds ${VERSION}" && git push -f origin HEAD:gh-pages || exit 1
rm -rf ${CLONE_DIR} || true

template:
helm template yatai-image-builder-crds ./ -n yatai-image-builder-crds --debug

0 comments on commit 171ee6d

Please sign in to comment.