Generate Bundle #27
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Generate Bundle | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| zip_and_upload: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up zip | |
| run: sudo apt-get install zip -y | |
| - name: Create bundle folder | |
| run: | | |
| rm -r bundle || true | |
| mkdir bundle | |
| # Nomenclatures | |
| mkdir "bundle/Annexes - Nomenclatures" | |
| cp -r nomenclature_parser/out/latest/* "bundle/Annexes - Nomenclatures/" | |
| # Modèles | |
| messagesDir="bundle/Annexes - Messages" | |
| mkdir "$messagesDir" | |
| # Read schemas from yaml file | |
| while IFS= read -r line || [ -n "$line" ]; do | |
| if [[ $line =~ ^[[:space:]]*schema:[[:space:]]*([^[:space:]]*) ]]; then | |
| SCHEMA="${BASH_REMATCH[1]}" | |
| # Skip schemas that don't need to be included | |
| if [ "$SCHEMA" = "TECHNICAL" ] || [ "$SCHEMA" = "TECHNICAL_NOREQ" ] || [ "$SCHEMA" = "customContent" ]; then | |
| echo "Skipping $SCHEMA" | |
| continue | |
| fi | |
| echo $SCHEMA | |
| # Create "Annexes" directory | |
| schemaDir="$messagesDir/Annexes $SCHEMA" | |
| mkdir "$schemaDir" | |
| # Create and populate "Schemas et Exemples" directory | |
| mkdir "$schemaDir/Schemas et Exemples" | |
| cp src/main/resources/json-schema/$SCHEMA.schema.json "$schemaDir/Schemas et Exemples" | |
| cp src/main/resources/xsd/$SCHEMA.xsd "$schemaDir/Schemas et Exemples" | |
| cp src/main/resources/sample/examples/$SCHEMA/* "$schemaDir/Schemas et Exemples" || true # || true as not all schemas have examples | |
| # Populate root elements (docx and UML) | |
| cp csv_parser/out/$SCHEMA/$SCHEMA.schema.docx "$schemaDir/Annexe au DSF - $SCHEMA.docx" | |
| cp csv_parser/out/$SCHEMA/$SCHEMA.uml_diagram.pdf "$schemaDir/Schema UML - $SCHEMA.pdf" | |
| fi | |
| done < csv_parser/out/schemas.yaml | |
| - name: Create zip file with date | |
| run: | | |
| currentDate=$(date +'%y.%m.%d') | |
| bundle_name="${currentDate}_DSF_Hub Sante" | |
| mv bundle "$bundle_name" | |
| zip -r bundle.zip "$bundle_name" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Bundle-zip | |
| path: bundle.zip |