-
Notifications
You must be signed in to change notification settings - Fork 35
67 lines (65 loc) · 2.44 KB
/
merge_and_document.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Merge and Generate
on:
workflow_dispatch:
push:
branches:
- "main"
paths:
- "Source/DTDL**"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{ secrets.CI_PUSH_PAT }}
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Build DTDL Merger
run: dotnet build ./Tools/DTDLMerger/
- name: Run DTDL Merger on REC DTDLv2
run: dotnet run --project ./Tools/DTDLMerger/ ./Source/DTDLv2/ > ./RealEstateCore.DTDLv2.jsonld
- name: Increment .nuspec revision number
id: increment
uses: vers-one/[email protected]
with:
files: "Metadata/*.nuspec"
version: bump-revision
- name: Build DTDL2MD
run: dotnet build ./Tools/DTDL2MD/
- name: Delete old docs
run: |
mv Doc/index.md ./DocIndexBackup.md
rm -rf Doc/*
mv DocIndexBackup.md ./Doc/index.md
- name: Run DTDL2MD to generate docs
run: dotnet run --project ./Tools/DTDL2MD/ -i ./RealEstateCore.DTDLv2.jsonld -o ./Doc/
- name: Build DTDL2OAS
run: dotnet build ./Tools/DTDL2OAS/
- name: Run DTDL2OAS to generate API specification
run: dotnet run --project ./Tools/DTDL2OAS --inputPath ./Source/DTDLv2/ --nuspecPath ./Metadata/RealEstateCore.Ontology.DTDLv2.nuspec --endpointsPath ./API/REST/Endpoints.csv --outputPath ./API/REST
- name: 'Commit merged and documented output'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Merged and regenerated docs/APIs for revision ${{ steps.increment.outputs.newVersion }}
- name: 'Checkout dev site'
uses: actions/checkout@v3
with:
repository: RealEstateCore/realestatecore.github.io
path: realestatecore.github.io
token: ${{ secrets.CI_PUSH_PAT }}
- name: 'Delete old docs from dev site'
run: rm -rf ./realestatecore.github.io/ontology/*
- name: 'Copy new docs to dev site'
run: cp -r ./Doc/* ./realestatecore.github.io/ontology/
- name: 'Commit and push updated docs'
run: |
cd ./realestatecore.github.io/ontology/
git config --global user.email "[email protected]"
git config --global user.name "github-actions[bot]"
git add .
git commit -a -m "Updated docs to version ${{ steps.increment.outputs.newVersion }}"
git push