Skip to content

Commit

Permalink
Automate version bump (#430)
Browse files Browse the repository at this point in the history
All but the LibreOffice documents get their version bumped by build process.
  • Loading branch information
HiranChaudhuri authored Jun 29, 2023
1 parent d2a28b1 commit 4752329
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 89 deletions.
214 changes: 138 additions & 76 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,84 @@ on:
jobs:
common-steps:
runs-on: ubuntu-latest
outputs:
semver_Major: ${{ steps.gitversion.outputs.Major }}
semver_Minor: ${{ steps.gitversion.outputs.Minor }}
steps:
- name: install all the necessary packages
run: |
sudo apt update
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt -y install libreoffice ttf-mscorefonts-installer
- name: install all the necessary packages
run: |
sudo apt update
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt -y install libreoffice ttf-mscorefonts-installer xmlstarlet
- name: Checkout Oolite
uses: actions/checkout@v3
with:
path: oolite
fetch-depth: 0
submodules: true
- name: Checkout Oolite
uses: actions/checkout@v3
with:
path: oolite
fetch-depth: 0
submodules: true

- name: generate PDFs
run: |
find oolite/Doc -name "*.odt" -exec soffice --headless --convert-to pdf:"writer_pdf_Export" --outdir oolite/Doc {} \;
zip oolite-doc.zip oolite/Doc/*.pdf
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'

- name: Archive generated documentation
uses: actions/upload-artifact@v3
with:
name: oolite-doc
path: |
oolite-doc.zip
retention-days: 5
- name: configure semver from oolite-version.xcconfig
run: |
set -x
OOLITE_VERSION=`cat oolite/src/Cocoa/oolite-version.xcconfig | cut -d= -f2`
sed -i "s/next-version:.*/next-version: ${OOLITE_VERSION}/g" oolite/GitVersion.yml
cat oolite/GitVersion.yml
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0
with:
targetPath: oolite
useConfigFile: true
configFilePath: oolite/GitVersion.yml

- name: version-bump other documents
run: |
set -x
OOLITE_VERSION="${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}"
echo "semver: ${OOLITE_VERSION}"
ls -l oolite/installers/autopackage/
sed -i "s/SoftwareVersion:.*/SoftwareVersion: ${OOLITE_VERSION}/g" oolite/installers/autopackage/default.x86.apspec
cat oolite/installers/autopackage/default.x86.apspec
sed -i "s/SoftwareVersion:.*/SoftwareVersion: ${OOLITE_VERSION}/g" oolite/installers/autopackage/default.x86_64.apspec
cat oolite/installers/autopackage/default.x86_64.apspec
xmlstarlet ed --inplace -u "/plist/dict/key[.='CFBundleVersion']/following-sibling::string[1]" -v "${OOLITE_VERSION}" oolite/src/Cocoa/Info-Oolite.plist
cat oolite/src/Cocoa/Info-Oolite.plist
sed -i "s/version\s*=.*/version = \"${OOLITE_VERSION}\";/g" oolite/DebugOXP/Debug.oxp/manifest.plist
cat oolite/DebugOXP/Debug.oxp/manifest.plist
sed -i "s/this.version\s*=.*/this.version = \"${OOLITE_VERSION}\";/g" oolite/DebugOXP/Debug.oxp/Scripts/oolite-debug-console.js
cat oolite/DebugOXP/Debug.oxp/Scripts/oolite-debug-console.js
# this document shall be UTF16 but we need to edit UTF8
iconv -f utf16 -t utf8 <oolite/Resources/InfoPlist.strings >oolite/Resources/InfoPlist.strings.utf8
sed -i "s/CFBundleShortVersionString\s*=\s*\"Oolite version [^\"]*\";/CFBundleShortVersionString\s*=\s*\"Oolite version ${OOLITE_VERSION}\";/g" oolite/Resources/InfoPlist.strings.utf8
iconv -f utf8 -t utf16 <oolite/Resources/InfoPlist.strings.utf8 >oolite/Resources/InfoPlist.strings
- name: generate PDFs
run: |
find oolite/Doc -name "*.odt" -exec soffice --headless --convert-to pdf:"writer_pdf_Export" --outdir oolite/Doc {} \;
zip oolite-doc.zip \
oolite/installers/autopackage/default.x86.apspec \
oolite/installers/autopackage/default.x86_64.apspec \
oolite/src/Cocoa/Info-Oolite.plist \
oolite/DebugOXP/Debug.oxp/manifest.plist \
oolite/Doc/*.pdf \
oolite/Resources/InfoPlist.strings \
oolite/DebugOXP/Debug.oxp/Scripts/oolite-debug-console.js
- name: Archive generated documentation
uses: actions/upload-artifact@v3
with:
name: oolite-doc
path: |
oolite-doc.zip
retention-days: 5

build-linux:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -64,7 +116,7 @@ jobs:

- name: Extract PDFs
run: |
unzip -u artifacts/oolite-doc.zip
unzip -o artifacts/oolite-doc.zip
# This is for debugging only and helps developing the workflow.
- name: show filesystem before build
Expand Down Expand Up @@ -136,7 +188,7 @@ jobs:

- name: Extract PDFs
run: |
unzip -u artifacts/oolite-doc.zip
unzip -o artifacts/oolite-doc.zip
# check http://aegidian.org/bb/viewtopic.php?p=281821#p281821
# this is for debug only; it creates huge logs and takes a long time to execute
Expand Down Expand Up @@ -164,39 +216,49 @@ jobs:

build-doxygen:
runs-on: ubuntu-latest
needs: [common-steps]
steps:
- name: Checkout Oolite
uses: actions/checkout@v3
with:
path: oolite
fetch-depth: 0
submodules: true
- name: Checkout Oolite
uses: actions/checkout@v3
with:
path: oolite
fetch-depth: 0
submodules: true

- name: configure doxygen
run: |
set -x
OOLITE_VERSION="${{ needs.common-steps.outputs.semver_Major }}.${{ needs.common-steps.outputs.semver_Minor }}"
sed -i "s/PROJECT_NUMBER\s*=.*/PROJECT_NUMBER=${OOLITE_VERSION}/g" oolite/Doxyfile
cat oolite/Doxyfile
- name: Run doxygen
uses: mattnotmitt/[email protected]
with:
working-directory: oolite
- name: Run doxygen
uses: mattnotmitt/[email protected]
with:
working-directory: oolite

## This is for debugging only and helps developing the workflow.
#- name: Environment Variables 1
# run: |
# printenv | sort
# find . -not -path "./oolite/deps/*" -not -path "./oolite/Mac-specific/*" -not -path "./oolite/.git/*"
## This is for debugging only and helps developing the workflow.
#- name: Environment Variables 1
# run: |
# printenv | sort
# find . -not -path "./oolite/deps/*" -not -path "./oolite/Mac-specific/*" -not -path "./oolite/.git/*"

- name: create tar ball
run: |
tar cvfz oolite-apidoc.tgz -C oolite doxygen
# This is for debugging only and helps developing the workflow.
- name: Environment Variables 2
run: |
find . -not -path "./oolite/deps/*" -not -path "./oolite/Mac-specific/*" -not -path "./oolite/.git/*"
- name: Archive build tar ball
uses: actions/upload-artifact@v3
with:
name: oolite-documentation-nightly
path: |
oolite-*.tgz
retention-days: 5
- name: create tar ball
run: |
tar cvfz oolite-apidoc-${{ needs.common-steps.outputs.semver_Major }}.${{ needs.common-steps.outputs.semver_Minor }}.tgz -C oolite doxygen
# This is for debugging only and helps developing the workflow.
- name: Environment Variables 2
run: |
find . -not -path "./oolite/deps/*" -not -path "./oolite/Mac-specific/*" -not -path "./oolite/.git/*"
- name: Archive build tar ball
uses: actions/upload-artifact@v3
with:
name: oolite-documentation-nightly
path: |
oolite-*.tgz
retention-days: 5

release-marvinpinto:
needs: [build-linux, build-windows, build-doxygen]
Expand All @@ -207,28 +269,28 @@ jobs:
# run: |
# printenv | sort

- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts

# This is for debugging only and helps developing the workflow.
- name: show filesystem after download
run: |
find .
# This is for debugging only and helps developing the workflow.
- name: show filesystem after download
run: |
find .
# For changes on master branch, create a new release.
# It should move the 'latest' tag automatically.
- name: Create Release
if: github.ref == 'refs/heads/master'
id: create_release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Oolite Nightly"
files: |
artifacts/oolite-documentation-nightly/oolite-*.tgz
artifacts/oolite-linux-nightly/oolite-*.tgz
artifacts/oolite-windows-nightly/OoliteInstall*.exe
# For changes on master branch, create a new release.
# It should move the 'latest' tag automatically.
- name: Create Release
if: github.ref == 'refs/heads/master'
id: create_release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Oolite Nightly"
files: |
artifacts/oolite-documentation-nightly/oolite-*.tgz
artifacts/oolite-linux-nightly/oolite-*.tgz
artifacts/oolite-windows-nightly/OoliteInstall*.exe
Binary file removed Doc/AdviceForNewCommanders.doc
Binary file not shown.
8 changes: 6 additions & 2 deletions Doc/Release_Proedure.md → Doc/Release_Procedure.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@

## Here are the things that should still be improved

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

## Here are the steps that need to be executed

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

## Source
The procedure is based on based on http://aegidian.org/bb/viewtopic.php?p=289632#p289632:
Expand Down
17 changes: 8 additions & 9 deletions Doc/Version-bump.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
Prior to release:

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

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


On release:
Expand Down
4 changes: 2 additions & 2 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ PROJECT_NUMBER =
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.

PROJECT_BRIEF =
PROJECT_BRIEF = "https://oolite.space"

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

PROJECT_LOGO =
PROJECT_LOGO = "installers/FreeDesktop/oolite-icon.png"

# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
Expand Down
22 changes: 22 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
next-version: 1.0
assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatch
assembly-informational-format: '{InformationalVersion}'
mode: ContinuousDelivery
increment: Inherit
continuous-delivery-fallback-tag: ci
tag-prefix: '[vV]'
major-version-bump-message: '\+semver:\s?(breaking|major)'
minor-version-bump-message: '\+semver:\s?(feature|minor)'
patch-version-bump-message: '\+semver:\s?(fix|patch)'
no-bump-message: '\+semver:\s?(none|skip)'
legacy-semver-padding: 4
build-metadata-padding: 4
commits-since-version-source-padding: 4
tag-pre-release-weight: 60000
commit-message-incrementing: Enabled
ignore:
sha: []
commits-before: 2023-05-01T00:00:00
merge-message-formats: {}
update-build-number: true

0 comments on commit 4752329

Please sign in to comment.