Skip to content

Commit 4752329

Browse files
Automate version bump (#430)
All but the LibreOffice documents get their version bumped by build process.
1 parent d2a28b1 commit 4752329

File tree

6 files changed

+176
-89
lines changed

6 files changed

+176
-89
lines changed

.github/workflows/build-all.yml

Lines changed: 138 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,84 @@ on:
88
jobs:
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
@@ -64,7 +116,7 @@ jobs:
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

Doc/AdviceForNewCommanders.doc

-446 KB
Binary file not shown.
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@
22

33
## Here are the things that should still be improved
44

5-
- Automatic handling of version numbers
5+
- (done) Automatic handling of version numbers (semver based on manually controlled
6+
major/minor numbers)
67
- distribute version number into other documents (see Version-bump.txt)
78
- LibreOffice documents shall be automatically converted into PDF to ensure the PDF version is current
89
- Prepare changelog and announcement messages for website and forum
910
- Prepare new downloads page for website
1011
- Publish downloads and news pages to the website
1112
- Publish announcement on the forum
13+
- further check http://aegidian.org/bb/viewtopic.php?p=289774#p289774
1214

1315
## Here are the steps that need to be executed
1416

15-
- Tag the version to be released on the master branch, which shall automatically trigger the full release cycle
17+
- Edit /src/Cocoa/oolite-version.xcconfig to contain the correct major/minor
18+
version numbers and push to Github. That shall automatically trigger the full
19+
(pre)release cycle
1620

1721
## Source
1822
The procedure is based on based on http://aegidian.org/bb/viewtopic.php?p=289632#p289632:

Doc/Version-bump.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
Prior to release:
22

33
- Minor & Major versions:
4-
installers/autopackage/default.x86.apspec
5-
installers/autopackage/default.x86_64.apspec
6-
src/Cocoa/Info-Oolite.plist
7-
src/Cocoa/oolite-version.xcconfig
8-
Resources/InfoPlist.strings (twice. note: UTF-16)
9-
DebugOXP/Debug.oxp/manifest.plist
4+
(automated) installers/autopackage/default.x86.apspec
5+
(automated) installers/autopackage/default.x86_64.apspec
6+
(automated) src/Cocoa/Info-Oolite.plist
7+
(master) src/Cocoa/oolite-version.xcconfig
8+
(automated) Resources/InfoPlist.strings (twice. note: UTF-16)
9+
(automated) DebugOXP/Debug.oxp/manifest.plist
1010

1111
- Major versions:
12-
Doc/OoliteReadMe.doc
13-
Doc/OoliteReadMe.pdf
12+
Doc/OoliteReadMe.odt
1413
http://wiki.alioth.net/index.php/Oolite_Instruction_Manual#Playing_the_game
1514
http://wiki.alioth.net/index.php/Pilot%27s_Reference_Manual
16-
DebugOXP/Resources/oolite-debug-console.js
15+
(automated) DebugOXP/Debug.oxp/Scripts/oolite-debug-console.js
1716

1817

1918
On release:

Doxyfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ PROJECT_NUMBER =
4444
# for a project that appears at the top of each page and should give viewer a
4545
# quick idea about the purpose of the project. Keep the description short.
4646

47-
PROJECT_BRIEF =
47+
PROJECT_BRIEF = "https://oolite.space"
4848

4949
# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
5050
# the documentation. The maximum height of the logo should not exceed 55 pixels
5151
# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
5252
# to the output directory.
5353

54-
PROJECT_LOGO =
54+
PROJECT_LOGO = "installers/FreeDesktop/oolite-icon.png"
5555

5656
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
5757
# into which the generated documentation will be written. If a relative path is

GitVersion.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
next-version: 1.0
2+
assembly-versioning-scheme: MajorMinorPatch
3+
assembly-file-versioning-scheme: MajorMinorPatch
4+
assembly-informational-format: '{InformationalVersion}'
5+
mode: ContinuousDelivery
6+
increment: Inherit
7+
continuous-delivery-fallback-tag: ci
8+
tag-prefix: '[vV]'
9+
major-version-bump-message: '\+semver:\s?(breaking|major)'
10+
minor-version-bump-message: '\+semver:\s?(feature|minor)'
11+
patch-version-bump-message: '\+semver:\s?(fix|patch)'
12+
no-bump-message: '\+semver:\s?(none|skip)'
13+
legacy-semver-padding: 4
14+
build-metadata-padding: 4
15+
commits-since-version-source-padding: 4
16+
tag-pre-release-weight: 60000
17+
commit-message-incrementing: Enabled
18+
ignore:
19+
sha: []
20+
commits-before: 2023-05-01T00:00:00
21+
merge-message-formats: {}
22+
update-build-number: true

0 commit comments

Comments
 (0)