11# Generates linkml yaml schema from metadata in googlesheets using schemasheets
22name : generating yaml file
33
4- on : workflow_dispatch
4+ on :
5+ workflow_dispatch :
6+ inputs :
7+ model :
8+ description : ' model name'
9+ required : true
10+ type : string
511
612jobs :
713 generate_libgen_yaml :
@@ -26,11 +32,27 @@ jobs:
2632 sudo apt-get update
2733 sudo apt-get install -y build-essential git wget curl
2834
35+ # Check if download-dir exists; if not, create it
36+ - name : Check if download-dir exists
37+ run : |
38+ if [ ! -d "linkml-schema/source_${{ inputs.model }}/gsheet_output" ]; then
39+ echo "Directory does not exist. Making directory"
40+ mkdir -p linkml-schema/source_${{ inputs.model }}/gsheet_output
41+ fi
42+
43+ # Check if gsheet.yaml exists
44+ - name : Check if gsheet.yaml exists
45+ run : |
46+ if [ ! -f "linkml-schema/source_${{ inputs.model }}/gsheet.yaml" ]; then
47+ echo "gsheet.yaml does not exist. Exiting"
48+ exit 1
49+ fi
50+
2951 # Generate yaml model
3052 - name : Generate yaml model
3153 run : |
3254 cd linkml-schema
33- bkbit schema2model -o library_generation. yaml --gsheet --gsheet-download-dir source_library_generation /gsheet_output source_library_generation /gsheet.yaml --no-inlined
55+ bkbit schema2model -o ${{ inputs.model }}. yaml --gsheet --gsheet-download-dir source_${{ inputs.model }} /gsheet_output source_${{ inputs.model }} /gsheet.yaml --no-inlined
3456 cd ..
3557
3658 # Generate unique branch name
4567 uses : peter-evans/create-pull-request@v4
4668 with :
4769 token : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
48- commit-message : " Generate new version of the linkml model"
70+ commit-message : " Generate new version of the linkml model for ${{ inputs.model }} "
4971 branch : ${{ env.BRANCH_NAME }}
50- title : " Auto PR: yaml generated from google spreadsheets using schemasheets"
51- body : " This PR adds a autogenerated yaml file."
72+ title : " Auto PR: ${{ inputs.model }}. yaml generated from google spreadsheets using schemasheets"
73+ body : " This PR adds a autogenerated ${{ inputs.model }}. yaml file."
5274 base : main
0 commit comments