From 9547e95d3f31db75edc11850b2aa14b62342e20c Mon Sep 17 00:00:00 2001 From: Evstigneev Denis Date: Mon, 29 Dec 2025 12:56:11 +0300 Subject: [PATCH] upd job_sync && upd gitignore && upd gomod --- .github/workflows/job_sync.yml | 114 ++++++++++++++++++++++----------- .gitignore | 30 ++++++++- go.mod | 2 +- go.sum | 7 +- 4 files changed, 109 insertions(+), 44 deletions(-) diff --git a/.github/workflows/job_sync.yml b/.github/workflows/job_sync.yml index d0f7aa1..c99e919 100644 --- a/.github/workflows/job_sync.yml +++ b/.github/workflows/job_sync.yml @@ -11,42 +11,84 @@ jobs: if: github.server_url != 'https://github.com' runs-on: ubuntu-latest steps: - - name: init - run: | - git config --global user.email "vtolstov " - git config --global user.name "github-actions[bot]" - echo "machine git.unistack.org login vtolstov password ${{ secrets.TOKEN_GITEA }}" >> /root/.netrc - echo "machine github.com login vtolstov password ${{ secrets.TOKEN_GITHUB }}" >> /root/.netrc + - name: init + run: | + git config --global user.email "vtolstov " + git config --global user.name "github-actions[bot]" + echo "machine git.unistack.org login vtolstov password ${{ secrets.TOKEN_GITEA }}" >> /root/.netrc + echo "machine github.com login vtolstov password ${{ secrets.TOKEN_GITHUB }}" >> /root/.netrc - - name: sync master - run: | - git clone --filter=blob:none --filter=tree:0 --branch master --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo - cd repo - git remote add --no-tags --fetch --track master upstream https://github.com/${GITHUB_REPOSITORY} - git pull --rebase upstream master - git push upstream master --progress - git push origin master --progress - cd ../ - rm -rf repo + - name: check master + id: check_master + run: | + src_hash=$(git ls-remote https://github.com/${GITHUB_REPOSITORY} refs/heads/master | cut -f1) + dst_hash=$(git ls-remote ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} refs/heads/master | cut -f1) + echo "src_hash=$src_hash" + echo "dst_hash=$dst_hash" + if [ "$src_hash" != "$dst_hash" -a "$src_hash" != "" -a "$dst_hash" != "" ]; then + echo "sync_needed=true" >> $GITHUB_OUTPUT + else + echo "sync_needed=false" >> $GITHUB_OUTPUT + fi - - name: sync v3 - run: | - git clone --filter=blob:none --filter=tree:0 --branch v3 --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo - cd repo - git remote add --no-tags --fetch --track v3 upstream https://github.com/${GITHUB_REPOSITORY} - git pull --rebase upstream v3 - git push upstream v3 --progress - git push origin v3 --progress - cd ../ - rm -rf repo + - name: sync master + if: steps.check_master.outputs.sync_needed == 'true' + run: | + git clone --filter=blob:none --filter=tree:0 --branch master --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo + cd repo + git remote add --no-tags --fetch --track master upstream https://github.com/${GITHUB_REPOSITORY} + git pull --rebase upstream master + git push upstream master --progress + git push origin master --progress + cd ../ + rm -rf repo - - name: sync v4 - run: | - git clone --filter=blob:none --filter=tree:0 --branch v4 --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo - cd repo - git remote add --no-tags --fetch --track v4 upstream https://github.com/${GITHUB_REPOSITORY} - git pull --rebase upstream v4 - git push upstream v4 --progress - git push origin v4 --progress - cd ../ - rm -rf repo + - name: check v3 + id: check_v3 + run: | + src_hash=$(git ls-remote https://github.com/${GITHUB_REPOSITORY} refs/heads/v3 | cut -f1) + dst_hash=$(git ls-remote ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} refs/heads/v3 | cut -f1) + echo "src_hash=$src_hash" + echo "dst_hash=$dst_hash" + if [ "$src_hash" != "$dst_hash" ]; then + echo "sync_needed=true" >> $GITHUB_OUTPUT + else + echo "sync_needed=false" >> $GITHUB_OUTPUT + fi + + - name: sync v3 + if: steps.check_v3.outputs.sync_needed == 'true' + run: | + git clone --filter=blob:none --filter=tree:0 --branch v3 --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo + cd repo + git remote add --no-tags --fetch --track v3 upstream https://github.com/${GITHUB_REPOSITORY} + git pull --rebase upstream v3 + git push upstream v3 --progress + git push origin v3 --progress + cd ../ + rm -rf repo + + - name: check v4 + id: check_v4 + run: | + src_hash=$(git ls-remote https://github.com/${GITHUB_REPOSITORY} refs/heads/v4 | cut -f1) + dst_hash=$(git ls-remote ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} refs/heads/v4 | cut -f1) + echo "src_hash=$src_hash" + echo "dst_hash=$dst_hash" + if [ "$src_hash" != "$dst_hash" ]; then + echo "sync_needed=true" >> $GITHUB_OUTPUT + else + echo "sync_needed=false" >> $GITHUB_OUTPUT + fi + + - name: sync v4 + if: steps.check_v4.outputs.sync_needed == 'true' + run: | + git clone --filter=blob:none --filter=tree:0 --branch v4 --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo + cd repo + git remote add --no-tags --fetch --track v4 upstream https://github.com/${GITHUB_REPOSITORY} + git pull --rebase upstream v4 + git push upstream v4 --progress + git push origin v4 --progress + cd ../ + rm -rf repo diff --git a/.gitignore b/.gitignore index 66fd13c..ad367ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ +# Develop tools +/.vscode/ +/.idea/ +.idea +.vscode + # Binaries for programs and plugins *.exe *.exe~ @@ -5,11 +11,29 @@ *.so *.dylib -# Test binary, built with `go test -c` +# Folders +_obj +_test +_build +.DS_Store + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +# Test binary, build with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out -# Dependency directories (remove the comment below to include it) -# vendor/ +# vim temp files +*~ +*.swp +*.swo \ No newline at end of file diff --git a/go.mod b/go.mod index 7f56c03..83b5353 100644 --- a/go.mod +++ b/go.mod @@ -13,8 +13,8 @@ require ( github.com/ash3in/uuidv8 v1.2.0 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/kr/pretty v0.3.1 // indirect github.com/matoous/go-nanoid v1.5.1 // indirect - github.com/spf13/cast v1.7.1 // indirect google.golang.org/protobuf v1.36.3 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 4dea995..35b889d 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,7 @@ github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7Oputl github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= github.com/ash3in/uuidv8 v1.2.0 h1:2oogGdtCPwaVtyvPPGin4TfZLtOGE5F+W++E880G6SI= github.com/ash3in/uuidv8 v1.2.0/go.mod h1:BnU0wJBxnzdEKmVg4xckBkD+VZuecTFTUP3M0dWgyY4= -github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= -github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -14,10 +13,10 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/matoous/go-nanoid v1.5.1 h1:aCjdvTyO9LLnTIi0fgdXhOPPvOHjpXN6Ik9DaNjIct4= github.com/matoous/go-nanoid v1.5.1/go.mod h1:zyD2a71IubI24efhpvkJz+ZwfwagzgSO6UNiFsZKN7U= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= -github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= go.unistack.org/micro-proto/v4 v4.1.0 h1:qPwL2n/oqh9RE3RTTDgt28XK3QzV597VugQPaw9lKUk= go.unistack.org/micro-proto/v4 v4.1.0/go.mod h1:ArmK7o+uFvxSY3dbJhKBBX4Pm1rhWdLEFf3LxBrMtec= go.unistack.org/micro/v4 v4.1.2 h1:9SOlPYyPNNFpg1A7BsvhDyQm3gysLH1AhWbDCp1hyoY=