88jobs :
99 common-steps :
1010 runs-on : ubuntu-latest
11+ outputs :
12+ semver_Major : ${{ steps.gitversion.outputs.Major }}
13+ semver_Minor : ${{ steps.gitversion.outputs.Minor }}
1114 steps :
12- - name : install all the necessary packages
13- run : |
14- sudo apt update
15- echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
16- sudo apt -y install libreoffice ttf-mscorefonts-installer
15+ - name : install all the necessary packages
16+ run : |
17+ sudo apt update
18+ echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
19+ sudo apt -y install libreoffice ttf-mscorefonts-installer xmlstarlet
1720
18- - name : Checkout Oolite
19- uses : actions/checkout@v3
20- with :
21- path : oolite
22- fetch-depth : 0
23- submodules : true
21+ - name : Checkout Oolite
22+ uses : actions/checkout@v3
23+ with :
24+ path : oolite
25+ fetch-depth : 0
26+ submodules : true
2427
25- - name : generate PDFs
26- run : |
27- 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
28+ - name : Install GitVersion
29+ uses : gittools/actions/gitversion/setup@v0
30+ with :
31+ versionSpec : ' 5.x '
2932
30- - name : Archive generated documentation
31- uses : actions/upload-artifact@v3
32- with :
33- name : oolite-doc
34- path : |
35- oolite-doc.zip
36- retention-days : 5
33+ - name : configure semver from oolite-version.xcconfig
34+ run : |
35+ set -x
36+ OOLITE_VERSION=`cat oolite/src/Cocoa/oolite-version.xcconfig | cut -d= -f2`
37+ sed -i "s/next-version:.*/next-version: ${OOLITE_VERSION}/g" oolite/GitVersion.yml
38+ cat oolite/GitVersion.yml
39+
40+ - name : Determine Version
41+ id : gitversion
42+ uses : gittools/actions/gitversion/execute@v0
43+ with :
44+ targetPath : oolite
45+ useConfigFile : true
46+ configFilePath : oolite/GitVersion.yml
47+
48+ - name : version-bump other documents
49+ run : |
50+ set -x
51+ OOLITE_VERSION="${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}"
52+ echo "semver: ${OOLITE_VERSION}"
53+ ls -l oolite/installers/autopackage/
54+ sed -i "s/SoftwareVersion:.*/SoftwareVersion: ${OOLITE_VERSION}/g" oolite/installers/autopackage/default.x86.apspec
55+ cat oolite/installers/autopackage/default.x86.apspec
56+ sed -i "s/SoftwareVersion:.*/SoftwareVersion: ${OOLITE_VERSION}/g" oolite/installers/autopackage/default.x86_64.apspec
57+ cat oolite/installers/autopackage/default.x86_64.apspec
58+ xmlstarlet ed --inplace -u "/plist/dict/key[.='CFBundleVersion']/following-sibling::string[1]" -v "${OOLITE_VERSION}" oolite/src/Cocoa/Info-Oolite.plist
59+ cat oolite/src/Cocoa/Info-Oolite.plist
60+ sed -i "s/version\s*=.*/version = \"${OOLITE_VERSION}\";/g" oolite/DebugOXP/Debug.oxp/manifest.plist
61+ cat oolite/DebugOXP/Debug.oxp/manifest.plist
62+ sed -i "s/this.version\s*=.*/this.version = \"${OOLITE_VERSION}\";/g" oolite/DebugOXP/Debug.oxp/Scripts/oolite-debug-console.js
63+ cat oolite/DebugOXP/Debug.oxp/Scripts/oolite-debug-console.js
64+
65+ # this document shall be UTF16 but we need to edit UTF8
66+ iconv -f utf16 -t utf8 <oolite/Resources/InfoPlist.strings >oolite/Resources/InfoPlist.strings.utf8
67+ sed -i "s/CFBundleShortVersionString\s*=\s*\"Oolite version [^\"]*\";/CFBundleShortVersionString\s*=\s*\"Oolite version ${OOLITE_VERSION}\";/g" oolite/Resources/InfoPlist.strings.utf8
68+ iconv -f utf8 -t utf16 <oolite/Resources/InfoPlist.strings.utf8 >oolite/Resources/InfoPlist.strings
69+
70+ - name : generate PDFs
71+ run : |
72+ find oolite/Doc -name "*.odt" -exec soffice --headless --convert-to pdf:"writer_pdf_Export" --outdir oolite/Doc {} \;
73+ zip oolite-doc.zip \
74+ oolite/installers/autopackage/default.x86.apspec \
75+ oolite/installers/autopackage/default.x86_64.apspec \
76+ oolite/src/Cocoa/Info-Oolite.plist \
77+ oolite/DebugOXP/Debug.oxp/manifest.plist \
78+ oolite/Doc/*.pdf \
79+ oolite/Resources/InfoPlist.strings \
80+ oolite/DebugOXP/Debug.oxp/Scripts/oolite-debug-console.js
81+
82+ - name : Archive generated documentation
83+ uses : actions/upload-artifact@v3
84+ with :
85+ name : oolite-doc
86+ path : |
87+ oolite-doc.zip
88+ retention-days : 5
3789
3890 build-linux :
3991 runs-on : ubuntu-latest
64116
65117 - name : Extract PDFs
66118 run : |
67- unzip -u artifacts/oolite-doc.zip
119+ unzip -o artifacts/oolite-doc.zip
68120
69121 # This is for debugging only and helps developing the workflow.
70122 - name : show filesystem before build
@@ -136,7 +188,7 @@ jobs:
136188
137189 - name : Extract PDFs
138190 run : |
139- unzip -u artifacts/oolite-doc.zip
191+ unzip -o artifacts/oolite-doc.zip
140192
141193 # check http://aegidian.org/bb/viewtopic.php?p=281821#p281821
142194 # this is for debug only; it creates huge logs and takes a long time to execute
@@ -164,39 +216,49 @@ jobs:
164216
165217 build-doxygen :
166218 runs-on : ubuntu-latest
219+ needs : [common-steps]
167220 steps :
168- - name : Checkout Oolite
169- uses : actions/checkout@v3
170- with :
171- path : oolite
172- fetch-depth : 0
173- submodules : true
221+ - name : Checkout Oolite
222+ uses : actions/checkout@v3
223+ with :
224+ path : oolite
225+ fetch-depth : 0
226+ submodules : true
227+
228+ - name : configure doxygen
229+ run : |
230+ set -x
231+ OOLITE_VERSION="${{ needs.common-steps.outputs.semver_Major }}.${{ needs.common-steps.outputs.semver_Minor }}"
232+ sed -i "s/PROJECT_NUMBER\s*=.*/PROJECT_NUMBER=${OOLITE_VERSION}/g" oolite/Doxyfile
233+ cat oolite/Doxyfile
174234
175- - name : Run doxygen
176- uses :
mattnotmitt/[email protected] 177- with :
178- working-directory : oolite
235+ - name : Run doxygen
236+ uses :
mattnotmitt/[email protected] 237+ with :
238+ working-directory : oolite
179239
180- # # This is for debugging only and helps developing the workflow.
181- # - name: Environment Variables 1
182- # run: |
183- # printenv | sort
184- # find . -not -path "./oolite/deps/*" -not -path "./oolite/Mac-specific/*" -not -path "./oolite/.git/*"
240+ # # This is for debugging only and helps developing the workflow.
241+ # - name: Environment Variables 1
242+ # run: |
243+ # printenv | sort
244+ # find . -not -path "./oolite/deps/*" -not -path "./oolite/Mac-specific/*" -not -path "./oolite/.git/*"
185245
186- - name : create tar ball
187- run : |
188- tar cvfz oolite-apidoc.tgz -C oolite doxygen
189- # This is for debugging only and helps developing the workflow.
190- - name : Environment Variables 2
191- run : |
192- find . -not -path "./oolite/deps/*" -not -path "./oolite/Mac-specific/*" -not -path "./oolite/.git/*"
193- - name : Archive build tar ball
194- uses : actions/upload-artifact@v3
195- with :
196- name : oolite-documentation-nightly
197- path : |
198- oolite-*.tgz
199- retention-days : 5
246+ - name : create tar ball
247+ run : |
248+ tar cvfz oolite-apidoc-${{ needs.common-steps.outputs.semver_Major }}.${{ needs.common-steps.outputs.semver_Minor }}.tgz -C oolite doxygen
249+
250+ # This is for debugging only and helps developing the workflow.
251+ - name : Environment Variables 2
252+ run : |
253+ find . -not -path "./oolite/deps/*" -not -path "./oolite/Mac-specific/*" -not -path "./oolite/.git/*"
254+
255+ - name : Archive build tar ball
256+ uses : actions/upload-artifact@v3
257+ with :
258+ name : oolite-documentation-nightly
259+ path : |
260+ oolite-*.tgz
261+ retention-days : 5
200262
201263 release-marvinpinto :
202264 needs : [build-linux, build-windows, build-doxygen]
@@ -207,28 +269,28 @@ jobs:
207269 # run: |
208270 # printenv | sort
209271
210- - name : Download artifacts
211- uses : actions/download-artifact@v3
212- with :
213- path : artifacts
272+ - name : Download artifacts
273+ uses : actions/download-artifact@v3
274+ with :
275+ path : artifacts
214276
215- # This is for debugging only and helps developing the workflow.
216- - name : show filesystem after download
217- run : |
218- find .
277+ # This is for debugging only and helps developing the workflow.
278+ - name : show filesystem after download
279+ run : |
280+ find .
219281
220- # For changes on master branch, create a new release.
221- # It should move the 'latest' tag automatically.
222- - name : Create Release
223- if : github.ref == 'refs/heads/master'
224- id : create_release
225- uses : " marvinpinto/action-automatic-releases@latest"
226- with :
227- repo_token : " ${{ secrets.GITHUB_TOKEN }}"
228- automatic_release_tag : " latest"
229- prerelease : true
230- title : " Oolite Nightly"
231- files : |
232- artifacts/oolite-documentation-nightly/oolite-*.tgz
233- artifacts/oolite-linux-nightly/oolite-*.tgz
234- artifacts/oolite-windows-nightly/OoliteInstall*.exe
282+ # For changes on master branch, create a new release.
283+ # It should move the 'latest' tag automatically.
284+ - name : Create Release
285+ if : github.ref == 'refs/heads/master'
286+ id : create_release
287+ uses : " marvinpinto/action-automatic-releases@latest"
288+ with :
289+ repo_token : " ${{ secrets.GITHUB_TOKEN }}"
290+ automatic_release_tag : " latest"
291+ prerelease : true
292+ title : " Oolite Nightly"
293+ files : |
294+ artifacts/oolite-documentation-nightly/oolite-*.tgz
295+ artifacts/oolite-linux-nightly/oolite-*.tgz
296+ artifacts/oolite-windows-nightly/OoliteInstall*.exe
0 commit comments