From 7798f734b3698e488cfa5dae5d5695321d9496e1 Mon Sep 17 00:00:00 2001 From: Nan Wang Date: Mon, 28 Nov 2022 15:18:55 +0800 Subject: [PATCH 01/17] ci: add scripts for sync-up the GH page of docarray Signed-off-by: Nan Wang --- .github/workflows/publish-docarry-org.yml | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/publish-docarry-org.yml diff --git a/.github/workflows/publish-docarry-org.yml b/.github/workflows/publish-docarry-org.yml new file mode 100644 index 00000000000..0cedaf0e597 --- /dev/null +++ b/.github/workflows/publish-docarry-org.yml @@ -0,0 +1,44 @@ +name: Manual Publish DocArray + +on: + workflow_dispatch: + inputs: + release_token: + description: 'Your release token' + required: true + +jobs: + token-check: + runs-on: ubuntu-latest + steps: + - name: Check release token + id: token-check + run: | + touch SUCCESS + if: inputs.release_token == env.release_token + env: + release_token: ${{ secrets.DOCARRAY_RELEASE_TOKEN }} + - name: Fail release token + run: | + [[ -f SUCCESS ]] + + copy-readme: + needs: token-check + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + path: docarray + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + repository: docarray/docarray.github.io + path: docarray.github.io + - name: Check out DocArray page + run: | + cd ${GITHUB_WORKSPACE}/docarray.github.io + cp ${GITHUB_WORKSPACE}/docarray/README.md . + git config --local user.email "${{ inputs.git_config_email }}" + git config --local user.name "${{ inputs.git_config_name }}" + git add README.md && git commit -m -s "chore(docs): sync up README from docarray" + git push From fa67ff5ccbfaec1f73bc0f85651c9d6360e37c5f Mon Sep 17 00:00:00 2001 From: Nan Wang Date: Mon, 28 Nov 2022 15:26:56 +0800 Subject: [PATCH 02/17] ci: add debugging lines Signed-off-by: Nan Wang --- .github/workflows/publish-docarry-org.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish-docarry-org.yml b/.github/workflows/publish-docarry-org.yml index 0cedaf0e597..830efc14a2c 100644 --- a/.github/workflows/publish-docarry-org.yml +++ b/.github/workflows/publish-docarry-org.yml @@ -6,6 +6,8 @@ on: release_token: description: 'Your release token' required: true + # uncomment this line for testing in PR + push: jobs: token-check: From a78a8b3e8cbbcea464c76e8ecc15578dfbb130ec Mon Sep 17 00:00:00 2001 From: Nan Wang Date: Mon, 28 Nov 2022 15:30:40 +0800 Subject: [PATCH 03/17] ci: add debugging lines Signed-off-by: Nan Wang --- .github/workflows/publish-docarry-org.yml | 31 ++++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish-docarry-org.yml b/.github/workflows/publish-docarry-org.yml index 830efc14a2c..fa878c3dfe3 100644 --- a/.github/workflows/publish-docarry-org.yml +++ b/.github/workflows/publish-docarry-org.yml @@ -1,4 +1,4 @@ -name: Manual Publish DocArray +name: Manual Publish DocArray[dot]org on: workflow_dispatch: @@ -10,22 +10,23 @@ on: push: jobs: - token-check: - runs-on: ubuntu-latest - steps: - - name: Check release token - id: token-check - run: | - touch SUCCESS - if: inputs.release_token == env.release_token - env: - release_token: ${{ secrets.DOCARRAY_RELEASE_TOKEN }} - - name: Fail release token - run: | - [[ -f SUCCESS ]] +# token-check: +# runs-on: ubuntu-latest +# steps: +# - name: Check release token +# id: token-check +# run: | +# touch SUCCESS +# if: inputs.release_token == env.release_token +# env: +# release_token: ${{ secrets.DOCARRAY_RELEASE_TOKEN }} +# - name: Fail release token +# run: | +# [[ -f SUCCESS ]] copy-readme: - needs: token-check +# needs: token-check + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: From cc0abb94c633e9d782c6dfc48fd2f23d21905c37 Mon Sep 17 00:00:00 2001 From: Nan Wang Date: Mon, 28 Nov 2022 15:33:46 +0800 Subject: [PATCH 04/17] ci: add debugging lines Signed-off-by: Nan Wang --- .github/workflows/publish-docarry-org.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-docarry-org.yml b/.github/workflows/publish-docarry-org.yml index fa878c3dfe3..df6d266565e 100644 --- a/.github/workflows/publish-docarry-org.yml +++ b/.github/workflows/publish-docarry-org.yml @@ -43,5 +43,5 @@ jobs: cp ${GITHUB_WORKSPACE}/docarray/README.md . git config --local user.email "${{ inputs.git_config_email }}" git config --local user.name "${{ inputs.git_config_name }}" - git add README.md && git commit -m -s "chore(docs): sync up README from docarray" + git add README.md && git commit -s -m "chore(docs): sync up README from docarray" git push From e08da9c1262c6a860724168f3b741add84dbdb1e Mon Sep 17 00:00:00 2001 From: Nan Wang Date: Mon, 28 Nov 2022 15:37:44 +0800 Subject: [PATCH 05/17] ci: add debugging lines Signed-off-by: Nan Wang --- .github/workflows/publish-docarry-org.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-docarry-org.yml b/.github/workflows/publish-docarry-org.yml index df6d266565e..c7ae25dd6d2 100644 --- a/.github/workflows/publish-docarry-org.yml +++ b/.github/workflows/publish-docarry-org.yml @@ -41,7 +41,7 @@ jobs: run: | cd ${GITHUB_WORKSPACE}/docarray.github.io cp ${GITHUB_WORKSPACE}/docarray/README.md . - git config --local user.email "${{ inputs.git_config_email }}" - git config --local user.name "${{ inputs.git_config_name }}" + git config --local user.email "Jina Dev Bot" + git config --local user.name "dev-bot@jina.ai" git add README.md && git commit -s -m "chore(docs): sync up README from docarray" git push From 2b66521b0f2d557e935e89f75035bd261c0379b4 Mon Sep 17 00:00:00 2001 From: Nan Wang Date: Mon, 28 Nov 2022 15:56:13 +0800 Subject: [PATCH 06/17] ci: fix token issues Signed-off-by: Nan Wang --- .github/workflows/publish-docarry-org.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-docarry-org.yml b/.github/workflows/publish-docarry-org.yml index c7ae25dd6d2..d8be9b84b1d 100644 --- a/.github/workflows/publish-docarry-org.yml +++ b/.github/workflows/publish-docarry-org.yml @@ -37,6 +37,7 @@ jobs: fetch-depth: 1 repository: docarray/docarray.github.io path: docarray.github.io + token: ${{ secrets.JINA_DEV_BOT }} - name: Check out DocArray page run: | cd ${GITHUB_WORKSPACE}/docarray.github.io From 0eb51e63a0af4820abea97ee9340436167c3ba32 Mon Sep 17 00:00:00 2001 From: Nan Wang Date: Mon, 28 Nov 2022 16:54:23 +0800 Subject: [PATCH 07/17] ci: add readme modification checks Signed-off-by: Nan Wang --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ README.md | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6996e768b45..70a8a2f632d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -268,3 +268,24 @@ jobs: - name: Success if: ${{ success() }} run: echo "All Done" + + publish-docarray-org: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Get changed files + id: changed-files-specific + uses: tj-actions/changed-files@v34 + with: + files: | + README.md + + - name: Check if + if: steps.changed-files-specific.outputs.any_changed == 'true' + run: | + echo "README.md is modified" + echo "List all the files that have changed: ${{ steps.changed-files-specific.outputs.all_changed_files }}" + echo "call `Manual Publish DocArray[dot]org`" diff --git a/README.md b/README.md index cbb8e13c02a..7bcfda97831 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ The following news article card can be easily represented via `docarray.dataclas -A example multimodal document +A example multimodal document From 82f0ee37cc8e4a00ed5f5061f6a5fe82fb615a7d Mon Sep 17 00:00:00 2001 From: Nan Wang Date: Mon, 28 Nov 2022 17:09:54 +0800 Subject: [PATCH 08/17] ci: add readme modification checks Signed-off-by: Nan Wang --- .github/workflows/ci.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70a8a2f632d..c1b4683f4c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -269,7 +269,7 @@ jobs: if: ${{ success() }} run: echo "All Done" - publish-docarray-org: + check-readme-modification: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -283,9 +283,20 @@ jobs: files: | README.md - - name: Check if + - name: Check if README is modified if: steps.changed-files-specific.outputs.any_changed == 'true' run: | echo "README.md is modified" - echo "List all the files that have changed: ${{ steps.changed-files-specific.outputs.all_changed_files }}" - echo "call `Manual Publish DocArray[dot]org`" + touch SUCCESS + + - name: Return outputs + run: | + [[ -f SUCCESS ]] + + publish-docarray-org: + needs: check-readme-modification + uses: ./.github/workflows/publish-docarry-org.yml@ci-add-readme-syncup-1128 + with: + release_token: ${{ secrets.DOCARRAY_RELEASE_TOKEN }} + + From 405ef23014153cdced477ee0777ff227db70b770 Mon Sep 17 00:00:00 2001 From: Nan Wang Date: Mon, 28 Nov 2022 17:12:46 +0800 Subject: [PATCH 09/17] ci: add readme modification checks Signed-off-by: Nan Wang --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1b4683f4c3..bbac67a18f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -295,7 +295,7 @@ jobs: publish-docarray-org: needs: check-readme-modification - uses: ./.github/workflows/publish-docarry-org.yml@ci-add-readme-syncup-1128 + uses: ./.github/workflows/publish-docarry-org.yml with: release_token: ${{ secrets.DOCARRAY_RELEASE_TOKEN }} From cc8285c6901432b50c55f2fe8e6ec7966db1a32f Mon Sep 17 00:00:00 2001 From: Nan Wang Date: Mon, 28 Nov 2022 17:14:54 +0800 Subject: [PATCH 10/17] ci: add readme modification checks Signed-off-by: Nan Wang --- .github/workflows/publish-docarry-org.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/publish-docarry-org.yml b/.github/workflows/publish-docarry-org.yml index d8be9b84b1d..295aa097d6f 100644 --- a/.github/workflows/publish-docarry-org.yml +++ b/.github/workflows/publish-docarry-org.yml @@ -7,6 +7,11 @@ on: description: 'Your release token' required: true # uncomment this line for testing in PR + workflow_call: + inputs: + release_token: + description: 'Your release token' + required: true push: jobs: From 06566b864abd0b921077d998dca70745295ec56e Mon Sep 17 00:00:00 2001 From: Nan Wang Date: Mon, 28 Nov 2022 17:18:06 +0800 Subject: [PATCH 11/17] ci: add readme modification checks Signed-off-by: Nan Wang --- .github/workflows/ci.yml | 4 ---- .github/workflows/publish-docarry-org.yml | 4 ---- 2 files changed, 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbac67a18f6..d2875349333 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -296,7 +296,3 @@ jobs: publish-docarray-org: needs: check-readme-modification uses: ./.github/workflows/publish-docarry-org.yml - with: - release_token: ${{ secrets.DOCARRAY_RELEASE_TOKEN }} - - diff --git a/.github/workflows/publish-docarry-org.yml b/.github/workflows/publish-docarry-org.yml index 295aa097d6f..9841580de2c 100644 --- a/.github/workflows/publish-docarry-org.yml +++ b/.github/workflows/publish-docarry-org.yml @@ -8,10 +8,6 @@ on: required: true # uncomment this line for testing in PR workflow_call: - inputs: - release_token: - description: 'Your release token' - required: true push: jobs: From 21d7c1f4dfa0ffca1c6636fb927d3e5d288b1ef4 Mon Sep 17 00:00:00 2001 From: Nan Wang Date: Mon, 28 Nov 2022 17:27:42 +0800 Subject: [PATCH 12/17] ci: add readme modification checks Signed-off-by: Nan Wang --- .github/workflows/ci.yml | 1 + .github/workflows/publish-docarry-org.yml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2875349333..b5093a85715 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -296,3 +296,4 @@ jobs: publish-docarray-org: needs: check-readme-modification uses: ./.github/workflows/publish-docarry-org.yml + secrets: inherit diff --git a/.github/workflows/publish-docarry-org.yml b/.github/workflows/publish-docarry-org.yml index 9841580de2c..9b49e6fcd45 100644 --- a/.github/workflows/publish-docarry-org.yml +++ b/.github/workflows/publish-docarry-org.yml @@ -8,6 +8,9 @@ on: required: true # uncomment this line for testing in PR workflow_call: + secrets: + JINA_DEV_BOT: + required: True push: jobs: From 964bcff9008bb91a7dda6f81119fe49fafbe5a9c Mon Sep 17 00:00:00 2001 From: Nan Wang Date: Mon, 28 Nov 2022 17:38:46 +0800 Subject: [PATCH 13/17] ci: add readme modification checks Signed-off-by: Nan Wang --- .github/workflows/publish-docarry-org.yml | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish-docarry-org.yml b/.github/workflows/publish-docarry-org.yml index 9b49e6fcd45..511e229b4e8 100644 --- a/.github/workflows/publish-docarry-org.yml +++ b/.github/workflows/publish-docarry-org.yml @@ -14,22 +14,22 @@ on: push: jobs: -# token-check: -# runs-on: ubuntu-latest -# steps: -# - name: Check release token -# id: token-check -# run: | -# touch SUCCESS -# if: inputs.release_token == env.release_token -# env: -# release_token: ${{ secrets.DOCARRAY_RELEASE_TOKEN }} -# - name: Fail release token -# run: | -# [[ -f SUCCESS ]] + token-check: + runs-on: ubuntu-latest + steps: + - name: Check release token + id: token-check + run: | + touch SUCCESS + if: ${{ inputs.release_token == env.release_token || github.event_name == 'workflow_call' }} + env: + release_token: ${{ secrets.DOCARRAY_RELEASE_TOKEN }} + - name: Fail release token + run: | + [[ -f SUCCESS ]] copy-readme: -# needs: token-check + needs: token-check runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 4b905717bde718a9f5babd6f9f7fccf37dcc1a15 Mon Sep 17 00:00:00 2001 From: Nan Wang Date: Mon, 28 Nov 2022 17:46:25 +0800 Subject: [PATCH 14/17] ci: add readme modification checks Signed-off-by: Nan Wang --- .github/workflows/publish-docarry-org.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-docarry-org.yml b/.github/workflows/publish-docarry-org.yml index 511e229b4e8..b8efbeb143b 100644 --- a/.github/workflows/publish-docarry-org.yml +++ b/.github/workflows/publish-docarry-org.yml @@ -6,17 +6,20 @@ on: release_token: description: 'Your release token' required: true - # uncomment this line for testing in PR workflow_call: secrets: JINA_DEV_BOT: required: True - push: +# uncomment this line for testing in PR +# push: jobs: token-check: runs-on: ubuntu-latest steps: + - name: debug + run: | + echo ${{ github.event_name }} event triggered this action - name: Check release token id: token-check run: | From 08843f37ef3f6d5c1c467f697a29cf977f18e282 Mon Sep 17 00:00:00 2001 From: Nan Wang Date: Mon, 28 Nov 2022 17:53:31 +0800 Subject: [PATCH 15/17] ci: add readme modification checks Signed-off-by: Nan Wang --- .github/workflows/ci.yml | 2 ++ .github/workflows/publish-docarry-org.yml | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5093a85715..e71312ee201 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -296,4 +296,6 @@ jobs: publish-docarray-org: needs: check-readme-modification uses: ./.github/workflows/publish-docarry-org.yml + with: + release_token: ${{ secrets.DOCARRAY_RELEASE_TOKEN }} secrets: inherit diff --git a/.github/workflows/publish-docarry-org.yml b/.github/workflows/publish-docarry-org.yml index b8efbeb143b..11495b42cb3 100644 --- a/.github/workflows/publish-docarry-org.yml +++ b/.github/workflows/publish-docarry-org.yml @@ -7,9 +7,14 @@ on: description: 'Your release token' required: true workflow_call: + inputs: + release_token: + description: 'Your release token' + required: true secrets: JINA_DEV_BOT: required: True + # uncomment this line for testing in PR # push: @@ -24,7 +29,7 @@ jobs: id: token-check run: | touch SUCCESS - if: ${{ inputs.release_token == env.release_token || github.event_name == 'workflow_call' }} + if: inputs.release_token == env.release_token env: release_token: ${{ secrets.DOCARRAY_RELEASE_TOKEN }} - name: Fail release token From 17abc1210fb76b76c927ecefbca0a387543a6978 Mon Sep 17 00:00:00 2001 From: Nan Wang Date: Mon, 28 Nov 2022 18:11:14 +0800 Subject: [PATCH 16/17] ci: add readme modification checks Signed-off-by: Nan Wang --- .github/workflows/ci.yml | 2 -- .github/workflows/publish-docarry-org.yml | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e71312ee201..b5093a85715 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -296,6 +296,4 @@ jobs: publish-docarray-org: needs: check-readme-modification uses: ./.github/workflows/publish-docarry-org.yml - with: - release_token: ${{ secrets.DOCARRAY_RELEASE_TOKEN }} secrets: inherit diff --git a/.github/workflows/publish-docarry-org.yml b/.github/workflows/publish-docarry-org.yml index 11495b42cb3..8e52c03fa7f 100644 --- a/.github/workflows/publish-docarry-org.yml +++ b/.github/workflows/publish-docarry-org.yml @@ -7,10 +7,6 @@ on: description: 'Your release token' required: true workflow_call: - inputs: - release_token: - description: 'Your release token' - required: true secrets: JINA_DEV_BOT: required: True @@ -32,6 +28,10 @@ jobs: if: inputs.release_token == env.release_token env: release_token: ${{ secrets.DOCARRAY_RELEASE_TOKEN }} + - name: Check trigger event + run: | + touch SUCCESS + if: github.event_name == 'pull_request' - name: Fail release token run: | [[ -f SUCCESS ]] From 81e3dbb328945e52c154868de0c69e67850940a9 Mon Sep 17 00:00:00 2001 From: Nan Wang Date: Mon, 28 Nov 2022 18:15:34 +0800 Subject: [PATCH 17/17] ci: add readme modification checks Signed-off-by: Nan Wang --- .github/workflows/cd.yml | 29 +++++++++++++++++++ .github/workflows/ci.yml | 29 ------------------- ...carry-org.yml => publish-docarray-org.yml} | 0 3 files changed, 29 insertions(+), 29 deletions(-) rename .github/workflows/{publish-docarry-org.yml => publish-docarray-org.yml} (100%) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 64f2debacbd..1853247e9f9 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -143,3 +143,32 @@ jobs: TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} JINA_SLACK_WEBHOOK: ${{ secrets.JINA_SLACK_WEBHOOK }} + + check-readme-modification: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Get changed files + id: changed-files-specific + uses: tj-actions/changed-files@v34 + with: + files: | + README.md + + - name: Check if README is modified + if: steps.changed-files-specific.outputs.any_changed == 'true' + run: | + echo "README.md is modified" + touch SUCCESS + + - name: Return outputs + run: | + [[ -f SUCCESS ]] + + publish-docarray-org: + needs: check-readme-modification + uses: ./.github/workflows/publish-docarray-org.yml + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5093a85715..6996e768b45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -268,32 +268,3 @@ jobs: - name: Success if: ${{ success() }} run: echo "All Done" - - check-readme-modification: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Get changed files - id: changed-files-specific - uses: tj-actions/changed-files@v34 - with: - files: | - README.md - - - name: Check if README is modified - if: steps.changed-files-specific.outputs.any_changed == 'true' - run: | - echo "README.md is modified" - touch SUCCESS - - - name: Return outputs - run: | - [[ -f SUCCESS ]] - - publish-docarray-org: - needs: check-readme-modification - uses: ./.github/workflows/publish-docarry-org.yml - secrets: inherit diff --git a/.github/workflows/publish-docarry-org.yml b/.github/workflows/publish-docarray-org.yml similarity index 100% rename from .github/workflows/publish-docarry-org.yml rename to .github/workflows/publish-docarray-org.yml