From 8f5a601375395a460e9dbb345ef0e22658d70055 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 15:53:01 +0100 Subject: [PATCH 01/24] Fix checkout ref --- .github/workflows/ansys_lab.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index c56a2af496..c6331c8e06 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -28,7 +28,7 @@ jobs: steps: - uses: actions/checkout@v3 with: - ref: env.DESTINATION_BRANCH_NAME + ref: ${{ env.DESTINATION_BRANCH_NAME }} - name: "Download Release Asset - HTML" uses: dsaltares/fetch-gh-release-asset@1.1.0 From c7f376ef50e7a8aa23f3f67663cfe283cbe4165e Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 16:01:22 +0100 Subject: [PATCH 02/24] Add push changes step --- .github/workflows/ansys_lab.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index c6331c8e06..4fb2c1edc0 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -5,18 +5,16 @@ on: workflow_call: inputs: version: - description: "Release tag as 'tags/XX' (defaults to latest)" + description: "Release version as 'X.Y.Z'" type: string - required: false - default: latest + required: true # Can be called manually workflow_dispatch: inputs: version: - description: "Release tag as 'tags/XX' (defaults to latest)" + description: "Release version as 'X.Y.Z'" type: string - required: false - default: latest + required: true env: DESTINATION_BRANCH_NAME: ansys_lab_examples @@ -35,7 +33,7 @@ jobs: with: file: HTML-doc-ansys-dpf-core.zip token: ${{ secrets.GITHUB_TOKEN }} - version: ${{ inputs.version }} + version: tags/${{ inputs.version }} - name: "Extract ipynb examples" shell: python @@ -46,7 +44,12 @@ jobs: [z.extract(file, "./") for file in z.namelist() if file.endswith(".ipynb")] os.remove("HTML-doc-ansys-dpf-core.zip") - - name: "Show changes" + - name: "Push changes" shell: bash run: | - git status \ No newline at end of file + git add . + git status + git commit -m ${{ inputs.version }} + git push + git tag ${{ env.DESTINATION_BRANCH_NAME }}_${{ inputs.version }} + git push origin ${{ env.DESTINATION_BRANCH_NAME }}_${{ inputs.version }} From 1911f2a3f5aa31a4a5c23d07088f3986e0739375 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 16:03:39 +0100 Subject: [PATCH 03/24] Update download release asset --- .github/workflows/ansys_lab.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 4fb2c1edc0..98531d3136 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -33,7 +33,7 @@ jobs: with: file: HTML-doc-ansys-dpf-core.zip token: ${{ secrets.GITHUB_TOKEN }} - version: tags/${{ inputs.version }} + version: tags/v${{ inputs.version }} - name: "Extract ipynb examples" shell: python From 1dc9ce505e9e8104a947b9bd1603f776cd3a6246 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 16:31:17 +0100 Subject: [PATCH 04/24] Fix push --- .github/workflows/ansys_lab.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 98531d3136..a78c52cfd9 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -47,9 +47,8 @@ jobs: - name: "Push changes" shell: bash run: | - git add . git status - git commit -m ${{ inputs.version }} - git push + git commit -a -m ${{ inputs.version }} + git push https://${{ secrets.DPF_PIPELINE }}@github.com/ansys/pydpf-core.git git tag ${{ env.DESTINATION_BRANCH_NAME }}_${{ inputs.version }} git push origin ${{ env.DESTINATION_BRANCH_NAME }}_${{ inputs.version }} From 99bdebc8b2afd794d2f8454bc19ceb36f5d3d8e7 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 16:38:09 +0100 Subject: [PATCH 05/24] Fix push --- .github/workflows/ansys_lab.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index a78c52cfd9..8ff7940b6c 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -49,6 +49,6 @@ jobs: run: | git status git commit -a -m ${{ inputs.version }} - git push https://${{ secrets.DPF_PIPELINE }}@github.com/ansys/pydpf-core.git + git push https://${{ secrets.DPF_PIPELINE }}@github.com/rlagha/ansys/pydpf-core.git git tag ${{ env.DESTINATION_BRANCH_NAME }}_${{ inputs.version }} git push origin ${{ env.DESTINATION_BRANCH_NAME }}_${{ inputs.version }} From f733975299ca8df522919ba335580056a46a7603 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 16:40:32 +0100 Subject: [PATCH 06/24] Fix push --- .github/workflows/ansys_lab.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 8ff7940b6c..82fb9d91f5 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -49,6 +49,5 @@ jobs: run: | git status git commit -a -m ${{ inputs.version }} - git push https://${{ secrets.DPF_PIPELINE }}@github.com/rlagha/ansys/pydpf-core.git git tag ${{ env.DESTINATION_BRANCH_NAME }}_${{ inputs.version }} - git push origin ${{ env.DESTINATION_BRANCH_NAME }}_${{ inputs.version }} + git push https://${{ secrets.DPF_PIPELINE }}@github.com/rlagha/ansys/pydpf-core.git --follow-tags From 461604b83dac5a55f49e3392a1d9684bb4742a1e Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 16:51:55 +0100 Subject: [PATCH 07/24] Fix push --- .github/workflows/ansys_lab.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 82fb9d91f5..3dfc50f6ca 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -47,6 +47,7 @@ jobs: - name: "Push changes" shell: bash run: | + git config --global user.name "rlagha" git status git commit -a -m ${{ inputs.version }} git tag ${{ env.DESTINATION_BRANCH_NAME }}_${{ inputs.version }} From 87198cb36b8d252cb5acca573bb6f8d0f47a8a59 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 16:54:19 +0100 Subject: [PATCH 08/24] Fix push --- .github/workflows/ansys_lab.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 3dfc50f6ca..4b3ef559c9 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -48,6 +48,7 @@ jobs: shell: bash run: | git config --global user.name "rlagha" + git add . git status git commit -a -m ${{ inputs.version }} git tag ${{ env.DESTINATION_BRANCH_NAME }}_${{ inputs.version }} From b9d27a73b8a0e150facaec277f3cf7d711015f5d Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 16:55:42 +0100 Subject: [PATCH 09/24] Fix push --- .github/workflows/ansys_lab.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 4b3ef559c9..780701751f 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -52,4 +52,4 @@ jobs: git status git commit -a -m ${{ inputs.version }} git tag ${{ env.DESTINATION_BRANCH_NAME }}_${{ inputs.version }} - git push https://${{ secrets.DPF_PIPELINE }}@github.com/rlagha/ansys/pydpf-core.git --follow-tags + git push https://${{ secrets.DPF_PIPELINE }}@github.com/ansys/pydpf-core.git --follow-tags From c4ae752c91d9b4d3099e48103f7868d9835351d2 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 16:58:55 +0100 Subject: [PATCH 10/24] Add push of tag --- .github/workflows/ansys_lab.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 780701751f..e246fb239b 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -53,3 +53,4 @@ jobs: git commit -a -m ${{ inputs.version }} git tag ${{ env.DESTINATION_BRANCH_NAME }}_${{ inputs.version }} git push https://${{ secrets.DPF_PIPELINE }}@github.com/ansys/pydpf-core.git --follow-tags + git push https://${{ secrets.DPF_PIPELINE }}@github.com/ansys/pydpf-core.git ${{ env.DESTINATION_BRANCH_NAME }}_${{ inputs.version }} From e095b0e2c37e2d1e1b553061155ce91ce870d0b2 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 17:07:33 +0100 Subject: [PATCH 11/24] Remove tag of commit and run update in releaser.yml --- .github/workflows/ansys_lab.yml | 2 -- .github/workflows/releaser.yml | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index e246fb239b..5dce0b7c4f 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -51,6 +51,4 @@ jobs: git add . git status git commit -a -m ${{ inputs.version }} - git tag ${{ env.DESTINATION_BRANCH_NAME }}_${{ inputs.version }} git push https://${{ secrets.DPF_PIPELINE }}@github.com/ansys/pydpf-core.git --follow-tags - git push https://${{ secrets.DPF_PIPELINE }}@github.com/ansys/pydpf-core.git ${{ env.DESTINATION_BRANCH_NAME }}_${{ inputs.version }} diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml index c2de4618b1..3203afa2de 100644 --- a/.github/workflows/releaser.yml +++ b/.github/workflows/releaser.yml @@ -106,3 +106,9 @@ jobs: api-key: ${{ env.MEILISEARCH_API_KEY }} doc-artifact-name: HTML-doc-ansys-dpf-core.zip decompress-artifact: true + + update_ansys_lab_examples: + uses: ./.github/workflows/ansys_lab.yml + with: + version: ${{ github.event.inputs.release_tag || 'latest' }} + secrets: inherit From 49d141d1405579274bbedfecfa98be0a4a1f247f Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 17:18:07 +0100 Subject: [PATCH 12/24] Clean up examples first and move new in examples --- .github/workflows/ansys_lab.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 5dce0b7c4f..8d03b8fa68 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -28,6 +28,12 @@ jobs: with: ref: ${{ env.DESTINATION_BRANCH_NAME }} + - name: "Clean-up working directory" + shell: python + run: | + import glob + import os + - name: "Download Release Asset - HTML" uses: dsaltares/fetch-gh-release-asset@1.1.0 with: @@ -39,10 +45,14 @@ jobs: shell: python run: | import os + import shutil import zipfile with zipfile.ZipFile("HTML-doc-ansys-dpf-core.zip", 'r') as z: [z.extract(file, "./") for file in z.namelist() if file.endswith(".ipynb")] os.remove("HTML-doc-ansys-dpf-core.zip") + + for example in glob.iglob('*.ipynb'): + shutil.move(example, "./examples/") - name: "Push changes" shell: bash From 4f205ea8e2b7dcf95d90895402b99e3112bb1ad9 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 17:19:44 +0100 Subject: [PATCH 13/24] Clean up examples first and move new in examples --- .github/workflows/ansys_lab.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 8d03b8fa68..8a580242f8 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -33,6 +33,9 @@ jobs: run: | import glob import os + + for example in glob.iglob('*.ipynb'): + os.remove(example) - name: "Download Release Asset - HTML" uses: dsaltares/fetch-gh-release-asset@1.1.0 @@ -44,6 +47,7 @@ jobs: - name: "Extract ipynb examples" shell: python run: | + import glob import os import shutil import zipfile From 03ce651c28bc5230eb250186bf43b837e8af880d Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 17:26:10 +0100 Subject: [PATCH 14/24] Clean up examples first and move new in examples --- .github/workflows/ansys_lab.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 8a580242f8..7a6caea5bf 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -36,6 +36,8 @@ jobs: for example in glob.iglob('*.ipynb'): os.remove(example) + if not "examples" in os.listdir(os.getcwd()) + os.mkdir(os.path.join(os.getcwd()+"examples")) - name: "Download Release Asset - HTML" uses: dsaltares/fetch-gh-release-asset@1.1.0 @@ -54,9 +56,9 @@ jobs: with zipfile.ZipFile("HTML-doc-ansys-dpf-core.zip", 'r') as z: [z.extract(file, "./") for file in z.namelist() if file.endswith(".ipynb")] os.remove("HTML-doc-ansys-dpf-core.zip") - + for example in glob.iglob('*.ipynb'): - shutil.move(example, "./examples/") + shutil.move(example, os.path.join(os.getcwd()+"/examples")) - name: "Push changes" shell: bash From 7e769ff5fa0e6e5b650f420dfdd70e91a06858eb Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 17:27:10 +0100 Subject: [PATCH 15/24] Clean up examples first and move new in examples --- .github/workflows/ansys_lab.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 7a6caea5bf..878025c022 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -36,8 +36,8 @@ jobs: for example in glob.iglob('*.ipynb'): os.remove(example) - if not "examples" in os.listdir(os.getcwd()) - os.mkdir(os.path.join(os.getcwd()+"examples")) + if not "examples" in os.listdir(os.getcwd()): + os.mkdir(os.path.join(os.getcwd()+"examples")) - name: "Download Release Asset - HTML" uses: dsaltares/fetch-gh-release-asset@1.1.0 From f8f1cc6ac65310774905819c8b18196605a473ff Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 17:30:19 +0100 Subject: [PATCH 16/24] Clean up examples first and move new in examples --- .github/workflows/ansys_lab.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 878025c022..c729c8d81a 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -38,6 +38,7 @@ jobs: os.remove(example) if not "examples" in os.listdir(os.getcwd()): os.mkdir(os.path.join(os.getcwd()+"examples")) + print(os.listdir(os.getcwd())) - name: "Download Release Asset - HTML" uses: dsaltares/fetch-gh-release-asset@1.1.0 @@ -59,6 +60,7 @@ jobs: for example in glob.iglob('*.ipynb'): shutil.move(example, os.path.join(os.getcwd()+"/examples")) + print(os.path.join(os.getcwd()+"examples")) - name: "Push changes" shell: bash From e0fc9074693c314cb4a3ddad27357b9c0f6471cb Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 17:31:41 +0100 Subject: [PATCH 17/24] Clean up examples first and move new in examples --- .github/workflows/ansys_lab.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index c729c8d81a..45c080dca4 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -37,7 +37,7 @@ jobs: for example in glob.iglob('*.ipynb'): os.remove(example) if not "examples" in os.listdir(os.getcwd()): - os.mkdir(os.path.join(os.getcwd()+"examples")) + os.mkdir(os.path.join(os.getcwd(), "examples")) print(os.listdir(os.getcwd())) - name: "Download Release Asset - HTML" @@ -59,8 +59,8 @@ jobs: os.remove("HTML-doc-ansys-dpf-core.zip") for example in glob.iglob('*.ipynb'): - shutil.move(example, os.path.join(os.getcwd()+"/examples")) - print(os.path.join(os.getcwd()+"examples")) + shutil.move(example, os.path.join(os.getcwd(), "examples")) + print(os.listdir(os.path.join(os.getcwd(), "examples")) - name: "Push changes" shell: bash From f2b35602d78c990ac27d61acf14a544a08fed7b7 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 17:33:26 +0100 Subject: [PATCH 18/24] Clean up examples first and move new in examples --- .github/workflows/ansys_lab.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 45c080dca4..48e88604b5 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -60,7 +60,7 @@ jobs: for example in glob.iglob('*.ipynb'): shutil.move(example, os.path.join(os.getcwd(), "examples")) - print(os.listdir(os.path.join(os.getcwd(), "examples")) + print(os.listdir(os.path.join(os.getcwd(), "examples"))) - name: "Push changes" shell: bash From c7429be2ab6cf59b13220a372892fc7f066e26e7 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 17:35:14 +0100 Subject: [PATCH 19/24] Clean up examples first and move new in examples --- .github/workflows/ansys_lab.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 48e88604b5..7b81280fc6 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -36,9 +36,6 @@ jobs: for example in glob.iglob('*.ipynb'): os.remove(example) - if not "examples" in os.listdir(os.getcwd()): - os.mkdir(os.path.join(os.getcwd(), "examples")) - print(os.listdir(os.getcwd())) - name: "Download Release Asset - HTML" uses: dsaltares/fetch-gh-release-asset@1.1.0 @@ -58,6 +55,9 @@ jobs: [z.extract(file, "./") for file in z.namelist() if file.endswith(".ipynb")] os.remove("HTML-doc-ansys-dpf-core.zip") + if not "examples" in os.listdir(os.getcwd()): + os.mkdir(os.path.join(os.getcwd(), "examples")) + print(os.listdir(os.getcwd())) for example in glob.iglob('*.ipynb'): shutil.move(example, os.path.join(os.getcwd(), "examples")) print(os.listdir(os.path.join(os.getcwd(), "examples"))) From 673eb01550801ff29d7799830931dd83bd45e557 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 17:36:36 +0100 Subject: [PATCH 20/24] Clean up examples first and move new in examples --- .github/workflows/ansys_lab.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 7b81280fc6..079bc27f13 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -59,7 +59,8 @@ jobs: os.mkdir(os.path.join(os.getcwd(), "examples")) print(os.listdir(os.getcwd())) for example in glob.iglob('*.ipynb'): - shutil.move(example, os.path.join(os.getcwd(), "examples")) + print(f"Moving {example}") + shutil.move(example, os.path.join(os.getcwd(), "examples")) print(os.listdir(os.path.join(os.getcwd(), "examples"))) - name: "Push changes" From ed6cc8f52c433c3cf450a910f316992132db63ee Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 17:40:19 +0100 Subject: [PATCH 21/24] Clean up examples first and move new in examples --- .github/workflows/ansys_lab.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 079bc27f13..88cac67c41 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -34,7 +34,7 @@ jobs: import glob import os - for example in glob.iglob('*.ipynb'): + for example in glob.glob('*.ipynb'): os.remove(example) - name: "Download Release Asset - HTML" @@ -58,7 +58,9 @@ jobs: if not "examples" in os.listdir(os.getcwd()): os.mkdir(os.path.join(os.getcwd(), "examples")) print(os.listdir(os.getcwd())) - for example in glob.iglob('*.ipynb'): + for folder in os.listdir(os.path.join(os.getcwd(), "_downloads")): + print(os.listdir(folder)) + for example in glob.glob('*.ipynb'): print(f"Moving {example}") shutil.move(example, os.path.join(os.getcwd(), "examples")) print(os.listdir(os.path.join(os.getcwd(), "examples"))) From 0a2477c2461ee88e0025a76b51da32b5e4c70cff Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 17:42:00 +0100 Subject: [PATCH 22/24] Clean up examples first and move new in examples --- .github/workflows/ansys_lab.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 88cac67c41..4c9c37008b 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -59,7 +59,7 @@ jobs: os.mkdir(os.path.join(os.getcwd(), "examples")) print(os.listdir(os.getcwd())) for folder in os.listdir(os.path.join(os.getcwd(), "_downloads")): - print(os.listdir(folder)) + print(os.listdir(os.path.join(os.path.join(os.getcwd(), "_downloads"), folder))) for example in glob.glob('*.ipynb'): print(f"Moving {example}") shutil.move(example, os.path.join(os.getcwd(), "examples")) From 69434896a853ffbb09b831a438eb8b949277a96e Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 17:52:18 +0100 Subject: [PATCH 23/24] Clean up examples first and move new in examples --- .github/workflows/ansys_lab.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index 4c9c37008b..f3945719ed 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -34,8 +34,9 @@ jobs: import glob import os - for example in glob.glob('*.ipynb'): - os.remove(example) + for example in glob.glob('**/*.ipynb'): + os.remove(example) + print(f"Deleted {example}") - name: "Download Release Asset - HTML" uses: dsaltares/fetch-gh-release-asset@1.1.0 @@ -60,7 +61,7 @@ jobs: print(os.listdir(os.getcwd())) for folder in os.listdir(os.path.join(os.getcwd(), "_downloads")): print(os.listdir(os.path.join(os.path.join(os.getcwd(), "_downloads"), folder))) - for example in glob.glob('*.ipynb'): + for example in glob.glob('**/*.ipynb'): print(f"Moving {example}") shutil.move(example, os.path.join(os.getcwd(), "examples")) print(os.listdir(os.path.join(os.getcwd(), "examples"))) From 9d90ffa6a9564a3544ac0fd1766a5b87069d8867 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Tue, 21 Nov 2023 17:54:58 +0100 Subject: [PATCH 24/24] Clean up examples first and move new in examples --- .github/workflows/ansys_lab.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ansys_lab.yml b/.github/workflows/ansys_lab.yml index f3945719ed..1d66c6383f 100644 --- a/.github/workflows/ansys_lab.yml +++ b/.github/workflows/ansys_lab.yml @@ -34,7 +34,7 @@ jobs: import glob import os - for example in glob.glob('**/*.ipynb'): + for example in glob.glob('**/*.ipynb', recursive=True): os.remove(example) print(f"Deleted {example}") @@ -61,7 +61,7 @@ jobs: print(os.listdir(os.getcwd())) for folder in os.listdir(os.path.join(os.getcwd(), "_downloads")): print(os.listdir(os.path.join(os.path.join(os.getcwd(), "_downloads"), folder))) - for example in glob.glob('**/*.ipynb'): + for example in glob.glob('**/*.ipynb', recursive=True): print(f"Moving {example}") shutil.move(example, os.path.join(os.getcwd(), "examples")) print(os.listdir(os.path.join(os.getcwd(), "examples")))