Skip to content

Commit

Permalink
💚 Add auto deps version update workflow
Browse files Browse the repository at this point in the history
Signed-off-by: vankichi <kyukawa315@gmail.com>
  • Loading branch information
vankichi committed Oct 18, 2024
1 parent 0a8b332 commit f038302
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/update-deps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
# 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 }} <vald@vdaas.org>"
token: ${{ secrets.DISPATCH_TOKEN }}
committer: "${{ secrets.DISPATCH_USER }} <vald@vdaas.org>"
signoff: true
delete-branch: true
base: main
title: "Update libs dependency"
body: "Automated pull request to update Dependencies."
12 changes: 12 additions & 0 deletions Makefile.d/dependencies.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
.PHONY: update/libs
## update vald libraries including tools
update/libs: \
update/buf \
update/chaos-mesh \
update/cmake \
update/docker \
Expand All @@ -38,6 +39,7 @@ update/libs: \
update/reviewdog \
update/rust \
update/telepresence \
update/usearch \
update/vald \
update/yq \
update/zlib
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f038302

Please sign in to comment.