Add minikube to create volume snapshot development environment locall… #1636
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright (C) 2019-2023 vdaas.org vald team <[email protected]> | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# You may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# https://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# | |
name: Run semver | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
dump-contexts-to-log: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/dump-context | |
semver-auto: | |
name: Run semver-auto | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/vdaas/vald/vald-ci-container:nightly | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.DISPATCH_TOKEN }} | |
- name: Set Git config | |
run: | | |
git config --global --add safe.directory ${GITHUB_WORKSPACE} | |
- uses: crazy-max/ghaction-import-gpg@v4 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- name: Get latest gitwerk | |
run: | | |
curl -fsSLO \ | |
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ | |
https://github.com/rinx/gitwerk/releases/latest/download/gitwerk-linux-amd64.zip | |
unzip gitwerk-linux-amd64.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run gitwerk semver-auto | |
id: semver | |
run: | | |
GITWERK_RESULT=`./gitwerk --stdin sv << EOF | |
(defn sv [] | |
(let [repo (git/repo ".") | |
message (-> repo | |
(git/latest-log) | |
:full-message) | |
tag (or (-> repo | |
(git/tags) | |
(semver/latest-tag)) | |
(semver/default-version-str)) | |
new-tag (semver/contextual-semver message tag)] | |
(if (not (= tag new-tag)) | |
new-tag | |
"not-updated"))) | |
EOF` | |
if [ "${GITWERK_RESULT}" = "not-updated" ]; then | |
echo "version not updated" | |
exit 0 | |
fi | |
echo "version updated: ${GITWERK_RESULT}" | |
git checkout main | |
LAST_COMMIT_MESSAGE=`git log --pretty=format:%s -1` | |
PR_NUM=`echo "$LAST_COMMIT_MESSAGE" | grep -o "#[[:digit:]]\+" | sed -e 's/#//' | head -1` | |
PREVIOUS_VERSION=`cat versions/VALD_VERSION` | |
echo "${GITWERK_RESULT}" > versions/VALD_VERSION | |
sed -i -e "s/^version: .*$/version: ${GITWERK_RESULT}/" charts/vald/Chart.yaml | |
sed -i -r "s/^(\s*)tag\s*:\s*v[0-9]+\.[0-9]+\.[0-9]+\s*$/\1tag: ${GITWERK_RESULT}/" charts/vald/values.yaml | |
sed -i -e "s/^version: .*$/version: ${GITWERK_RESULT}/" charts/vald-helm-operator/Chart.yaml | |
sed -i -r "s/^(\s*)tag\s*:\s*v[0-9]+\.[0-9]+\.[0-9]+\s*$/\1tag: ${GITWERK_RESULT}/" charts/vald-helm-operator/values.yaml | |
make helm/schema/vald | |
make helm/schema/vald-helm-operator | |
make helm/schema/crd/vald | |
make helm/schema/crd/vald-helm-operator | |
make k8s/manifest/update | |
make k8s/manifest/helm-operator/update | |
make helm/docs/vald | |
make helm/docs/vald-helm-operator | |
BODY="" | |
if [ ! -z "${PR_NUM}" ]; then | |
BODY=`curl -s -H "Authorization: Bearer ${GITHUB_TOKEN}" "https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${PR_NUM}" | jq -r '.body'` | |
fi | |
if [ -z "$BODY" ]; then | |
BODY=`git log --pretty=format:'- %s' ${PREVIOUS_VERSION}..main | grep "#[[:digit:]]\+" | sed -e "s/\[\(patch\|minor\|major\)\] *//g" | sed -e "s%#\([[:digit:]]\+\)%[&](https://github.com/vdaas/vald/pull/\1)%"` | |
fi | |
CHANGELOG=`make changelog/next/print BODY="$BODY"` | |
make changelog/update BODY="$BODY" | |
make format | |
git add \ | |
CHANGELOG.md \ | |
charts/vald-helm-operator/Chart.yaml \ | |
charts/vald-helm-operator/README.md \ | |
charts/vald-helm-operator/values.schema.json \ | |
charts/vald-helm-operator/values.yaml \ | |
charts/vald/Chart.yaml \ | |
charts/vald/README.md \ | |
charts/vald/values.schema.json \ | |
charts/vald/values.yaml \ | |
k8s \ | |
versions/VALD_VERSION | |
git commit -S --signoff -m ":bookmark: :robot: Release ${GITWERK_RESULT}" | |
git tag ${GITWERK_RESULT} | |
git remote set-url origin "https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | |
git push origin main | |
git push origin ${GITWERK_RESULT} | |
echo "RELEASE=true" >> $GITHUB_OUTPUT | |
echo "VERSION=${GITWERK_RESULT}" >> $GITHUB_OUTPUT | |
env: | |
GITHUB_USER: ${{ secrets.DISPATCH_USER }} | |
GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }} | |
- name: Create release | |
if: steps.semver.outputs.RELEASE == 'true' | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }} | |
with: | |
tag_name: ${{ steps.semver.outputs.VERSION }} | |
release_name: Release ${{ steps.semver.outputs.VERSION }} | |
body: | | |
See [CHANGELOG.md](https://github.com/vdaas/vald/blob/${{ steps.semver.outputs.VERSION }}/CHANGELOG.md) for details. | |
draft: false | |
prerelease: false | |
- name: Add the version to goproxy | |
run: | | |
curl "https://proxy.golang.org/github.com/vdaas/vald/@v/${{ steps.semver.outputs.VERSION }}.info" |