Skip to content

Commit 5d59141

Browse files
authored
Unify release app versioning + fix IOS builds: XCODE 26 (#182)
1 parent e23c676 commit 5d59141

3 files changed

Lines changed: 24 additions & 47 deletions

File tree

.github/workflows/build-android.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ jobs:
3333
build-android:
3434
runs-on: windows-2025
3535
name: BrickController Android Build
36-
env:
37-
APP_DISPLAY_VERSION: ""
3836

3937
steps:
4038

@@ -44,6 +42,10 @@ jobs:
4442
with:
4543
dotnet-version: 9.0.x
4644

45+
- name: Get App Version from Build Properties
46+
shell: bash
47+
run: echo "APP_VERSION=$(sed -n 's|.*<ApplicationDisplayVersion>\(.*\)</ApplicationDisplayVersion>.*|\1|p' Directory.Build.props)" >> $GITHUB_ENV
48+
4749
- name: Find Current Release Info
4850
if: github.event_name == 'release' && github.event.action == 'published'
4951
id: get_release
@@ -53,11 +55,6 @@ jobs:
5355
env:
5456
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5557

56-
- name: Set APP_DISPLAY_VERSION for release
57-
if: github.event_name == 'release' && github.event.action == 'published'
58-
shell: bash
59-
run: echo "APP_DISPLAY_VERSION=$(echo '${{ fromJson(steps.get_release.outputs.data).tag_name }}')" >> $GITHUB_ENV
60-
6158
- name: Restore Dependencies
6259
run: dotnet restore BrickController2/BrickController2.Android/BrickController2.Android.csproj
6360
- name: Setup Android signing
@@ -68,18 +65,18 @@ jobs:
6865
-c Release `
6966
-f net9.0-android `
7067
--no-restore `
71-
-p:ApplicationDisplayVersion="${{ env.APP_DISPLAY_VERSION }}" `
68+
-p:ApplicationVersion="${{ github.run_number }}" `
7269
-p:AndroidSigningKeyPass=${{secrets.KEYSTORE_PASSWORD}} `
7370
-p:AndroidSigningStorePass=${{secrets.KEYSTORE_PASSWORD}} `
7471
-p:AndroidPackageFormat=apk
7572

76-
- name: Build MAUI Android (AAB)
73+
- name: Build MAUI Android (AAB) for Release
7774
if: github.event_name == 'release' && github.event.action == 'published'
7875
run: dotnet publish BrickController2/BrickController2.Android/BrickController2.Android.csproj `
7976
-c Release `
8077
-f net9.0-android `
8178
--no-restore `
82-
-p:ApplicationDisplayVersion="${{ env.APP_DISPLAY_VERSION }}" `
79+
-p:ApplicationVersion="${{ github.run_number }}" `
8380
-p:AndroidSigningKeyPass=${{secrets.KEYSTORE_PASSWORD}} `
8481
-p:AndroidSigningStorePass=${{secrets.KEYSTORE_PASSWORD}} `
8582
-p:AndroidPackageFormat=aab
@@ -96,7 +93,7 @@ jobs:
9693
with:
9794
upload_url: ${{ fromJson(steps.get_release.outputs.data).upload_url }}
9895
asset_path: BrickController2/BrickController2.Android/bin/Release/net9.0-android/cz.vico.BrickControllerLegacy-Signed.apk
99-
asset_name: BrickControllerLegacy_${{env.APP_DISPLAY_VERSION}}.apk
96+
asset_name: BrickControllerLegacy_${{env.APP_VERSION}}.apk
10097
asset_content_type: application/vnd.android.package-archive
10198
env:
10299
GITHUB_TOKEN: ${{ secrets.CI_RELEASE_ASSETS_PAT }}
@@ -107,7 +104,7 @@ jobs:
107104
with:
108105
upload_url: ${{ fromJson(steps.get_release.outputs.data).upload_url }}
109106
asset_path: BrickController2/BrickController2.Android/bin/Release/net9.0-android/cz.vico.BrickControllerLegacy-Signed.aab
110-
asset_name: BrickControllerLegacy_${{env.APP_DISPLAY_VERSION}}.aab
107+
asset_name: BrickControllerLegacy_${{env.APP_VERSION}}.aab
111108
asset_content_type: application/x-authorware-bin
112109
env:
113110
GITHUB_TOKEN: ${{ secrets.CI_RELEASE_ASSETS_PAT }}

.github/workflows/build-ios.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,23 @@ permissions:
3131

3232
jobs:
3333
build-ios:
34-
runs-on: macos-15
34+
runs-on: macos-26
3535
name: BrickController iOS Build
36-
env:
37-
APP_DISPLAY_VERSION: ""
36+
3837
steps:
3938
- uses: actions/checkout@v4
4039
- name: Setup .NET
4140
uses: actions/setup-dotnet@v4
4241
with:
4342
dotnet-version: 9.0.x
44-
45-
# fix error with missing XCode 16.4
46-
- name: Select Xcode 16.4
47-
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
4843

4944
- name: Install MAUI workload
5045
run: dotnet workload install maui
5146

47+
- name: Get App Version from Build Properties
48+
shell: bash
49+
run: echo "APP_VERSION=$(sed -n 's|.*<ApplicationDisplayVersion>\(.*\)</ApplicationDisplayVersion>.*|\1|p' Directory.Build.props)" >> $GITHUB_ENV
50+
5251
- name: Find Current Release Info
5352
if: github.event_name == 'release' && github.event.action == 'published'
5453
id: get_release
@@ -58,11 +57,6 @@ jobs:
5857
env:
5958
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6059

61-
- name: Set APP_DISPLAY_VERSION for release
62-
if: github.event_name == 'release' && github.event.action == 'published'
63-
shell: bash
64-
run: echo "APP_DISPLAY_VERSION=$(echo '${{ fromJson(steps.get_release.outputs.data).tag_name }}')" >> $GITHUB_ENV
65-
6660
- name: Import Code-Signing Certificates
6761
uses: Apple-Actions/import-codesign-certs@v1
6862
with:
@@ -92,7 +86,7 @@ jobs:
9286
-p:EnableAssemblyILStripping=false
9387
-p:CodesignKey="iPhone Distribution"
9488
-p:CodesignProvision=Automatic
95-
-p:ApplicationDisplayVersion="${{ env.APP_DISPLAY_VERSION }}"
89+
-p:ApplicationVersion="${{ github.run_number }}"
9690
9791
- name: List build output
9892
run: ls -R BrickController2/BrickController2.iOS/bin/Release/net9.0-ios/ios-arm64/publish/
@@ -109,7 +103,7 @@ jobs:
109103
with:
110104
upload_url: ${{ fromJson(steps.get_release.outputs.data).upload_url }}
111105
asset_path: BrickController2/BrickController2.iOS/bin/Release/net9.0-ios/ios-arm64/publish/BrickController2.iOS.ipa
112-
asset_name: BrickControllerLegacy_${{env.APP_DISPLAY_VERSION}}.ipa
106+
asset_name: BrickControllerLegacy_${{env.APP_VERSION}}.ipa
113107
asset_content_type: application/octet-stream
114108
env:
115109
GITHUB_TOKEN: ${{ secrets.CI_RELEASE_ASSETS_PAT }}

.github/workflows/build-windows.yml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ jobs:
3636
build-winui:
3737
runs-on: windows-2025
3838
name: BrickController WinUI Build
39-
env:
40-
APP_DISPLAY_VERSION: ""
41-
APP_PACKAGE_VERSION: ""
4239

4340
steps:
4441
- uses: actions/checkout@v4
@@ -47,6 +44,10 @@ jobs:
4744
with:
4845
dotnet-version: 9.0.x
4946

47+
- name: Get App Version from Build Properties
48+
shell: bash
49+
run: echo "APP_VERSION=$(sed -n 's|.*<ApplicationDisplayVersion>\(.*\)</ApplicationDisplayVersion>.*|\1|p' Directory.Build.props)" >> $GITHUB_ENV
50+
5051
- name: Find Current Release Info
5152
if: github.event_name == 'release' && github.event.action == 'published'
5253
id: get_release
@@ -56,19 +57,6 @@ jobs:
5657
env:
5758
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5859

59-
- name: Set app version for release
60-
if: github.event_name == 'release' && github.event.action == 'published'
61-
shell: bash
62-
run: |
63-
TAG_NAME=$(echo '${{ fromJson(steps.get_release.outputs.data).tag_name }}')
64-
# Split the tag into parts, remove leading zeros and add missing parts as zeros
65-
IFS='.' read -r -a VERSION_PARTS <<< "$TAG_NAME"
66-
for i in "${!VERSION_PARTS[@]}"; do
67-
VERSION_PARTS[$i]=$(echo "${VERSION_PARTS[$i]}" | sed 's/^0*//')
68-
done
69-
echo "APP_DISPLAY_VERSION=$TAG_NAME" >> $GITHUB_ENV
70-
echo "APP_PACKAGE_VERSION=${VERSION_PARTS[0]:-0}.${VERSION_PARTS[1]:-0}.${VERSION_PARTS[2]:-0}.${VERSION_PARTS[3]:-0}" >> $GITHUB_ENV
71-
7260
- name: Decode Signing Certificate
7361
run: |
7462
echo "${{ secrets.SIGNING_CERTIFICATE_BASE_64_CONTENT }}" > cert.asc
@@ -85,9 +73,7 @@ jobs:
8573
-c Release `
8674
-r win10-x64 `
8775
-p:Platform=x64 `
88-
-p:ApplicationDisplayVersion="${{ env.APP_DISPLAY_VERSION }}" `
89-
-p:ApplicationVersion="0" `
90-
-p:PackageVersion="${{ env.APP_PACKAGE_VERSION }}"
76+
-p:ApplicationVersion="${{ github.run_number }}"
9177

9278
- name: Build MAUI WinUI App
9379
run: dotnet publish ${{env.PROJECT_PATH}} `
@@ -109,8 +95,8 @@ jobs:
10995
uses: actions/upload-release-asset@v1
11096
with:
11197
upload_url: ${{ fromJson(steps.get_release.outputs.data).upload_url }}
112-
asset_path: BrickController2\BrickController2.WinUI\bin\x64\Release\net9.0-windows10.0.19041.0\win10-x64\AppPackages\BrickController2.WinUI_${{env.APP_PACKAGE_VERSION}}_Test\BrickController2.WinUI_${{env.APP_PACKAGE_VERSION}}_x64.msix
113-
asset_name: BrickControllerLegacy_${{env.APP_DISPLAY_VERSION}}.msix
98+
asset_path: BrickController2\BrickController2.WinUI\bin\x64\Release\net9.0-windows10.0.19041.0\win10-x64\AppPackages\BrickController2.WinUI_${{env.APP_VERSION}}.${{github.run_number}}_Test\BrickController2.WinUI_${{env.APP_VERSION}}.${{github.run_number}}_x64.msix
99+
asset_name: BrickControllerLegacy_${{env.APP_VERSION}}.msix
114100
asset_content_type: application/vnd.ms-appx
115101
env:
116102
GITHUB_TOKEN: ${{ secrets.CI_RELEASE_ASSETS_PAT }}

0 commit comments

Comments
 (0)