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

Auto-Rendering Profile #597

Open
wants to merge 164 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
331841e
Add the Python Script
sahar-frikha Jul 4, 2022
568c709
Trigger the bioschemas website's workflow
sahar-frikha Jul 4, 2022
adab7d5
Profile Generation Workflow
sahar-frikha Jul 4, 2022
e3c8f79
Readme File
sahar-frikha Jul 4, 2022
db48e32
Save the generated file directly in the website
sahar-frikha Jul 4, 2022
060d447
Update
sahar-frikha Jul 4, 2022
2f5e538
Delete trigger_the_website_workflow.yml
sahar-frikha Jul 4, 2022
d63290c
little fix
sahar-frikha Jul 4, 2022
62a073a
some change in the Taxon profile
sahar-frikha Jul 4, 2022
378351e
Merge branch 'profile-auto-generation' of https://github.com/BioSchem…
sahar-frikha Jul 4, 2022
4fd7fca
some change in the Taxon profile
sahar-frikha Jul 4, 2022
03698ba
some change in the Taxon profile
sahar-frikha Jul 4, 2022
57656b7
some change in the comutational tool profile
sahar-frikha Jul 4, 2022
8a991e1
some change in the comutational tool profile
sahar-frikha Jul 4, 2022
ee512a2
some change in the comutational tool profile
sahar-frikha Jul 4, 2022
d04d4f0
fix in the script
sahar-frikha Jul 4, 2022
d9edbd8
Create readme.md
sahar-frikha Jul 11, 2022
178d7ca
Walkthrough
sahar-frikha Jul 21, 2022
bfbbcbc
Update Dataset_v0.5-DRAFT.json
sahar-frikha Jul 21, 2022
6fd5b58
parse the dde csv
sahar-frikha Jul 25, 2022
d7f342c
parse the dde csv
sahar-frikha Jul 25, 2022
03810ce
parse the dde csv
sahar-frikha Jul 26, 2022
f1074c1
parse the dde csv
sahar-frikha Jul 26, 2022
5d018cf
parse the dde csv
sahar-frikha Jul 26, 2022
23858d1
change the branch name
sahar-frikha Jul 28, 2022
450ab81
change the branch name
sahar-frikha Jul 28, 2022
93dd9c2
change the branch name
sahar-frikha Jul 28, 2022
c79b886
change the branch name
sahar-frikha Jul 28, 2022
34ab7d8
change the branch name
sahar-frikha Jul 28, 2022
7d47077
change the branch name
sahar-frikha Jul 28, 2022
877525f
change the branch name
sahar-frikha Jul 28, 2022
4d535f4
change the branch name
sahar-frikha Jul 28, 2022
cf54bd2
Update Course_v0.7-DRAFT-2019_11_08.json
sahar-frikha Jul 28, 2022
977c4db
Update generate_profile_workflow.yml
sahar-frikha Jul 28, 2022
eef18bf
Update ComputationalTool_v0.5-DRAFT.json
sahar-frikha Jul 28, 2022
5231dcb
enourmous change
sahar-frikha Aug 3, 2022
ea5b3d2
Merge branch 'profile-auto-generation' of https://github.com/BioSchem…
sahar-frikha Aug 3, 2022
fd98f92
enourmous change
sahar-frikha Aug 3, 2022
3d98a2d
enourmous change
sahar-frikha Aug 9, 2022
822b260
enourmous change
sahar-frikha Aug 9, 2022
490f402
enourmous change
sahar-frikha Aug 9, 2022
43a4c1f
enourmous change
sahar-frikha Aug 9, 2022
b63bb36
enourmous change
sahar-frikha Aug 9, 2022
d5386fa
enourmous change
sahar-frikha Aug 9, 2022
aa4168d
enourmous change
sahar-frikha Aug 9, 2022
95ad7a1
enourmous change
sahar-frikha Aug 9, 2022
73a4760
enourmous change
sahar-frikha Aug 9, 2022
a0cdf8c
enourmous change
sahar-frikha Aug 9, 2022
3081526
enourmous change
sahar-frikha Aug 9, 2022
4a3fac0
enourmous change
sahar-frikha Aug 9, 2022
f095288
enourmous change
sahar-frikha Aug 9, 2022
5379ea9
Ginger
sahar-frikha Aug 9, 2022
9040727
Ginger
sahar-frikha Aug 9, 2022
bd25d6c
previous-version
sahar-frikha Aug 17, 2022
a358d60
previous-version
sahar-frikha Aug 17, 2022
448c99b
previous-version
sahar-frikha Aug 17, 2022
4a2aef6
previous-version
sahar-frikha Aug 17, 2022
31fe2f1
previous-version
sahar-frikha Aug 17, 2022
61ee2be
previous-version
sahar-frikha Aug 17, 2022
37718ea
previous-version
sahar-frikha Aug 17, 2022
2266dc8
previous-version
sahar-frikha Aug 17, 2022
d8f2732
previous-version
sahar-frikha Aug 17, 2022
99d64ac
previous-version
sahar-frikha Aug 17, 2022
3fc7c36
previous-version
sahar-frikha Aug 17, 2022
f5df949
previous-version
sahar-frikha Aug 17, 2022
2d6655c
previous-version
sahar-frikha Aug 17, 2022
937496b
previous-version
sahar-frikha Aug 17, 2022
0ab8a17
previous-version
sahar-frikha Aug 17, 2022
28fc95f
previous-version
sahar-frikha Aug 17, 2022
d0015e2
previous-version
sahar-frikha Aug 17, 2022
3ea1886
previous-version
sahar-frikha Aug 17, 2022
ae5abb6
previous-version
sahar-frikha Aug 17, 2022
c3f35c9
previous-version
sahar-frikha Aug 17, 2022
f6d034f
previous-version
sahar-frikha Aug 17, 2022
1ce5e7a
external properties
sahar-frikha Aug 17, 2022
a4534ae
external properties
sahar-frikha Aug 17, 2022
b1c6e39
external properties
sahar-frikha Aug 17, 2022
2599812
throwing exeptions removal
sahar-frikha Aug 17, 2022
2aedf3e
throwing exeptions removal
sahar-frikha Aug 17, 2022
2e34387
throwing exeptions removal
sahar-frikha Aug 17, 2022
5cc35c4
throwing exeptions removal
sahar-frikha Aug 17, 2022
e2f2f2c
throwing exeptions removal
sahar-frikha Aug 17, 2022
dd22187
throwing exeptions removal
sahar-frikha Aug 17, 2022
f0ba876
some final rectifications
sahar-frikha Oct 18, 2022
6e55faf
some final rectifications
sahar-frikha Oct 18, 2022
7c86487
some final rectifications
sahar-frikha Oct 18, 2022
562fd65
some final rectifications
sahar-frikha Oct 18, 2022
92b7444
some final rectifications
sahar-frikha Oct 18, 2022
3d7aa9b
some final rectifications
sahar-frikha Oct 18, 2022
7c07d03
some final rectifications
sahar-frikha Oct 18, 2022
fb329f1
some final rectifications
sahar-frikha Oct 18, 2022
d494eaf
some final rectifications
sahar-frikha Oct 18, 2022
5753cb9
some final rectifications
sahar-frikha Oct 18, 2022
1fa8e0e
some final rectifications
sahar-frikha Oct 18, 2022
b9cac26
some final rectifications
sahar-frikha Oct 18, 2022
ccd3232
some final rectifications
sahar-frikha Oct 18, 2022
5ece3e7
some final rectifications
sahar-frikha Oct 18, 2022
559dc8d
some final rectifications
sahar-frikha Oct 18, 2022
ce9d30e
some final rectifications
sahar-frikha Oct 18, 2022
6980fe1
some final rectifications
sahar-frikha Oct 18, 2022
a5fa023
some final rectifications
sahar-frikha Oct 18, 2022
3264222
some final rectifications
sahar-frikha Oct 18, 2022
3a6a2b4
some final rectifications
sahar-frikha Oct 18, 2022
d1d52e2
some final rectifications
sahar-frikha Oct 18, 2022
67895d8
some final rectifications
sahar-frikha Oct 18, 2022
6491b9e
some final rectifications
sahar-frikha Oct 19, 2022
56df367
some final rectifications
sahar-frikha Oct 19, 2022
f02b724
some final rectifications
sahar-frikha Oct 19, 2022
f103d19
some final rectifications
sahar-frikha Oct 19, 2022
482bb4b
some final rectifications
sahar-frikha Oct 19, 2022
c1d468d
some final rectifications
sahar-frikha Oct 19, 2022
c65db81
some final rectifications
sahar-frikha Oct 19, 2022
5557a78
some final rectifications
sahar-frikha Oct 19, 2022
e21a200
some final rectifications
sahar-frikha Oct 19, 2022
d1d60cf
some final rectifications
sahar-frikha Oct 19, 2022
d52577b
some final rectifications
sahar-frikha Oct 19, 2022
daba818
some final rectifications
sahar-frikha Oct 19, 2022
13a69bb
some final rectifications
sahar-frikha Oct 19, 2022
475aa4c
some final rectifications
sahar-frikha Oct 19, 2022
38f2d54
some final rectifications
sahar-frikha Oct 19, 2022
b7f12d8
some final rectifications
sahar-frikha Oct 19, 2022
2471da3
some final rectifications
sahar-frikha Oct 19, 2022
d9a20a7
some final rectifications
sahar-frikha Oct 19, 2022
bc5bcd5
some final rectifications
sahar-frikha Oct 19, 2022
cdd2df0
some final rectifications
sahar-frikha Oct 19, 2022
783f73d
some final rectifications
sahar-frikha Oct 19, 2022
ab3f09e
some final rectifications
sahar-frikha Oct 19, 2022
4fa1a2b
some final rectifications
sahar-frikha Oct 19, 2022
c0924b9
some final rectifications
sahar-frikha Oct 19, 2022
f3c1b56
some final rectifications
sahar-frikha Oct 19, 2022
5064432
some final rectifications
sahar-frikha Oct 19, 2022
14bcdb3
some final rectifications
sahar-frikha Oct 19, 2022
16c8f31
some final rectifications
sahar-frikha Oct 19, 2022
7d564e4
some final rectifications
sahar-frikha Oct 19, 2022
578494f
some final rectifications
sahar-frikha Oct 19, 2022
68b0e0c
some final rectifications
sahar-frikha Oct 19, 2022
a75e85e
some final rectifications
sahar-frikha Oct 19, 2022
e3c3dfc
some final rectifications
sahar-frikha Oct 19, 2022
ab2a888
some final rectifications
sahar-frikha Oct 19, 2022
1cf32cc
some final rectifications
sahar-frikha Oct 19, 2022
ced3ce5
some final rectifications
sahar-frikha Oct 19, 2022
924887b
some final rectifications
sahar-frikha Oct 19, 2022
a31b8b7
some final rectifications
sahar-frikha Oct 19, 2022
0cf9a28
new computationlTool profile draft
sahar-frikha Oct 19, 2022
60297d7
new computationlTool profile draft
sahar-frikha Oct 19, 2022
7da32d7
change
sahar-frikha Oct 19, 2022
360edb1
change
sahar-frikha Oct 19, 2022
bde0a75
change
sahar-frikha Oct 19, 2022
1f24616
change
sahar-frikha Oct 19, 2022
d56be6f
change
sahar-frikha Oct 25, 2022
3f660cb
change
sahar-frikha Oct 25, 2022
4950904
change
sahar-frikha Oct 25, 2022
3b9cdf5
change
sahar-frikha Oct 25, 2022
599d27d
change
sahar-frikha Oct 26, 2022
8cccb2d
change
sahar-frikha Oct 26, 2022
3120f68
change
sahar-frikha Oct 26, 2022
33bd470
change
sahar-frikha Oct 26, 2022
cff1785
change
sahar-frikha Oct 26, 2022
833c9f2
change
sahar-frikha Oct 27, 2022
4390576
change
sahar-frikha Oct 27, 2022
001b0f5
change
sahar-frikha Oct 27, 2022
c5d64c4
change
sahar-frikha Oct 27, 2022
154eab1
change
sahar-frikha Oct 27, 2022
d3f6b96
change
sahar-frikha Oct 27, 2022
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
1 change: 1 addition & 0 deletions .github/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
71 changes: 71 additions & 0 deletions .github/workflows/config_file_update_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import json
from pathlib import Path
import yaml
from colorama import Fore
from colorama import Style
import sys
import csv
from os import path
from os import listdir
from os.path import isfile, join
from yaml.loader import SafeLoader

## Main Script
print(Fore.YELLOW + "Started updating profile versions config file" + Style.RESET_ALL)

profile_verions_file = "./bioschemas.github.io/_data/profile_versions.yaml"

stream = open(profile_verions_file, "r")
docs = yaml.load_all(stream, yaml.FullLoader)

d = {}

for doc in docs:
try:
for k, v in doc.items():
# print(k, "->", v)
d[k] = v
# print("\n")
except Exception as e:
print("This exception occured in parsing the YAML file", e)

args = sys.argv

# For each new uploaded JSON-LD file
for arg in args:
if "jsonld" in arg.split("/"):
if "json" in arg.split("."):
arglist = arg.split("/")
profile_name = arg.split("/")[-1].split(".")[0].split("_")[0]
profile_version = arg.split("_")[1].split("v")[1].split(".json")[0]

print(
Fore.LIGHTBLUE_EX
+ "profile name and version: "
+ profile_name
+ ", "
+ profile_version
+ Style.RESET_ALL
)

if profile_name in d.keys():
print(
Fore.GREEN + "Before the change:",
str(d[profile_name]) + Style.RESET_ALL,
)
if arg.split("-")[1].split(".")[0] == "DRAFT":
d[profile_name]["latest_publication"] = profile_version

elif arg.split("-")[1].split(".")[0] == "RELEASE":
d[profile_name]["latest_release"] = profile_version
print(
Fore.LIGHTGREEN_EX + "After the update:",
str(d[profile_name]) + Style.RESET_ALL,
)

f = open(profile_verions_file, "w+")
yaml.dump(d, f, allow_unicode=True)

print(
Fore.YELLOW + "Profile versions updated " + profile_verions_file + Style.RESET_ALL
)
120 changes: 120 additions & 0 deletions .github/workflows/generate_profile_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# This workflow will generate/update a/the profile HTML page each time the
# DDE genrates and update a JSON-LD in the _data/specifications folder (repo)

name: generate-profile

on: [push]
# pull_request:
# types: [opened, reopened]

env:
GH_TOKEN: ${{ secrets.Sahar_Workflows_Token }}

# inputs:
# branch-name:
# description: $`date +%Y_%m_%d-%H_%M_%S`
# required: true

jobs:
generate-profile:
runs-on: ubuntu-latest

steps:

- name: Checkout Spec Repo and Retreive the Preceding Commit
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@v21

- name: List Changed Files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done

- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8 #install the python needed

- name: Install Python dependencies
uses: py-actions/py-dependency-install@v3
with:
path: "./.github/workflows/requirements.txt"

- name: Checkout the DDE repo
env:
GITHUB_TOKEN: ${{ secrets.Sahar_Workflows_Token }}
run: |
git clone https://user:[email protected]/BioSchemas/bioschemas-dde
cd bioschemas-dde
git checkout latest-updated-profiles
ls

- name: Checkout the Website repo
env:
GITHUB_TOKEN: ${{ secrets.Sahar_Workflows_Token }}
run: |
git clone https://user:[email protected]/BioSchemas/bioschemas.github.io
cd bioschemas.github.io
git pull
ls

- name: Checkout a new branch - Website repository
run: |
cd bioschemas.github.io
git checkout profile-auto-generation
git pull
git checkout -b `date +%Y_%m_%d-%H_%M`
cd ..

- name: Execute the config files update Python Script
run: |
python ./.github/workflows/config_file_update_script.py ${{steps.changed-files.outputs.all_changed_files}}

- name: Execute the profile rendering Python Script
run: |
python ./.github/workflows/profile_generation_script.py ${{steps.changed-files.outputs.all_changed_files}} bioschemas.github.io

- name: Setup the Github TOKEN
uses: oleksiyrudenko/gha-git-credentials@v2-latest
with:
path: bioschemas.github.io
email: [email protected]
name: sahar-frikha
actor: sahar-frikha
token: '${{secrets.Sahar_Workflows_Token}}'

- name: Commit and Push the changes in the website
run: |
cd bioschemas.github.io
git config user.name "sahar-frikha"
git config user.email "[email protected]"
git status
git add .
git commit -m "Updating Profile"
git push --set-upstream -u origin `date +%Y_%m_%d-%H_%M`

- name: Create a pull request
run: |
sleep 60
cd bioschemas.github.io
gh pr create --title "Auto-Rendering Profile" --body "This pull request has been created by a guithub action, after adding/updating a profile in the specifications repo."

- name: Commit and Push the changes in the DDE repository
run: |
cd bioschemas-dde
git config user.name "sahar-frikha"
git config user.email "[email protected]"
git status
git add .
git commit -m "Updating Profile"
git push origin latest-updated-profiles

- name: End Workflow
run: |
echo "Check the Website !"
Loading