-
Notifications
You must be signed in to change notification settings - Fork 14
143 lines (122 loc) · 4.31 KB
/
main.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
name: Deploy ModAPI Dlls & Update Documentation
on:
push:
branches:
- master
jobs:
compile:
name: Compile ModAPI core DLLS
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed to count all the commits
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Set up MSVC cmd
uses: ilammy/[email protected]
with:
arch: x86
- name: Compile DLLs
run: |
$count = git log --oneline | wc -l
echo "Building version $count"
msbuild "Spore ModAPI" -t:BuildDlls -p:BuildVer=$count -p:Config=Release
msbuild "Spore ModAPI" -t:BuildCombinedDll -p:BuildVer=$count -p:Config=Release
- name: Upload compiled files
uses: actions/upload-artifact@v4
with:
name: compiled-modapi-dlls
path: |
dll\Release\SporeModAPI.march2017.dll
dll\Release\SporeModAPI.disk.dll
dll\Release\SporeModAPI.combined.dll
dll\Release\SporeModAPI.lib
deploy:
name: Deploy ModAPI DLLs update
needs: compile
runs-on: ubuntu-latest
steps:
- name: Download compiled files
uses: actions/download-artifact@v4
with:
name: compiled-modapi-dlls
- name: Create update bundle
run: zip SporeModAPIdlls.zip SporeModAPI.march2017.dll SporeModAPI.disk.dll SporeModAPI.combined.dll SporeModAPI.lib
# - name: Upload dlls bundle
# uses: actions/[email protected]
# with:
# name: compiled-modapi-dlls-bundle
# path: SporeModAPIdlls.zip
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed to count all the commits
path: Spore-ModAPI
- name: Get version number
id: version_number
run: |
cd Spore-ModAPI
count=$(git log --oneline | wc -l)
echo "version=$count" >> $GITHUB_OUTPUT
- name: Get commit message
id: commit_message
run: |
cd Spore-ModAPI
message=$(git log -1 --pretty=%B)
echo "message=$message" >> $env:GITHUB_OUTPUT
- name: Release to GitHub
uses: softprops/action-gh-release@v1
with:
# prerelease: true
name: ModAPI SDK v2.5.${{ steps.version_number.outputs.version }}
tag_name: v2.5.${{ steps.version_number.outputs.version }}
body: ${{ steps.commit_message.outputs.message }}
files: SporeModAPIdlls.zip
documentation:
name: Generate documentation
runs-on: ubuntu-latest
steps:
- name: Install Doxygen
uses: ssciwr/[email protected]
- name: Setup Python
uses: actions/[email protected]
- name: Install Python dependencies
run: pip3 install jinja2 Pygments
- name: Checkout m.css repository
uses: actions/checkout@v4
with:
repository: emd4600/m.css
path: m.css
- name: Checkout ModAPI repository
uses: actions/checkout@v4
with:
path: Spore-ModAPI
fetch-depth: 0 # Needed to count all the commits
- name: Run m.css
run: |
cd Spore-ModAPI
python3 ../m.css/documentation/doxygen.py "Documentation/Doxygen-mcss.txt" --debug
- name: Commit documentation pages
run: |
cd Spore-ModAPI
count=$(git log --oneline | wc -l)
cd modapi-generated-docs/html
# Needed to ensure Jekyll is not run, as it omits certain files
touch .nojekyll
git init
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git remote add origin https://github.com/emd4600/Spore-ModAPI.git
git fetch
git symbolic-ref HEAD refs/remotes/origin/gh-pages
git reset
git add .
git commit -m "Documentation update $count"
- name: Upload changes to GitHub
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
directory: Spore-ModAPI/modapi-generated-docs/html