-
-
Notifications
You must be signed in to change notification settings - Fork 37
166 lines (137 loc) · 5.21 KB
/
build-web.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Update Website
env:
listPublishDirectory: Website
pathToCi: ci
on:
workflow_dispatch:
workflow_run:
workflows: [Build Release]
types:
- completed
release:
types: [published, edited, created, unpublished, deleted, released]
push:
branches: ["main"]
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
InitialSetup:
name: initial-setup
runs-on: ubuntu-latest
outputs:
releaseTags: ${{ steps.get_latest_release.outputs.data }}
latestTag: ${{ steps.get_latest_release.outputs.latest }}
steps:
- uses: actions/checkout@v3 # check out this repo
with:
fetch-depth: 0 # fetch all history
- name: Get all tags for upcoming matrix
id: get_latest_release
run: |
echo "DATA=[\"$(echo $(git tag --sort=-creatordate ) | sed 's/ /\", \"/g')\"]" >> "$GITHUB_OUTPUT"
echo "LATEST=$(echo $(git tag -l --sort=-creatordate | head -n 1 ))" >> "$GITHUB_OUTPUT"
#echo "DATA=[\"1.0.1\", \"1.1.1\", \"OpenFlight-1.7.9\"]" >> "$GITHUB_OUTPUT"
DocMatrix:
needs: InitialSetup
strategy:
matrix:
release-tag: ${{ fromJSON(needs.InitialSetup.outputs.releaseTags) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 # check out this repo
with:
fetch-depth: 0 # fetch all history
ref: ${{ matrix.release-tag }}
- name: Checkout files
uses: Bhacaz/checkout-files@v2
with:
files: docs
#modify doxyfile to include tag version
- name: edit DoxyFile
run: sed -i -e 's/PROJECT_NUMBER =/PROJECT_NUMBER = ${{ matrix.release-tag }}/g' ./docs/Doxygen/DoxygenConfig
#Generate the doxygen documentation
- name: Generate C# Documentation
uses: mattnotmitt/[email protected]
with:
working-directory: "./docs/Doxygen/"
doxyfile-path: "./DoxygenConfig"
enable-latex: true
- name: Upload these docs
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.release-tag }}
path: './docs/Doxygen'
FinalWebBuild:
needs: [InitialSetup, DocMatrix]
name: final-web-build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 # check out this repo
with:
fetch-depth: 0 # fetch all history
- uses: actions/checkout@v3 # check out automation repo
with:
#repository: vrchat-community/package-list-action
repository: Happyrobot33/package-list-action #TODO: Change this to the main repo once it's merged
path: ${{env.pathToCi}}
clean: false # otherwise the local repo will no longer be checked out
- name: Download Docs
uses: actions/download-artifact@v4
with:
path: "./docs/"
- name: Add to main website
run: |
echo "* [Latest Scripting Documentation](${{ needs.InitialSetup.outputs.latest }}/Doxygen/html/index.html \":ignore title\")" >> ./docs/_sidebar.md
for tag in ${{ join(fromJSON(needs.InitialSetup.outputs.releaseTags), ' ') }}
do
echo " * [$tag]($tag/html/index.html \":ignore title\")" >> ./docs/_sidebar.md
done
#Copy docs into the website
- name: Copy Docs
uses: canastro/copy-action@master
with:
source: "./docs/."
target: "./${{env.listPublishDirectory}}/docs/"
flags: "-rp" #recursive and preserve timestamps
- name: Restore Timestamps
uses: chetan/git-restore-mtime-action@v1
- name: Restore Cache
uses: actions/cache@v3
with:
path: |
${{env.pathToCi}}/.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
- name: Build Package Version Listing
run: ${{env.pathToCi}}/build.cmd BuildMultiPackageListing --root ${{env.pathToCi}} --list-publish-directory $GITHUB_WORKSPACE/${{env.listPublishDirectory}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#This ensures that the scripts can always refer to the top level copy, allowing us to move it around in the project without issue
- name: Copy Data
uses: canastro/[email protected]
with:
source: "./Packages/com.mattshark.openflight/Runtime/data.json"
target: "./${{env.listPublishDirectory}}/data-original.json"
# Makes the file smaller for everyone to download
- name: Minify and copy data.json
run: jq -r tostring ./${{env.listPublishDirectory}}/data-original.json > ./${{env.listPublishDirectory}}/data.json
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ${{env.listPublishDirectory}}
#path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2