3333 build-android :
3434 runs-on : windows-2025
3535 name : BrickController Android Build
36- env :
37- APP_DISPLAY_VERSION : " "
3836
3937 steps :
4038
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
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
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 }}
0 commit comments