Skip to content

Commit 171ee6d

Browse files
committed
fix(ci): release yatai-image-builder-crds
1 parent 1d7c393 commit 171ee6d

File tree

3 files changed

+67
-3
lines changed

3 files changed

+67
-3
lines changed

.github/workflows/lint.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ jobs:
7575
- name: Set up chart-testing
7676
uses: helm/[email protected]
7777

78-
- name: Render Helm Template
78+
- name: Render yatai-image-builder-crds Helm Template
79+
working-directory: ./helm/yatai-image-builder-crds
80+
run: make template
81+
82+
- name: Render yatai-image-builder Helm Template
7983
working-directory: ./helm/yatai-image-builder
8084
run: make template

.github/workflows/release.yaml

+18-2
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,31 @@ jobs:
6767
echo ::set-output name=match::true
6868
fi
6969
70-
- name: Package, Index and Publish to public repo
70+
- name: Package, Index and Publish yatai-image-builder-crds to public repo
71+
working-directory: ./helm/yatai-image-builder-crds
72+
if: steps.check-tag.outputs.match != 'true'
73+
env:
74+
VERSION: ${{ steps.tag.outputs.tag }}
75+
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
76+
run: make release
77+
78+
- name: Package, Index and Publish yatai-image-builder-crds to devel repo
79+
working-directory: ./helm/yatai-image-builder-crds
80+
if: steps.check-tag.outputs.match == 'true'
81+
env:
82+
VERSION: ${{ steps.tag.outputs.tag }}
83+
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
84+
run: make release-devel
85+
86+
- name: Package, Index and Publish yatai-image-builder to public repo
7187
working-directory: ./helm/yatai-image-builder
7288
if: steps.check-tag.outputs.match != 'true'
7389
env:
7490
VERSION: ${{ steps.tag.outputs.tag }}
7591
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
7692
run: make release
7793

78-
- name: Package, Index and Publish to devel repo
94+
- name: Package, Index and Publish yatai-image-builder to devel repo
7995
working-directory: ./helm/yatai-image-builder
8096
if: steps.check-tag.outputs.match == 'true'
8197
env:
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
.DEFAULT_GOAL := help
2+
3+
ifndef VERSION
4+
VERSION := "0.0.1-dummy.1"
5+
endif
6+
7+
ifndef CLONE_DIR
8+
CLONE_DIR := $(shell mktemp -d)
9+
endif
10+
11+
help: ## Show all Makefile targets
12+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
13+
14+
lint:
15+
ct lint --all
16+
17+
cleanup:
18+
rm yatai-image-builder-crds-*.tgz || true
19+
20+
release: cleanup
21+
helm package . --version ${VERSION} --app-version ${VERSION}
22+
if [ ${GITHUB_ACTIONS} ]; then git config --global user.name "github-actions[bot]"; fi
23+
if [ ${GITHUB_ACTIONS} ]; then git config --global user.email "github-actions[bot]@users.noreply.github.com"; fi
24+
if [ ${GITHUB_ACTIONS} ]; then git config --global credential.helper store; fi
25+
git clone --single-branch --branch gh-pages "https://x-access-token:${API_TOKEN_GITHUB}@github.com/bentoml/helm-charts.git" "${CLONE_DIR}"
26+
cp yatai-image-builder-crds-${VERSION}.tgz ${CLONE_DIR}/packages/
27+
cd ${CLONE_DIR}; helm repo index .
28+
cd ${CLONE_DIR}; git add . && git commit --message "release yatai-image-builder-crds ${VERSION}" && git push -f origin HEAD:gh-pages || exit 1
29+
rm -rf ${CLONE_DIR} || true
30+
31+
release-devel: cleanup
32+
helm package . --version ${VERSION} --app-version ${VERSION}
33+
if [ ${GITHUB_ACTIONS} ]; then git config --global user.name "github-actions[bot]"; fi
34+
if [ ${GITHUB_ACTIONS} ]; then git config --global user.email "github-actions[bot]@users.noreply.github.com"; fi
35+
if [ ${GITHUB_ACTIONS} ]; then git config --global credential.helper store; fi
36+
git clone --single-branch --branch gh-pages "https://x-access-token:${API_TOKEN_GITHUB}@github.com/bentoml/helm-charts-devel.git" "${CLONE_DIR}"
37+
cp yatai-image-builder-crds-${VERSION}.tgz ${CLONE_DIR}/packages/
38+
cd ${CLONE_DIR}; helm repo index .
39+
cd ${CLONE_DIR}; git add . && git commit --message "release yatai-image-builder-crds ${VERSION}" && git push -f origin HEAD:gh-pages || exit 1
40+
rm -rf ${CLONE_DIR} || true
41+
42+
template:
43+
helm template yatai-image-builder-crds ./ -n yatai-image-builder-crds --debug
44+

0 commit comments

Comments
 (0)