From 96ab16c38082ede01912c473627ab19d802e8283 Mon Sep 17 00:00:00 2001 From: vankichi Date: Fri, 18 Oct 2024 17:14:34 +0900 Subject: [PATCH 1/6] :green_heart: Add auto deps version update workflow Signed-off-by: vankichi --- .github/workflows/update-deps.yaml | 64 ++++++++++++++++++++++++++++++ Makefile.d/dependencies.mk | 12 ++++++ 2 files changed, 76 insertions(+) create mode 100644 .github/workflows/update-deps.yaml diff --git a/.github/workflows/update-deps.yaml b/.github/workflows/update-deps.yaml new file mode 100644 index 0000000000..fe7c693099 --- /dev/null +++ b/.github/workflows/update-deps.yaml @@ -0,0 +1,64 @@ +# +# Copyright (C) 2019-2024 vdaas.org vald team +# +# 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: Update Dependencies version +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * *" +jobs: + dump-contexts-to-log: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: vdaas/vald/.github/actions/dump-context@main + update-version: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.DISPATCH_TOKEN }} + - name: Set Git config + run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} + - uses: crazy-max/ghaction-import-gpg@v6 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + git_user_signingkey: true + git_commit_gpgsign: true + - name: Run update command + run: | + make update/libs + - name: Check difference + id: check_diff + run: | + if git diff --quiet --exit-code; then + echo "Nothing updated" + else + git diff && git status + echo "HAS_GIT_DIFF=true" >> $GITHUB_OUTPUT + fi + - name: Create PR + if: ${{ steps.check_diff.outputs.HAS_GIT_DIFF == 'true' }} + uses: peter-evans/create-pull-request@v7 + with: + author: "${{ secrets.DISPATCH_USER }} " + token: ${{ secrets.DISPATCH_TOKEN }} + committer: "${{ secrets.DISPATCH_USER }} " + signoff: true + delete-branch: true + base: main + title: "Update libs dependency" + body: "Automated pull request to update Dependencies." diff --git a/Makefile.d/dependencies.mk b/Makefile.d/dependencies.mk index 596e9ec1b2..441bbf90ff 100644 --- a/Makefile.d/dependencies.mk +++ b/Makefile.d/dependencies.mk @@ -17,6 +17,7 @@ .PHONY: update/libs ## update vald libraries including tools update/libs: \ + update/buf \ update/chaos-mesh \ update/cmake \ update/docker \ @@ -38,6 +39,7 @@ update/libs: \ update/reviewdog \ update/rust \ update/telepresence \ + update/usearch \ update/vald \ update/yq \ update/zlib @@ -151,6 +153,11 @@ update/helm-docs: update/protobuf: curl -fsSL https://api.github.com/repos/protocolbuffers/protobuf/releases/latest | grep -Po '"tag_name": "\K.*?(?=")' | sed 's/v//g' > $(ROOTDIR)/versions/PROTOBUF_VERSION +.PHONY: update/buf +## update buf version +update/buf: + curl -fsSL https://api.github.com/repos/bufbuild/buf/releases/latest | grep -Po '"tag_name": "\K.*?(?=")' > $(ROOTDIR)/versions/BUF_VERSION + .PHONY: update/kind ## update kind (kubernetes in docker) version update/kind: @@ -191,6 +198,11 @@ update/ngt: update/faiss: curl -fsSL https://api.github.com/repos/facebookresearch/faiss/releases/latest | grep -Po '"tag_name": "\K.*?(?=")' | sed 's/v//g' > $(ROOTDIR)/versions/FAISS_VERSION +.PHONY: update/usearch +## update usearch version +update/usearch: + curl -fsSL https://api.github.com/repos/unum-cloud/usearch/releases/latest | grep -Po '"tag_name": "\K.*?(?=")' | sed 's/v//g' > $(ROOTDIR)/versions/USEARCH_VERSION + .PHONY: update/cmake ## update CMAKE version update/cmake: From 39dff57d7202deaa09dd68fd8b55e60a08dd267d Mon Sep 17 00:00:00 2001 From: vankichi Date: Mon, 21 Oct 2024 17:25:59 +0900 Subject: [PATCH 2/6] :green_heart: Update make commands Signed-off-by: vankichi --- .github/workflows/update-actions.yaml | 64 --------------------------- .github/workflows/update-deps.yaml | 11 ++++- Makefile | 1 + 3 files changed, 11 insertions(+), 65 deletions(-) delete mode 100644 .github/workflows/update-actions.yaml diff --git a/.github/workflows/update-actions.yaml b/.github/workflows/update-actions.yaml deleted file mode 100644 index 8500981889..0000000000 --- a/.github/workflows/update-actions.yaml +++ /dev/null @@ -1,64 +0,0 @@ -# -# Copyright (C) 2019-2024 vdaas.org vald team -# -# 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: Update Actions version -on: - workflow_dispatch: - schedule: - - cron: "0 0 * * *" -jobs: - dump-contexts-to-log: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: vdaas/vald/.github/actions/dump-context@main - update-version: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.DISPATCH_TOKEN }} - - name: Set Git config - run: | - git config --global --add safe.directory ${GITHUB_WORKSPACE} - - uses: crazy-max/ghaction-import-gpg@v6 - with: - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - git_user_signingkey: true - git_commit_gpgsign: true - - name: Run update command - run: | - make update/actions - - name: Check difference - id: check_diff - run: | - if git diff --quiet --exit-code; then - echo "Nothing updated" - else - git diff && git status - echo "HAS_GIT_DIFF=true" >> $GITHUB_OUTPUT - fi - - name: Create PR - if: ${{ steps.check_diff.outputs.HAS_GIT_DIFF == 'true' }} - uses: peter-evans/create-pull-request@v7 - with: - author: "${{ secrets.DISPATCH_USER }} " - token: ${{ secrets.DISPATCH_TOKEN }} - committer: "${{ secrets.DISPATCH_USER }} " - signoff: true - delete-branch: true - base: main - title: "Update Actions dependency" - body: "Automated pull request to update Actions." diff --git a/.github/workflows/update-deps.yaml b/.github/workflows/update-deps.yaml index fe7c693099..d7a9c7949e 100644 --- a/.github/workflows/update-deps.yaml +++ b/.github/workflows/update-deps.yaml @@ -40,7 +40,16 @@ jobs: git_commit_gpgsign: true - name: Run update command run: | - make update/libs + make files + make update + make helm/schema/all + make k8s/manifest/update + make k8s/manifest/helm-operator/update + make k8s/manifest/benchmark-operator/update + make helm/docs/vald + make helm/docs/vald-helm-operator + make helm/docs/vald-benchmark-operator + make format - name: Check difference id: check_diff run: | diff --git a/Makefile b/Makefile index 4daf536e08..6fe564f3b8 100644 --- a/Makefile +++ b/Makefile @@ -505,6 +505,7 @@ update: \ deps \ update/template \ go/deps \ + go/example/deps \ rust/deps \ format From 5694b00c5ccd277e0adb618c7e5f684721729a2c Mon Sep 17 00:00:00 2001 From: vankichi Date: Mon, 21 Oct 2024 18:46:22 +0900 Subject: [PATCH 3/6] :green_heart: Fix Signed-off-by: vankichi --- .github/workflows/update-deps.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-deps.yaml b/.github/workflows/update-deps.yaml index d7a9c7949e..bb396b6cd1 100644 --- a/.github/workflows/update-deps.yaml +++ b/.github/workflows/update-deps.yaml @@ -49,6 +49,7 @@ jobs: make helm/docs/vald make helm/docs/vald-helm-operator make helm/docs/vald-benchmark-operator + make license make format - name: Check difference id: check_diff From 4e69b00b5befef515fa09a0082fa1fd0d9fdc281 Mon Sep 17 00:00:00 2001 From: vankichi Date: Tue, 22 Oct 2024 12:12:19 +0900 Subject: [PATCH 4/6] :green_heart: Add make permission Signed-off-by: vankichi --- .github/workflows/update-deps.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-deps.yaml b/.github/workflows/update-deps.yaml index bb396b6cd1..a29acfe2b4 100644 --- a/.github/workflows/update-deps.yaml +++ b/.github/workflows/update-deps.yaml @@ -51,6 +51,7 @@ jobs: make helm/docs/vald-benchmark-operator make license make format + make perm - name: Check difference id: check_diff run: | From 5c6fd414ee380fc31bb5e26eb987e711b3612c35 Mon Sep 17 00:00:00 2001 From: vankichi Date: Tue, 22 Oct 2024 15:21:40 +0900 Subject: [PATCH 5/6] :green_heart: Add labels Signed-off-by: vankichi --- .github/workflows/update-deps.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/update-deps.yaml b/.github/workflows/update-deps.yaml index a29acfe2b4..bfda04e64a 100644 --- a/.github/workflows/update-deps.yaml +++ b/.github/workflows/update-deps.yaml @@ -61,6 +61,16 @@ jobs: git diff && git status echo "HAS_GIT_DIFF=true" >> $GITHUB_OUTPUT fi + - name: Get Label + id: pr-label + if: ${{ steps.check_diff.outputs.HAS_GIT_DIFF == 'true' }} + run: | + LATEST=$(make version/vald | grep -o -E "[0-9]+\.[0-9]+") + if ${LATEST} eq "1.7"; then + echo "LABELS=release/v${LATEST}" >> $GITHUB_OUTPUT + else + SUPPORT=$(echo ${LATEST} | awk '{print $1-0.1}') + echo "LABELS=actions/backport/release/v${LATEST},release/v${SUPPORT}" - name: Create PR if: ${{ steps.check_diff.outputs.HAS_GIT_DIFF == 'true' }} uses: peter-evans/create-pull-request@v7 @@ -73,3 +83,4 @@ jobs: base: main title: "Update libs dependency" body: "Automated pull request to update Dependencies." + labels: ${{ steps.pr-label.LABELS }} From f00d518a61c6efc20914fbaa912eb08ff506027b Mon Sep 17 00:00:00 2001 From: vankichi Date: Thu, 24 Oct 2024 15:31:09 +0900 Subject: [PATCH 6/6] :green_heart: Fix Signed-off-by: vankichi --- .github/workflows/update-deps.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-deps.yaml b/.github/workflows/update-deps.yaml index bfda04e64a..2d75286f7d 100644 --- a/.github/workflows/update-deps.yaml +++ b/.github/workflows/update-deps.yaml @@ -70,7 +70,8 @@ jobs: echo "LABELS=release/v${LATEST}" >> $GITHUB_OUTPUT else SUPPORT=$(echo ${LATEST} | awk '{print $1-0.1}') - echo "LABELS=actions/backport/release/v${LATEST},release/v${SUPPORT}" + echo "LABELS=actions/backport/release/v${LATEST},release/v${SUPPORT}" >> $GITHUB_OUTPUT + fi - name: Create PR if: ${{ steps.check_diff.outputs.HAS_GIT_DIFF == 'true' }} uses: peter-evans/create-pull-request@v7 @@ -83,4 +84,4 @@ jobs: base: main title: "Update libs dependency" body: "Automated pull request to update Dependencies." - labels: ${{ steps.pr-label.LABELS }} + labels: ${{ steps.pr-label.outputs.LABELS }}