1
-
2
1
name : build-all
3
2
4
3
on :
@@ -22,11 +21,33 @@ jobs:
22
21
fetch-depth : 0
23
22
submodules : true
24
23
24
+ - name : Calculate version number and set OOLITE_VERSION
25
+ id : version
26
+ run : |
27
+ set -x
28
+ cd oolite
29
+ # Build version string,
30
+ # taking into account that we may have just two digits
31
+ VERSION=$(cat src/Cocoa/oolite-version.xcconfig | cut -d '=' -f 2)
32
+ VER_MAJ=$(echo ${VERSION} | cut -d. -f1)
33
+ VER_MIN=$(echo ${VERSION} | cut -d. -f2)
34
+ VER_REV=$(echo ${VERSION} | cut -d. -f3)
35
+ if [ "" == "${VER_REV}" ]
36
+ then
37
+ VER_REV="0"
38
+ fi
39
+ VER_DATE=$(date +%y%m%d)
40
+ VER_GITREV=$(git rev-list --count HEAD)
41
+ VER_GITHASH=$(git rev-parse --short=7 HEAD)
42
+ VER="${VER_MAJ}.${VER_MIN}.${VER_REV}.${VER_GITREV}-${VER_DATE}-${VER_GITHASH}"
43
+ echo "OOLITE_VERSION=${VER}" >> "$GITHUB_OUTPUT"
44
+ echo "OOLITE_VERSION=${VER}" >> Doc/OOLITE_VERSION.txt
45
+
25
46
- name : generate PDFs
26
47
run : |
27
48
find oolite/Doc -name "*.odt" -exec soffice --headless --convert-to pdf:"writer_pdf_Export" --outdir oolite/Doc {} \;
28
- zip oolite-doc.zip oolite/Doc/*.pdf
29
-
49
+ zip oolite-doc.zip oolite/Doc/*.pdf oolite/Doc/OOLITE_VERSION.txt
50
+
30
51
- name : Archive generated documentation
31
52
uses : actions/upload-artifact@v3
32
53
with :
40
61
needs : [common-steps]
41
62
steps :
42
63
# # This is for debugging only and helps developing the workflow.
43
- # - name: Environment Variables
64
+ # - name: Environment Variables
44
65
# run: |
45
66
# printenv | sort
46
67
61
82
with :
62
83
name : oolite-doc
63
84
path : artifacts
64
-
85
+
65
86
- name : Extract PDFs
66
87
run : |
67
88
unzip -u artifacts/oolite-doc.zip
@@ -70,15 +91,15 @@ jobs:
70
91
- name : show filesystem before build
71
92
run : |
72
93
find . -not -path "./oolite/deps/Windows-deps/*" -not -path "./oolite/Mac-specific/*" -not -path "./oolite/.git/*"
73
-
94
+
74
95
- name : compiling up to installer script (.run file)
75
96
run : |
76
97
cd oolite
77
98
source /usr/share/GNUstep/Makefiles/GNUstep.sh
78
99
make -f Makefile pkg-posix-nightly HOST_ARCH=$(uname -m)
79
-
100
+
80
101
# # This is for debugging only and helps developing the workflow.
81
- # - name: show filesystem after build
102
+ # - name: show filesystem after build
82
103
# run: |
83
104
# find . -not -path "./oolite/Mac-specific/*" -not -path "./oolite/deps/Windows-deps/*" -not -path "./oolite/tests/*" -not -path "./oolite/.git/*" -not -path "./oolite/deps/mozilla/*"
84
105
@@ -91,34 +112,34 @@ jobs:
91
112
run : |
92
113
NAME=$(basename oolite-nightly/oolite-*.run .run)
93
114
tar cvfz ${NAME}.tgz -C oolite-nightly .
94
-
115
+
95
116
# This is for debugging only and helps developing the workflow.
96
117
- name : show filesystem after installer
97
118
run : |
98
119
find . -not -path "./oolite/Mac-specific/*" -not -path "./oolite/deps/*" -not -path "./oolite/tests/*" -not -path "./oolite/.git/*"
99
-
120
+
100
121
- name : Archive build tar ball
101
122
uses : actions/upload-artifact@v3
102
123
with :
103
124
name : oolite-linux-nightly
104
125
path : |
105
126
oolite-*.tgz
106
127
retention-days : 5
107
-
128
+
108
129
109
130
build-windows :
110
131
runs-on : windows-latest
111
132
needs : [common-steps]
112
133
steps :
113
134
# # This is for debugging only and helps developing the workflow.
114
- # - name: Environment Variables
135
+ # - name: Environment Variables
115
136
# run: |
116
137
# Get-ChildItem Env: | Sort Name
117
138
118
139
- name : Checkout DevelopmentEnvironment
119
140
uses : actions/checkout@v3
120
141
with :
121
- repository : OoliteProject/oolite-windows-build-env
142
+ repository : OoliteProject/oolite-windows-build-env
122
143
path : DevelopmentEnvironment
123
144
124
145
- name : Checkout Oolite
@@ -133,7 +154,7 @@ jobs:
133
154
with :
134
155
name : oolite-doc
135
156
path : artifacts
136
-
157
+
137
158
- name : Extract PDFs
138
159
run : |
139
160
unzip -u artifacts/oolite-doc.zip
@@ -147,7 +168,7 @@ jobs:
147
168
- name : Compile
148
169
shell : cmd
149
170
run : D:\a\oolite\oolite\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.cmd
150
-
171
+
151
172
# check http://aegidian.org/bb/viewtopic.php?p=281821#p281821
152
173
# this is for debug only; it creates huge logs and takes a long time to execute, yet you never know when you need it
153
174
- name : check filesystem
@@ -164,6 +185,7 @@ jobs:
164
185
165
186
build-doxygen :
166
187
runs-on : ubuntu-latest
188
+ needs : [common-steps]
167
189
steps :
168
190
- name : Checkout Oolite
169
191
uses : actions/checkout@v3
@@ -172,24 +194,45 @@ jobs:
172
194
fetch-depth : 0
173
195
submodules : true
174
196
197
+ - name : Download artifacts
198
+ uses : actions/download-artifact@v3
199
+ with :
200
+ name : oolite-doc
201
+ path : artifacts
202
+
203
+ - name : Extract artifacts
204
+ run : |
205
+ unzip -u artifacts/oolite-doc.zip
206
+
207
+ - name : set version
208
+ id : version
209
+ run : |
210
+ OOLITE_VERSION=$(cat oolite/Doc/OOLITE_VERSION.txt | cut -d= -f2)
211
+ echo "OOLITE_VERSION=${OOLITE_VERSION}" >> "$GITHUB_OUTPUT"
212
+ sed -i -e "/PROJECT_NUMBER\s*=/ s/=.*/=${OOLITE_VERSION}/" oolite/Doxyfile
213
+ cat oolite/Doxyfile
214
+
175
215
- name : Run doxygen
176
216
uses :
mattnotmitt/[email protected]
177
217
with :
178
218
working-directory : oolite
219
+ # OOLITE_VERSION: ${{ steps.version.outputs.OOLITE_VERSION }}
179
220
180
221
# # This is for debugging only and helps developing the workflow.
181
- # - name: Environment Variables 1
222
+ # - name: Environment Variables 1
182
223
# run: |
183
224
# printenv | sort
184
225
# find . -not -path "./oolite/deps/*" -not -path "./oolite/Mac-specific/*" -not -path "./oolite/.git/*"
185
226
186
227
- name : create tar ball
187
228
run : |
188
- tar cvfz oolite-apidoc.tgz -C oolite doxygen
229
+ tar cvfz oolite-apidoc-${{ steps.version.outputs.OOLITE_VERSION }}.tgz -C oolite doxygen
230
+
189
231
# This is for debugging only and helps developing the workflow.
190
232
- name : Environment Variables 2
191
233
run : |
192
234
find . -not -path "./oolite/deps/*" -not -path "./oolite/Mac-specific/*" -not -path "./oolite/.git/*"
235
+
193
236
- name : Archive build tar ball
194
237
uses : actions/upload-artifact@v3
195
238
with :
@@ -203,7 +246,7 @@ jobs:
203
246
runs-on : ubuntu-latest
204
247
steps :
205
248
# # This is for debugging only and helps developing the workflow.
206
- # - name: Environment Variables
249
+ # - name: Environment Variables
207
250
# run: |
208
251
# printenv | sort
209
252
@@ -212,11 +255,32 @@ jobs:
212
255
with :
213
256
path : artifacts
214
257
258
+ - name : Extract artifacts
259
+ run : |
260
+ unzip -u artifacts/oolite-doc.zip
261
+
262
+ - name : set version
263
+ id : version
264
+ run : |
265
+ OOLITE_VERSION=$(cat oolite/Doc/OOLITE_VERSION.txt | cut -d= -f2)
266
+
215
267
# This is for debugging only and helps developing the workflow.
216
268
- name : show filesystem after download
217
269
run : |
218
270
find .
219
-
271
+
272
+ - name : Remove old prereleases
273
+ if : github.ref != 'refs/heads/master'
274
+
275
+ with :
276
+ # repo: <owner>/<repoName> # defaults to current repo
277
+ keep_latest : 7
278
+ # delete_tag_pattern: v\d+\.\d+\.\d+-.*
279
+ delete_type : ' prerelease'
280
+ # delete_branch: '${{ github.ref_name }}'
281
+ env :
282
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
283
+
220
284
# For changes on master branch, create a new release.
221
285
# It should move the 'latest' tag automatically.
222
286
- name : Create Release
@@ -225,9 +289,10 @@ jobs:
225
289
uses : " marvinpinto/action-automatic-releases@latest"
226
290
with :
227
291
repo_token : " ${{ secrets.GITHUB_TOKEN }}"
228
- automatic_release_tag : " latest"
292
+ # automatic_release_tag: "latest"
293
+ automatic_release_tag : " ${{ steps.version.outputs.OOLITE_VERSION }}"
229
294
prerelease : true
230
- title : " Oolite Nightly "
295
+ title : " Oolite ${{ steps.version.outputs.OOLITE_VERSION }} "
231
296
files : |
232
297
artifacts/oolite-documentation-nightly/oolite-*.tgz
233
298
artifacts/oolite-linux-nightly/oolite-*.tgz
0 commit comments