Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ansys_lab.yml #1288

Merged
merged 24 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8f5a601
Fix checkout ref
PProfizi Nov 21, 2023
c7f376e
Add push changes step
PProfizi Nov 21, 2023
1911f2a
Update download release asset
PProfizi Nov 21, 2023
1dc9ce5
Fix push
PProfizi Nov 21, 2023
99bdebc
Fix push
PProfizi Nov 21, 2023
f733975
Fix push
PProfizi Nov 21, 2023
461604b
Fix push
PProfizi Nov 21, 2023
87198cb
Fix push
PProfizi Nov 21, 2023
b9d27a7
Fix push
PProfizi Nov 21, 2023
c4ae752
Add push of tag
PProfizi Nov 21, 2023
e095b0e
Remove tag of commit and run update in releaser.yml
PProfizi Nov 21, 2023
49d141d
Clean up examples first and move new in examples
PProfizi Nov 21, 2023
4f205ea
Clean up examples first and move new in examples
PProfizi Nov 21, 2023
03ce651
Clean up examples first and move new in examples
PProfizi Nov 21, 2023
7e769ff
Clean up examples first and move new in examples
PProfizi Nov 21, 2023
f8f1cc6
Clean up examples first and move new in examples
PProfizi Nov 21, 2023
e0fc907
Clean up examples first and move new in examples
PProfizi Nov 21, 2023
f2b3560
Clean up examples first and move new in examples
PProfizi Nov 21, 2023
c7429be
Clean up examples first and move new in examples
PProfizi Nov 21, 2023
673eb01
Clean up examples first and move new in examples
PProfizi Nov 21, 2023
ed6cc8f
Clean up examples first and move new in examples
PProfizi Nov 21, 2023
0a2477c
Clean up examples first and move new in examples
PProfizi Nov 21, 2023
6943489
Clean up examples first and move new in examples
PProfizi Nov 21, 2023
9d90ffa
Clean up examples first and move new in examples
PProfizi Nov 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 34 additions & 10 deletions .github/workflows/ansys_lab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,25 +26,51 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: env.DESTINATION_BRANCH_NAME
ref: ${{ env.DESTINATION_BRANCH_NAME }}

- name: "Clean-up working directory"
shell: python
run: |
import glob
import os

for example in glob.glob('**/*.ipynb', recursive=True):
os.remove(example)
print(f"Deleted {example}")

- name: "Download Release Asset - HTML"
uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
file: HTML-doc-ansys-dpf-core.zip
token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ inputs.version }}
version: tags/v${{ inputs.version }}

- name: "Extract ipynb examples"
shell: python
run: |
import glob
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")

if not "examples" in os.listdir(os.getcwd()):
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(os.path.join(os.path.join(os.getcwd(), "_downloads"), folder)))
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")))

- name: "Show changes"
- name: "Push changes"
shell: bash
run: |
git status
git config --global user.name "rlagha"
git add .
git status
git commit -a -m ${{ inputs.version }}
git push https://${{ secrets.DPF_PIPELINE }}@github.com/ansys/pydpf-core.git --follow-tags
6 changes: 6 additions & 0 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading