Merge branch 'main' of https://github.com/D-WIS/DDHub-Semantic-Intero… #39
This file contains 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 cleaned vocabulary and packages | |
on: | |
workflow_dispatch: | |
push: # push must be changed to trigger after md's have been generated (workflow trigger?) | |
paths: | |
- 'docs/vocabulary_development/definitions/**.md' | |
jobs: | |
generate_vocabulary: | |
runs-on: windows-latest | |
env: | |
SOURCE_FOLDER: "${{ github.workspace }}\\docs\\vocabulary_development\\definitions" | |
SCRIPT_PATH: "${{ github.workspace }}\\src\\DWIS-Vocabulary\\DWIS-Vocabulary\\DWISVocabularyDevelopment.Actions" | |
DESTINATION_FOLDER: "${{ github.workspace }}\\docs\\vocabulary_development\\auto-generated" | |
SCHEMA_FOLDER: "${{ github.workspace }}\\src\\DWIS-Vocabulary\\DWIS-Vocabulary\\DWIS.Vocabulary.Schemas" | |
EXAMPLES_SOURCE_FOLDER: "${{ github.workspace }}\\docs\\vocabulary_development\\examples" | |
PROJECTS_TO_PACK: "DWIS.Vocabulary.Development,DWIS.Vocabulary.OWL,DWIS.Vocabulary.Schemas,DWIS.Vocabulary.Utils" | |
PACK_VERSION: "5" | |
PACKAGE_OUTPUT_FOLDER: "${{ github.workspace }}\\packages" | |
INCREMENT_VERSION: "true" | |
STANDARD_RESOURCE_FOLDER: "${{ github.workspace }}\\src\\DWIS-Vocabulary\\DWIS-Vocabulary\\DWIS.Vocabulary.Standard\\Properties" | |
NUGET_SECRET_API: ${{ secrets.NUGET_SECRET_API }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Overwrite appsettings.json | |
run: | | |
cd $Env:SCRIPT_PATH | |
echo "Old appsettings.json" | |
type .\appsettings.json | |
echo "" | |
echo "Changing appsettings.json..." | |
$a = Get-Content 'appsettings.json' -raw | ConvertFrom-Json | |
$a.ActionsConfig.SourceFolder="$Env:SOURCE_FOLDER" | |
$a.ActionsConfig.DestinationFolder="$Env:DESTINATION_FOLDER" | |
$a.ActionsConfig.SchemaFolder="$Env:SCHEMA_FOLDER" | |
$a.ActionsConfig.ExamplesSourceFolder="$Env:EXAMPLES_SOURCE_FOLDER" | |
$a.ActionsConfig.IncrementVersion="$Env:INCREMENT_VERSION" | |
$a.ActionsConfig.StandardResourceFolder="$Env:STANDARD_RESOURCE_FOLDER" | |
$a | ConvertTo-Json -depth 32| set-content 'appsettings.json' | |
echo "" | |
echo "New appsettings.json" | |
type .\appsettings.json | |
- name: Run generation script | |
timeout-minutes: 3 | |
run: | | |
cd $Env:SCRIPT_PATH | |
pwd | |
dotnet restore | |
dotnet run | |
- name: Git Update | |
run: | | |
git config --global user.email "beda@norceresearch.no" | |
git config --global user.name "benoitdaireaux" | |
git add -A | |
git status | |
git commit -m "Automatically generated files" -a | |
git push | |
- name: 'Upload the generated files as artifacts' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: generated-md-files | |
path: "${{ github.workspace }}/docs/vocabulary_development/auto-generated/md" | |
#- name: Checkout modified repo | |
# uses: actions/checkout@v2 | |
- name: Build and pack | |
run: | | |
cd "${{ github.workspace }}\\src\\DWIS-Vocabulary\\DWIS-Vocabulary\\DWISVocabularyDevelopment" | |
dotnet pack --output $Env:PACKAGE_OUTPUT_FOLDER -p:PackageVersion=1.0."${{ github.run_number }}" | |
cd "${{ github.workspace }}\\src\\DWIS-Vocabulary\\DWIS-Vocabulary\\VocabularyUtils" | |
dotnet pack --output $Env:PACKAGE_OUTPUT_FOLDER -p:PackageVersion=1.0."${{ github.run_number }}" | |
cd "${{ github.workspace }}\\src\\DWIS-Vocabulary\\DWIS-Vocabulary\\DWISVocabulary.OWL" | |
dotnet pack --output $Env:PACKAGE_OUTPUT_FOLDER -p:PackageVersion=1.0."${{ github.run_number }}" | |
cd "${{ github.workspace }}\\src\\DWIS-Vocabulary\\DWIS-Vocabulary\\DWIS.Vocabulary.Standard" | |
dotnet pack --output $Env:PACKAGE_OUTPUT_FOLDER -p:PackageVersion=1.0."${{ github.run_number }}" | |
cd "${{ github.workspace }}\\src\\DWIS-Vocabulary\\DWIS-Vocabulary\\DWIS.Vocabulary.Schemas" | |
dotnet pack --output $Env:PACKAGE_OUTPUT_FOLDER -p:PackageVersion=1.0."${{ github.run_number }}" | |
- name: 'Upload the generated packages as artifacts' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: generated-nuget-packages | |
path: "${{ github.workspace }}/packages" | |
- name: 'Push to NuGet.org' | |
run: | | |
cd $Env:PACKAGE_OUTPUT_FOLDER | |
dotnet nuget push "*.nupkg" -k "$env:NUGET_SECRET_API" -s https://api.nuget.org/v3/index.json --skip-duplicate |