From d72d1b0034056c491e23d61782e6aab5e1f62a2e Mon Sep 17 00:00:00 2001 From: Federico Maccaroni Date: Tue, 8 Oct 2024 18:50:21 -0300 Subject: [PATCH 01/22] Pinning MauiVersion hardcoded to 8.0.7 to avoid using the MauiVersion variable. Also pinning .NET version to use to 8.0.7 so it's the same one as the latest public release. --- .github/workflows/build.yml | 2 +- src/App/App.csproj | 4 ++-- src/Core/Core.csproj | 4 ++-- src/iOS.Autofill/iOS.Autofill.csproj | 4 ++-- src/iOS.Core/iOS.Core.csproj | 4 ++-- src/iOS.Extension/iOS.Extension.csproj | 4 ++-- src/iOS.ShareExtension/iOS.ShareExtension.csproj | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 249c67a3a..9106f3a74 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -445,7 +445,7 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 with: - dotnet-version: '8.0.x' + dotnet-version: '8.0.7' # This step might be obsolete at some point as .NET MAUI workloads # are starting to come pre-installed on the GH Actions build agents. diff --git a/src/App/App.csproj b/src/App/App.csproj index 900e5e048..51e4525fc 100644 --- a/src/App/App.csproj +++ b/src/App/App.csproj @@ -83,8 +83,8 @@ - - + + diff --git a/src/Core/Core.csproj b/src/Core/Core.csproj index 3f880f911..7281ed116 100644 --- a/src/Core/Core.csproj +++ b/src/Core/Core.csproj @@ -26,8 +26,8 @@ - - + + diff --git a/src/iOS.Autofill/iOS.Autofill.csproj b/src/iOS.Autofill/iOS.Autofill.csproj index 2947ad3ee..9a574f14e 100644 --- a/src/iOS.Autofill/iOS.Autofill.csproj +++ b/src/iOS.Autofill/iOS.Autofill.csproj @@ -143,8 +143,8 @@ - - + + diff --git a/src/iOS.Core/iOS.Core.csproj b/src/iOS.Core/iOS.Core.csproj index 99716ff25..66aed0460 100644 --- a/src/iOS.Core/iOS.Core.csproj +++ b/src/iOS.Core/iOS.Core.csproj @@ -23,8 +23,8 @@ - - + + diff --git a/src/iOS.Extension/iOS.Extension.csproj b/src/iOS.Extension/iOS.Extension.csproj index 58a596b0f..494941bcb 100644 --- a/src/iOS.Extension/iOS.Extension.csproj +++ b/src/iOS.Extension/iOS.Extension.csproj @@ -111,8 +111,8 @@ - - + + diff --git a/src/iOS.ShareExtension/iOS.ShareExtension.csproj b/src/iOS.ShareExtension/iOS.ShareExtension.csproj index 429a91e17..85aefe879 100644 --- a/src/iOS.ShareExtension/iOS.ShareExtension.csproj +++ b/src/iOS.ShareExtension/iOS.ShareExtension.csproj @@ -102,8 +102,8 @@ - - + + From e175d4759a4ea957052c9f46638a026fd82538f0 Mon Sep 17 00:00:00 2001 From: Federico Maccaroni Date: Tue, 8 Oct 2024 18:56:34 -0300 Subject: [PATCH 02/22] Pinned dotnet version to 8.0.303 which was the latest one of the latest public release --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9106f3a74..b0932df14 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -445,7 +445,7 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 with: - dotnet-version: '8.0.7' + dotnet-version: '8.0.303' # This step might be obsolete at some point as .NET MAUI workloads # are starting to come pre-installed on the GH Actions build agents. From 2ad9881779c201269048abc70d8685feae09370d Mon Sep 17 00:00:00 2001 From: Federico Maccaroni Date: Tue, 8 Oct 2024 19:17:08 -0300 Subject: [PATCH 03/22] Added global json to pin .NET version to use and added diagnostic logs on dotnet publish, also commented other workflows. --- .github/workflows/build.yml | 892 ++++++++++++++++++------------------ src/global.json | 5 + 2 files changed, 451 insertions(+), 446 deletions(-) create mode 100644 src/global.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b0932df14..141950df4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,20 +16,20 @@ env: target-net-version: net8.0 jobs: - cloc: - name: CLOC - runs-on: ubuntu-22.04 - steps: - - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + # cloc: + # name: CLOC + # runs-on: ubuntu-22.04 + # steps: + # - name: Checkout repo + # uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - name: Set up CLOC - run: | - sudo apt-get update - sudo apt-get -y install cloc + # - name: Set up CLOC + # run: | + # sudo apt-get update + # sudo apt-get -y install cloc - - name: Print lines of code - run: cloc --vcs git --exclude-dir Resources,store,test,Properties --include-lang C#,XAML + # - name: Print lines of code + # run: cloc --vcs git --exclude-dir Resources,store,test,Properties --include-lang C#,XAML setup: @@ -60,367 +60,367 @@ jobs: fi - android: - name: Android - runs-on: windows-2022 - needs: setup - strategy: - fail-fast: false - matrix: - variant: ["prod", "qa"] - env: - android_folder_path: src\App\Platforms\Android - android_folder_path_bash: src/App/Platforms/Android - steps: - - name: Setup NuGet - uses: nuget/setup-nuget@a21f25cd3998bf370fde17e3f1b4c12c175172f9 # v2.0.0 - with: - nuget-version: 6.4.0 - - - name: Set up .NET - uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 - with: - dotnet-version: '8.0.x' - - - name: Set up MSBuild - uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 - - - name: Setup Windows builder - run: choco install checksum --no-progress - - - name: Install Microsoft OpenJDK 11 - run: | - choco install microsoft-openjdk11 --no-progress - Write-Output "JAVA_HOME=$(Get-ChildItem -Path 'C:\Program Files\Microsoft\jdk*' | ` - Select -First 1 -ExpandProperty FullName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - Write-Output "Java Home: $env:JAVA_HOME" - - - name: Print environment - run: | - nuget help | grep Version - msbuild -version - dotnet --info - echo "GitHub ref: $GITHUB_REF" - echo "GitHub event: $GITHUB_EVENT" - - - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - fetch-depth: 0 - - - name: Login to Azure - CI Subscription - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - - name: Download secrets - env: - ACCOUNT_NAME: bitwardenci - CONTAINER_NAME: mobile - run: | - mkdir -p $HOME/secrets - - az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ - --name app_play-keystore.jks --file ./${{ env.android_folder_path_bash }}/app_play-keystore.jks --output none - az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ - --name app_upload-keystore.jks --file ./${{ env.android_folder_path_bash }}/app_upload-keystore.jks --output none - az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ - --name play_creds.json --file $HOME/secrets/play_creds.json --output none - shell: bash - - - name: Download secrets - Google Services - if: ${{ matrix.variant == 'prod' }} - env: - ACCOUNT_NAME: bitwardenci - CONTAINER_NAME: mobile - run: | - az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ - --name google-services.json --file ./${{ env.android_folder_path_bash }}/google-services.json --output none - shell: bash - - - name: Increment version - run: | - BUILD_NUMBER=$((11000 + $GITHUB_RUN_NUMBER)) - echo "##### Setting Android Version Code to $BUILD_NUMBER" | tee -a $GITHUB_STEP_SUMMARY - - sed -i "s/android:versionCode=\"1\"/android:versionCode=\"$BUILD_NUMBER\"/" \ - ./${{ env.android_folder_path_bash }}/AndroidManifest.xml - shell: bash + # android: + # name: Android + # runs-on: windows-2022 + # needs: setup + # strategy: + # fail-fast: false + # matrix: + # variant: ["prod", "qa"] + # env: + # android_folder_path: src\App\Platforms\Android + # android_folder_path_bash: src/App/Platforms/Android + # steps: + # - name: Setup NuGet + # uses: nuget/setup-nuget@a21f25cd3998bf370fde17e3f1b4c12c175172f9 # v2.0.0 + # with: + # nuget-version: 6.4.0 + + # - name: Set up .NET + # uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 + # with: + # dotnet-version: '8.0.x' + + # - name: Set up MSBuild + # uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 + + # - name: Setup Windows builder + # run: choco install checksum --no-progress + + # - name: Install Microsoft OpenJDK 11 + # run: | + # choco install microsoft-openjdk11 --no-progress + # Write-Output "JAVA_HOME=$(Get-ChildItem -Path 'C:\Program Files\Microsoft\jdk*' | ` + # Select -First 1 -ExpandProperty FullName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + # Write-Output "Java Home: $env:JAVA_HOME" + + # - name: Print environment + # run: | + # nuget help | grep Version + # msbuild -version + # dotnet --info + # echo "GitHub ref: $GITHUB_REF" + # echo "GitHub event: $GITHUB_EVENT" + + # - name: Checkout repo + # uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + # with: + # fetch-depth: 0 + + # - name: Login to Azure - CI Subscription + # uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 + # with: + # creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} + + # - name: Download secrets + # env: + # ACCOUNT_NAME: bitwardenci + # CONTAINER_NAME: mobile + # run: | + # mkdir -p $HOME/secrets + + # az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ + # --name app_play-keystore.jks --file ./${{ env.android_folder_path_bash }}/app_play-keystore.jks --output none + # az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ + # --name app_upload-keystore.jks --file ./${{ env.android_folder_path_bash }}/app_upload-keystore.jks --output none + # az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ + # --name play_creds.json --file $HOME/secrets/play_creds.json --output none + # shell: bash + + # - name: Download secrets - Google Services + # if: ${{ matrix.variant == 'prod' }} + # env: + # ACCOUNT_NAME: bitwardenci + # CONTAINER_NAME: mobile + # run: | + # az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ + # --name google-services.json --file ./${{ env.android_folder_path_bash }}/google-services.json --output none + # shell: bash + + # - name: Increment version + # run: | + # BUILD_NUMBER=$((11000 + $GITHUB_RUN_NUMBER)) + # echo "##### Setting Android Version Code to $BUILD_NUMBER" | tee -a $GITHUB_STEP_SUMMARY + + # sed -i "s/android:versionCode=\"1\"/android:versionCode=\"$BUILD_NUMBER\"/" \ + # ./${{ env.android_folder_path_bash }}/AndroidManifest.xml + # shell: bash + + # - name: Restore packages + # run: nuget restore + + # - name: Restore tools + # run: dotnet tool restore + + # # - name: Run Core tests + # # run: | + # # dotnet test test/Core.Test/Core.Test.csproj --logger "trx;LogFileName=test-results.trx" ` + # # /p:CustomConstants=UT + + # # - name: Report test results + # # uses: dorny/test-reporter@eaa763f6ffc21c7a37837f56cd5f9737f27fc6c8 # v1.8.0 + # # if: always() + # # with: + # # name: Test Results + # # path: "**/test-results.trx" + # # reporter: dotnet-trx + # # fail-on-error: true + + # - name: Build Play Store publisher + # if: ${{ matrix.variant == 'prod' }} + # run: dotnet build .\store\google\Publisher\Publisher.csproj /p:Configuration=Release + + # - name: Setup Android build (${{ matrix.variant }}) + # run: dotnet cake build.cake --target Android --variant ${{ matrix.variant }} + + # - name: Build & Sign Android + # env: + # PLAY_KEYSTORE_PASSWORD: ${{ secrets.PLAY_KEYSTORE_PASSWORD }} + # UPLOAD_KEYSTORE_PASSWORD: ${{ secrets.UPLOAD_KEYSTORE_PASSWORD }} + # run: | + # $projToBuild = "$($env:GITHUB_WORKSPACE)/${{ env.main_app_project_path }}"; + # $packageName = "com.x8bit.bitwarden"; + + # if ("${{ matrix.variant }}" -ne "prod") + # { + # $packageName = "com.x8bit.bitwarden.${{ matrix.variant }}"; + # } + # Write-Output "##### Sign Google Play Bundle Release Configuration" + + # $signingUploadKeyStore = "$($env:GITHUB_WORKSPACE)\${{ env.android_folder_path }}\app_upload-keystore.jks" + # dotnet publish $projToBuild -c Release -f ${{ env.target-net-version }}-android ` + # /p:AndroidPackageFormats=aab ` + # /p:AndroidKeyStore=true ` + # /p:AndroidSigningKeyStore=$signingUploadKeyStore ` + # /p:AndroidSigningKeyAlias=upload ` + # /p:AndroidSigningKeyPass="$($env:UPLOAD_KEYSTORE_PASSWORD)" ` + # /p:AndroidSigningStorePass="$($env:UPLOAD_KEYSTORE_PASSWORD)" --no-restore + + # Write-Output "##### Copy Google Play Bundle to project root" + + # $signedAabPath = "$($env:GITHUB_WORKSPACE)\${{ env.main_app_folder_path }}\bin\Release\${{ env.target-net-version }}-android\publish\$($packageName)-Signed.aab"; + # $signedAabDestPath = "$($env:GITHUB_WORKSPACE)\$($packageName).aab"; + # Copy-Item $signedAabPath $signedAabDestPath + + # Write-Output "##### Sign APK Release Configuration" + + # $signingPlayKeyStore = "$($env:GITHUB_WORKSPACE)\${{ env.android_folder_path }}\app_play-keystore.jks" + # dotnet publish $projToBuild -c Release -f ${{ env.target-net-version }}-android ` + # /p:AndroidKeyStore=true ` + # /p:AndroidSigningKeyStore=$signingPlayKeyStore ` + # /p:AndroidSigningKeyAlias=bitwarden ` + # /p:AndroidSigningKeyPass="$($env:PLAY_KEYSTORE_PASSWORD)" ` + # /p:AndroidSigningStorePass="$($env:PLAY_KEYSTORE_PASSWORD)" --no-restore + + # Write-Output "##### Copy Release APK to project root" + + # $signedApkPath = "$($env:GITHUB_WORKSPACE)\${{ env.main_app_folder_path }}\bin\Release\${{ env.target-net-version }}-android\publish\$($packageName)-Signed.apk"; + # $signedApkDestPath = "$($env:GITHUB_WORKSPACE)\$($packageName).apk"; + # Copy-Item $signedApkPath $signedApkDestPath + + # - name: Upload Prod .aab artifact + # if: ${{ matrix.variant == 'prod' }} + # uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + # with: + # name: com.x8bit.bitwarden.aab + # path: ./com.x8bit.bitwarden.aab + # if-no-files-found: error + + # - name: Upload Prod .apk artifact + # if: ${{ matrix.variant == 'prod' }} + # uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + # with: + # name: com.x8bit.bitwarden.apk + # path: ./com.x8bit.bitwarden.apk + # if-no-files-found: error + + # - name: Upload Other .apk artifact + # if: ${{ matrix.variant != 'prod' }} + # uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + # with: + # name: com.x8bit.bitwarden.${{ matrix.variant }}.apk + # path: ./com.x8bit.bitwarden.${{ matrix.variant }}.apk + # if-no-files-found: error + + # - name: Create checksum for Prod .apk artifact + # if: ${{ matrix.variant == 'prod' }} + # run: | + # checksum -f="./com.x8bit.bitwarden.apk" ` + # -t sha256 | Out-File -Encoding ASCII ./bw-android-apk-sha256.txt + + # - name: Create checksum for Other .apk artifact + # if: ${{ matrix.variant != 'prod' }} + # run: | + # checksum -f="./com.x8bit.bitwarden.${{ matrix.variant }}.apk" ` + # -t sha256 | Out-File -Encoding ASCII ./bw-android-${{ matrix.variant }}-apk-sha256.txt + + # - name: Upload .apk sha file for prod + # if: ${{ matrix.variant == 'prod' }} + # uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + # with: + # name: bw-android-apk-sha256.txt + # path: ./bw-android-apk-sha256.txt + # if-no-files-found: error + + # - name: Upload .apk sha file for other + # if: ${{ matrix.variant != 'prod' }} + # uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + # with: + # name: bw-android-${{ matrix.variant }}-apk-sha256.txt + # path: ./bw-android-${{ matrix.variant }}-apk-sha256.txt + # if-no-files-found: error + + # - name: Deploy to Play Store + # if: ${{ matrix.variant == 'prod' && (( github.ref == 'refs/heads/main' + # && needs.setup.outputs.rc_branch_exists == 0 + # && needs.setup.outputs.hotfix_branch_exists == 0) + # || (github.ref == 'refs/heads/rc' && needs.setup.outputs.hotfix_branch_exists == 0) + # || github.ref == 'refs/heads/hotfix-rc' ) }} + # run: | + # $publisherPath = "$($env:GITHUB_WORKSPACE)\store\google\Publisher\bin\Release\net8.0\Publisher.dll" + # $credsPath = "$($HOME)\secrets\play_creds.json" + # $aabPath = "$($env:GITHUB_WORKSPACE)\com.x8bit.bitwarden.aab" + # $track = "internal" + + # dotnet $publisherPath $credsPath $aabPath $track + + + # f-droid: + # name: F-Droid Build + # runs-on: windows-2022 + # env: + # android_folder_path: src\App\Platforms\Android + # android_folder_path_bash: src/App/Platforms/Android + # android_manifest_path: src/App/Platforms/Android/AndroidManifest.xml + # steps: + # - name: Setup NuGet + # uses: nuget/setup-nuget@a21f25cd3998bf370fde17e3f1b4c12c175172f9 # v2.0.0 + # with: + # nuget-version: 6.4.0 + + # - name: Set up .NET + # uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 + # with: + # dotnet-version: '8.0.x' + + # - name: Set up MSBuild + # uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 + + # - name: Setup Windows builder + # run: choco install checksum --no-progress + + # - name: Install Microsoft OpenJDK 11 + # run: | + # choco install microsoft-openjdk11 --no-progress + # Write-Output "JAVA_HOME=$(Get-ChildItem -Path 'C:\Program Files\Microsoft\jdk*' | Select -First 1 -ExpandProperty FullName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + # Write-Output "Java Home: $env:JAVA_HOME" + + # - name: Print environment + # run: | + # nuget help | grep Version + # msbuild -version + # dotnet --info + # echo "GitHub ref: $GITHUB_REF" + # echo "GitHub event: $GITHUB_EVENT" + + # - name: Checkout repo + # uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + # - name: Login to Azure - CI Subscription + # uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 + # with: + # creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} + + # - name: Download secrets + # env: + # ACCOUNT_NAME: bitwardenci + # CONTAINER_NAME: mobile + # FILE: app_fdroid-keystore.jks + # run: | + # az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME --name $FILE \ + # --file ${{ env.android_folder_path_bash }}/$FILE --output none + # shell: bash + + # - name: Increment version + # run: | + # BUILD_NUMBER=$((11000 + $GITHUB_RUN_NUMBER)) + # echo "##### Setting F-Droid Version Code to $BUILD_NUMBER" | tee -a $GITHUB_STEP_SUMMARY + + # sed -i "s/android:versionCode=\"1\"/android:versionCode=\"$BUILD_NUMBER\"/" \ + # ./${{ env.android_manifest_path }} + # shell: bash + + # - name: Clean for F-Droid + # run: | + # $directoryBuildProps = $($env:GITHUB_WORKSPACE + "/Directory.Build.props"); + + # $androidManifest = $($env:GITHUB_WORKSPACE + "/${{ env.android_manifest_path }}"); + + # Write-Output "##### Back up project files" + + # Copy-Item $androidManifest $($androidManifest + ".original"); + # Copy-Item $directoryBuildProps $($directoryBuildProps + ".original"); + + # Write-Output "##### Cleanup Android Manifest" + + # $xml=New-Object XML; + # $xml.Load($androidManifest); + + # $nsAndroid=New-Object System.Xml.XmlNamespaceManager($xml.NameTable); + # $nsAndroid.AddNamespace("android", "http://schemas.android.com/apk/res/android"); + + # $xml.Save($androidManifest); + + # Write-Output "##### Enabling FDROID constant" + + # (Get-Content $directoryBuildProps).Replace('', 'FDROID') | Set-Content $directoryBuildProps + + # - name: Restore packages + # run: dotnet restore + + # - name: Build & Sign F-Droid + # env: + # FDROID_KEYSTORE_PASSWORD: ${{ secrets.FDROID_KEYSTORE_PASSWORD }} + # run: | + # $projToBuild = "$($env:GITHUB_WORKSPACE)\${{ env.main_app_project_path }}"; + # $packageName = "com.x8bit.bitwarden"; + + # Write-Output "##### Sign FDroid" + + # $signingFdroidKeyStore = "$($env:GITHUB_WORKSPACE)\${{ env.android_folder_path }}\app_fdroid-keystore.jks" + # dotnet build $projToBuild -c Release -f ${{ env.target-net-version }}-android ` + # /p:AndroidKeyStore=true ` + # /p:AndroidSigningKeyStore=$signingFdroidKeyStore ` + # /p:AndroidSigningKeyAlias=bitwarden ` + # /p:AndroidSigningKeyPass="$($env:FDROID_KEYSTORE_PASSWORD)" ` + # /p:AndroidSigningStorePass="$($env:FDROID_KEYSTORE_PASSWORD)" ` --no-restore - - name: Restore packages - run: nuget restore + # Write-Output "##### Copy FDroid apk to project root" - - name: Restore tools - run: dotnet tool restore + # $signedApkPath = "$($env:GITHUB_WORKSPACE)\${{ env.main_app_folder_path }}\bin\Release\${{ env.target-net-version }}-android\$($packageName)-Signed.apk"; + # $signedApkDestPath = "$($env:GITHUB_WORKSPACE)\com.x8bit.bitwarden-fdroid.apk"; - # - name: Run Core tests - # run: | - # dotnet test test/Core.Test/Core.Test.csproj --logger "trx;LogFileName=test-results.trx" ` - # /p:CustomConstants=UT + # Copy-Item $signedApkPath $signedApkDestPath - # - name: Report test results - # uses: dorny/test-reporter@eaa763f6ffc21c7a37837f56cd5f9737f27fc6c8 # v1.8.0 - # if: always() - # with: - # name: Test Results - # path: "**/test-results.trx" - # reporter: dotnet-trx - # fail-on-error: true + # - name: Upload F-Droid .apk artifact + # uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + # with: + # name: com.x8bit.bitwarden-fdroid.apk + # path: ./com.x8bit.bitwarden-fdroid.apk + # if-no-files-found: error - - name: Build Play Store publisher - if: ${{ matrix.variant == 'prod' }} - run: dotnet build .\store\google\Publisher\Publisher.csproj /p:Configuration=Release + # - name: Create checksum for F-Droid artifact + # run: | + # checksum -f="./com.x8bit.bitwarden-fdroid.apk" ` + # -t sha256 | Out-File -Encoding ASCII ./bw-fdroid-apk-sha256.txt - - name: Setup Android build (${{ matrix.variant }}) - run: dotnet cake build.cake --target Android --variant ${{ matrix.variant }} - - - name: Build & Sign Android - env: - PLAY_KEYSTORE_PASSWORD: ${{ secrets.PLAY_KEYSTORE_PASSWORD }} - UPLOAD_KEYSTORE_PASSWORD: ${{ secrets.UPLOAD_KEYSTORE_PASSWORD }} - run: | - $projToBuild = "$($env:GITHUB_WORKSPACE)/${{ env.main_app_project_path }}"; - $packageName = "com.x8bit.bitwarden"; - - if ("${{ matrix.variant }}" -ne "prod") - { - $packageName = "com.x8bit.bitwarden.${{ matrix.variant }}"; - } - Write-Output "##### Sign Google Play Bundle Release Configuration" - - $signingUploadKeyStore = "$($env:GITHUB_WORKSPACE)\${{ env.android_folder_path }}\app_upload-keystore.jks" - dotnet publish $projToBuild -c Release -f ${{ env.target-net-version }}-android ` - /p:AndroidPackageFormats=aab ` - /p:AndroidKeyStore=true ` - /p:AndroidSigningKeyStore=$signingUploadKeyStore ` - /p:AndroidSigningKeyAlias=upload ` - /p:AndroidSigningKeyPass="$($env:UPLOAD_KEYSTORE_PASSWORD)" ` - /p:AndroidSigningStorePass="$($env:UPLOAD_KEYSTORE_PASSWORD)" --no-restore - - Write-Output "##### Copy Google Play Bundle to project root" - - $signedAabPath = "$($env:GITHUB_WORKSPACE)\${{ env.main_app_folder_path }}\bin\Release\${{ env.target-net-version }}-android\publish\$($packageName)-Signed.aab"; - $signedAabDestPath = "$($env:GITHUB_WORKSPACE)\$($packageName).aab"; - Copy-Item $signedAabPath $signedAabDestPath - - Write-Output "##### Sign APK Release Configuration" - - $signingPlayKeyStore = "$($env:GITHUB_WORKSPACE)\${{ env.android_folder_path }}\app_play-keystore.jks" - dotnet publish $projToBuild -c Release -f ${{ env.target-net-version }}-android ` - /p:AndroidKeyStore=true ` - /p:AndroidSigningKeyStore=$signingPlayKeyStore ` - /p:AndroidSigningKeyAlias=bitwarden ` - /p:AndroidSigningKeyPass="$($env:PLAY_KEYSTORE_PASSWORD)" ` - /p:AndroidSigningStorePass="$($env:PLAY_KEYSTORE_PASSWORD)" --no-restore - - Write-Output "##### Copy Release APK to project root" - - $signedApkPath = "$($env:GITHUB_WORKSPACE)\${{ env.main_app_folder_path }}\bin\Release\${{ env.target-net-version }}-android\publish\$($packageName)-Signed.apk"; - $signedApkDestPath = "$($env:GITHUB_WORKSPACE)\$($packageName).apk"; - Copy-Item $signedApkPath $signedApkDestPath - - - name: Upload Prod .aab artifact - if: ${{ matrix.variant == 'prod' }} - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - with: - name: com.x8bit.bitwarden.aab - path: ./com.x8bit.bitwarden.aab - if-no-files-found: error - - - name: Upload Prod .apk artifact - if: ${{ matrix.variant == 'prod' }} - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - with: - name: com.x8bit.bitwarden.apk - path: ./com.x8bit.bitwarden.apk - if-no-files-found: error - - - name: Upload Other .apk artifact - if: ${{ matrix.variant != 'prod' }} - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - with: - name: com.x8bit.bitwarden.${{ matrix.variant }}.apk - path: ./com.x8bit.bitwarden.${{ matrix.variant }}.apk - if-no-files-found: error - - - name: Create checksum for Prod .apk artifact - if: ${{ matrix.variant == 'prod' }} - run: | - checksum -f="./com.x8bit.bitwarden.apk" ` - -t sha256 | Out-File -Encoding ASCII ./bw-android-apk-sha256.txt - - - name: Create checksum for Other .apk artifact - if: ${{ matrix.variant != 'prod' }} - run: | - checksum -f="./com.x8bit.bitwarden.${{ matrix.variant }}.apk" ` - -t sha256 | Out-File -Encoding ASCII ./bw-android-${{ matrix.variant }}-apk-sha256.txt - - - name: Upload .apk sha file for prod - if: ${{ matrix.variant == 'prod' }} - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - with: - name: bw-android-apk-sha256.txt - path: ./bw-android-apk-sha256.txt - if-no-files-found: error - - - name: Upload .apk sha file for other - if: ${{ matrix.variant != 'prod' }} - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - with: - name: bw-android-${{ matrix.variant }}-apk-sha256.txt - path: ./bw-android-${{ matrix.variant }}-apk-sha256.txt - if-no-files-found: error - - - name: Deploy to Play Store - if: ${{ matrix.variant == 'prod' && (( github.ref == 'refs/heads/main' - && needs.setup.outputs.rc_branch_exists == 0 - && needs.setup.outputs.hotfix_branch_exists == 0) - || (github.ref == 'refs/heads/rc' && needs.setup.outputs.hotfix_branch_exists == 0) - || github.ref == 'refs/heads/hotfix-rc' ) }} - run: | - $publisherPath = "$($env:GITHUB_WORKSPACE)\store\google\Publisher\bin\Release\net8.0\Publisher.dll" - $credsPath = "$($HOME)\secrets\play_creds.json" - $aabPath = "$($env:GITHUB_WORKSPACE)\com.x8bit.bitwarden.aab" - $track = "internal" - - dotnet $publisherPath $credsPath $aabPath $track - - - f-droid: - name: F-Droid Build - runs-on: windows-2022 - env: - android_folder_path: src\App\Platforms\Android - android_folder_path_bash: src/App/Platforms/Android - android_manifest_path: src/App/Platforms/Android/AndroidManifest.xml - steps: - - name: Setup NuGet - uses: nuget/setup-nuget@a21f25cd3998bf370fde17e3f1b4c12c175172f9 # v2.0.0 - with: - nuget-version: 6.4.0 - - - name: Set up .NET - uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 - with: - dotnet-version: '8.0.x' - - - name: Set up MSBuild - uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 - - - name: Setup Windows builder - run: choco install checksum --no-progress - - - name: Install Microsoft OpenJDK 11 - run: | - choco install microsoft-openjdk11 --no-progress - Write-Output "JAVA_HOME=$(Get-ChildItem -Path 'C:\Program Files\Microsoft\jdk*' | Select -First 1 -ExpandProperty FullName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - Write-Output "Java Home: $env:JAVA_HOME" - - - name: Print environment - run: | - nuget help | grep Version - msbuild -version - dotnet --info - echo "GitHub ref: $GITHUB_REF" - echo "GitHub event: $GITHUB_EVENT" - - - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - name: Login to Azure - CI Subscription - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - - name: Download secrets - env: - ACCOUNT_NAME: bitwardenci - CONTAINER_NAME: mobile - FILE: app_fdroid-keystore.jks - run: | - az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME --name $FILE \ - --file ${{ env.android_folder_path_bash }}/$FILE --output none - shell: bash - - - name: Increment version - run: | - BUILD_NUMBER=$((11000 + $GITHUB_RUN_NUMBER)) - echo "##### Setting F-Droid Version Code to $BUILD_NUMBER" | tee -a $GITHUB_STEP_SUMMARY - - sed -i "s/android:versionCode=\"1\"/android:versionCode=\"$BUILD_NUMBER\"/" \ - ./${{ env.android_manifest_path }} - shell: bash - - - name: Clean for F-Droid - run: | - $directoryBuildProps = $($env:GITHUB_WORKSPACE + "/Directory.Build.props"); - - $androidManifest = $($env:GITHUB_WORKSPACE + "/${{ env.android_manifest_path }}"); - - Write-Output "##### Back up project files" - - Copy-Item $androidManifest $($androidManifest + ".original"); - Copy-Item $directoryBuildProps $($directoryBuildProps + ".original"); - - Write-Output "##### Cleanup Android Manifest" - - $xml=New-Object XML; - $xml.Load($androidManifest); - - $nsAndroid=New-Object System.Xml.XmlNamespaceManager($xml.NameTable); - $nsAndroid.AddNamespace("android", "http://schemas.android.com/apk/res/android"); - - $xml.Save($androidManifest); - - Write-Output "##### Enabling FDROID constant" - - (Get-Content $directoryBuildProps).Replace('', 'FDROID') | Set-Content $directoryBuildProps - - - name: Restore packages - run: dotnet restore - - - name: Build & Sign F-Droid - env: - FDROID_KEYSTORE_PASSWORD: ${{ secrets.FDROID_KEYSTORE_PASSWORD }} - run: | - $projToBuild = "$($env:GITHUB_WORKSPACE)\${{ env.main_app_project_path }}"; - $packageName = "com.x8bit.bitwarden"; - - Write-Output "##### Sign FDroid" - - $signingFdroidKeyStore = "$($env:GITHUB_WORKSPACE)\${{ env.android_folder_path }}\app_fdroid-keystore.jks" - dotnet build $projToBuild -c Release -f ${{ env.target-net-version }}-android ` - /p:AndroidKeyStore=true ` - /p:AndroidSigningKeyStore=$signingFdroidKeyStore ` - /p:AndroidSigningKeyAlias=bitwarden ` - /p:AndroidSigningKeyPass="$($env:FDROID_KEYSTORE_PASSWORD)" ` - /p:AndroidSigningStorePass="$($env:FDROID_KEYSTORE_PASSWORD)" ` --no-restore - - Write-Output "##### Copy FDroid apk to project root" - - $signedApkPath = "$($env:GITHUB_WORKSPACE)\${{ env.main_app_folder_path }}\bin\Release\${{ env.target-net-version }}-android\$($packageName)-Signed.apk"; - $signedApkDestPath = "$($env:GITHUB_WORKSPACE)\com.x8bit.bitwarden-fdroid.apk"; - - Copy-Item $signedApkPath $signedApkDestPath - - - name: Upload F-Droid .apk artifact - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - with: - name: com.x8bit.bitwarden-fdroid.apk - path: ./com.x8bit.bitwarden-fdroid.apk - if-no-files-found: error - - - name: Create checksum for F-Droid artifact - run: | - checksum -f="./com.x8bit.bitwarden-fdroid.apk" ` - -t sha256 | Out-File -Encoding ASCII ./bw-fdroid-apk-sha256.txt - - - name: Upload F-Droid sha file - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - with: - name: bw-fdroid-apk-sha256.txt - path: ./bw-fdroid-apk-sha256.txt - if-no-files-found: error + # - name: Upload F-Droid sha file + # uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + # with: + # name: bw-fdroid-apk-sha256.txt + # path: ./bw-fdroid-apk-sha256.txt + # if-no-files-found: error ios: @@ -584,7 +584,7 @@ jobs: - name: Archive Build for App Store run: | echo "##### Archive for Release ios-arm64" - dotnet publish ${{ env.main_app_project_path }} -c Release -f ${{ env.target-net-version }}-ios /p:RuntimeIdentifier=ios-arm64 /p:ArchiveOnBuild=true /p:MtouchUseLlvm=false + dotnet publish ${{ env.main_app_project_path }} -c Release -f ${{ env.target-net-version }}-ios -v diag /p:RuntimeIdentifier=ios-arm64 /p:ArchiveOnBuild=true /p:MtouchUseLlvm=false - name: Archive Build for Mobile Automation run: | @@ -696,81 +696,81 @@ jobs: --username "$APPLE_ID_USERNAME" --password "$APPLE_ID_PASSWORD" - crowdin-push: - name: Crowdin Push - if: github.ref == 'refs/heads/main' - needs: - - android - - f-droid - - ios - runs-on: ubuntu-22.04 - env: - _CROWDIN_PROJECT_ID: "269690" - steps: - - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - name: Login to Azure - CI Subscription - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - with: - creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve secrets - id: retrieve-secrets - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: "bitwarden-ci" - secrets: "crowdin-api-token" - - - name: Upload Sources - uses: crowdin/github-action@61ac8b980551f674046220c3e104bddae2916ac5 # v2.0.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }} - with: - config: crowdin.yml - crowdin_branch_name: main - upload_sources: true - upload_translations: false - - - check-failures: - name: Check for failures - if: always() - runs-on: ubuntu-22.04 - needs: - - cloc - - android - - f-droid - - ios - - crowdin-push - steps: - - name: Check if any job failed - if: | - (github.ref == 'refs/heads/main' - || github.ref == 'refs/heads/rc' - || github.ref == 'refs/heads/hotfix-rc') - && contains(needs.*.result, 'failure') - run: exit 1 - - - name: Login to Azure - CI Subscription - uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - if: failure() - with: - creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - - name: Retrieve secrets - id: retrieve-secrets - uses: bitwarden/gh-actions/get-keyvault-secrets@main - if: failure() - with: - keyvault: "bitwarden-ci" - secrets: "devops-alerts-slack-webhook-url" - - - name: Notify Slack on failure - uses: act10ns/slack@44541246747a30eb3102d87f7a4cc5471b0ffb7d # v2.1.0 - if: failure() - env: - SLACK_WEBHOOK_URL: ${{ steps.retrieve-secrets.outputs.devops-alerts-slack-webhook-url }} - with: - status: ${{ job.status }} + # crowdin-push: + # name: Crowdin Push + # if: github.ref == 'refs/heads/main' + # needs: + # - android + # - f-droid + # - ios + # runs-on: ubuntu-22.04 + # env: + # _CROWDIN_PROJECT_ID: "269690" + # steps: + # - name: Checkout repo + # uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + # - name: Login to Azure - CI Subscription + # uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 + # with: + # creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} + + # - name: Retrieve secrets + # id: retrieve-secrets + # uses: bitwarden/gh-actions/get-keyvault-secrets@main + # with: + # keyvault: "bitwarden-ci" + # secrets: "crowdin-api-token" + + # - name: Upload Sources + # uses: crowdin/github-action@61ac8b980551f674046220c3e104bddae2916ac5 # v2.0.0 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }} + # with: + # config: crowdin.yml + # crowdin_branch_name: main + # upload_sources: true + # upload_translations: false + + + # check-failures: + # name: Check for failures + # if: always() + # runs-on: ubuntu-22.04 + # needs: + # - cloc + # - android + # - f-droid + # - ios + # - crowdin-push + # steps: + # - name: Check if any job failed + # if: | + # (github.ref == 'refs/heads/main' + # || github.ref == 'refs/heads/rc' + # || github.ref == 'refs/heads/hotfix-rc') + # && contains(needs.*.result, 'failure') + # run: exit 1 + + # - name: Login to Azure - CI Subscription + # uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 + # if: failure() + # with: + # creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} + + # - name: Retrieve secrets + # id: retrieve-secrets + # uses: bitwarden/gh-actions/get-keyvault-secrets@main + # if: failure() + # with: + # keyvault: "bitwarden-ci" + # secrets: "devops-alerts-slack-webhook-url" + + # - name: Notify Slack on failure + # uses: act10ns/slack@44541246747a30eb3102d87f7a4cc5471b0ffb7d # v2.1.0 + # if: failure() + # env: + # SLACK_WEBHOOK_URL: ${{ steps.retrieve-secrets.outputs.devops-alerts-slack-webhook-url }} + # with: + # status: ${{ job.status }} diff --git a/src/global.json b/src/global.json new file mode 100644 index 000000000..1978c843c --- /dev/null +++ b/src/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "8.0.303" + } +} \ No newline at end of file From bca269ecd9a98c8c273f6a0ca038cc27a6ebee9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lison=20Fernandes?= Date: Wed, 9 Oct 2024 10:50:03 +0100 Subject: [PATCH 04/22] Set TargetPlatformVersion in Directory Build props --- Directory.Build.props | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index e455a4843..27521e1eb 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -6,7 +6,10 @@ True True -gcc_flags "-L$(ProjectDir)../../lib/ios -largon2 -force_load $(ProjectDir)../../lib/ios/libargon2.a" - + + 17.5 + + From b457cf901b7d54b8d0a671893fd92decd46084fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lison=20Fernandes?= Date: Wed, 9 Oct 2024 11:56:57 +0100 Subject: [PATCH 05/22] test moving global.json --- global.json | 7 +++++++ src/global.json | 5 ----- 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 global.json delete mode 100644 src/global.json diff --git a/global.json b/global.json new file mode 100644 index 000000000..4f64aa3c8 --- /dev/null +++ b/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "8.0.303", + "workloadVersion": "8.0.100-manifests.71b9f198", + "rollForward": "disable" + } +} \ No newline at end of file diff --git a/src/global.json b/src/global.json deleted file mode 100644 index 1978c843c..000000000 --- a/src/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sdk": { - "version": "8.0.303" - } -} \ No newline at end of file From 06835334bb9fb1121d777d01d1cfad1374fb139d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lison=20Fernandes?= Date: Wed, 9 Oct 2024 12:17:15 +0100 Subject: [PATCH 06/22] Check out the repo first so global.json is available --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 141950df4..fac2e3b24 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -432,6 +432,11 @@ jobs: app_output_name: App app_ci_output_filename: App_x64_Debug steps: + - name: Checkout repo + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + submodules: 'true' + - name: Set XCode version uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 with: @@ -459,11 +464,6 @@ jobs: echo "GitHub ref: $GITHUB_REF" echo "GitHub event: $GITHUB_EVENT" - - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - submodules: 'true' - - name: Login to Azure - CI Subscription uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 with: From d8cb7416ede9240dff796312c4901e41507a4f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lison=20Fernandes?= Date: Wed, 9 Oct 2024 12:20:14 +0100 Subject: [PATCH 07/22] Remove workloadVersion from global.json --- global.json | 1 - 1 file changed, 1 deletion(-) diff --git a/global.json b/global.json index 4f64aa3c8..bd0a5517a 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,6 @@ { "sdk": { "version": "8.0.303", - "workloadVersion": "8.0.100-manifests.71b9f198", "rollForward": "disable" } } \ No newline at end of file From 7a8160690721a19265c83c346fe4b7ee3d3abb1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lison=20Fernandes?= Date: Wed, 9 Oct 2024 12:32:47 +0100 Subject: [PATCH 08/22] pin maui install version --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fac2e3b24..092878eb6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -455,7 +455,7 @@ jobs: # This step might be obsolete at some point as .NET MAUI workloads # are starting to come pre-installed on the GH Actions build agents. - name: Install MAUI Workload - run: dotnet workload install maui --ignore-failed-sources + run: dotnet workload install maui --ignore-failed-sources --version 8.0.7 - name: Print environment run: | From 03838a9350ed0e8e3625e55f622dd470ab42b30b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lison=20Fernandes?= Date: Wed, 9 Oct 2024 13:51:55 +0100 Subject: [PATCH 09/22] Try workload restore --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 092878eb6..30ba69049 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -455,7 +455,8 @@ jobs: # This step might be obsolete at some point as .NET MAUI workloads # are starting to come pre-installed on the GH Actions build agents. - name: Install MAUI Workload - run: dotnet workload install maui --ignore-failed-sources --version 8.0.7 + run: | + dotnet workload install maui maui-ios --version 8.0.7 - name: Print environment run: | From 9746f8dff61595bb6c4762a8b43d102109712b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lison=20Fernandes?= Date: Wed, 9 Oct 2024 14:07:20 +0100 Subject: [PATCH 10/22] Adding workload restore --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30ba69049..54afa17da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -457,6 +457,7 @@ jobs: - name: Install MAUI Workload run: | dotnet workload install maui maui-ios --version 8.0.7 + dotnet workload restore - name: Print environment run: | From 383b2e97a677c1d345fb815833283769f39a6e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lison=20Fernandes?= Date: Wed, 9 Oct 2024 14:14:49 +0100 Subject: [PATCH 11/22] Use ios workload instead --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 54afa17da..012d0e795 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -456,7 +456,7 @@ jobs: # are starting to come pre-installed on the GH Actions build agents. - name: Install MAUI Workload run: | - dotnet workload install maui maui-ios --version 8.0.7 + dotnet workload install maui ios --version 8.0.7 dotnet workload restore - name: Print environment From c5bdf72b8603390f770b970608ff6d0c7248b26b Mon Sep 17 00:00:00 2001 From: Federico Maccaroni Date: Wed, 9 Oct 2024 11:09:55 -0300 Subject: [PATCH 12/22] Set specific MAUI workload to install to 8.0.402 --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 012d0e795..d93f392ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -456,8 +456,7 @@ jobs: # are starting to come pre-installed on the GH Actions build agents. - name: Install MAUI Workload run: | - dotnet workload install maui ios --version 8.0.7 - dotnet workload restore + dotnet workload install maui --version 8.0.402 - name: Print environment run: | From a55d542b8e7aec547dd77e99dd98e5f029e086ca Mon Sep 17 00:00:00 2001 From: Federico Maccaroni Date: Wed, 9 Oct 2024 11:26:25 -0300 Subject: [PATCH 13/22] Fix MAUI workload install to 8.0.300 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d93f392ca..3b4763938 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -456,7 +456,7 @@ jobs: # are starting to come pre-installed on the GH Actions build agents. - name: Install MAUI Workload run: | - dotnet workload install maui --version 8.0.402 + dotnet workload install maui --version 8.0.300 - name: Print environment run: | From e32d8ce454d8f6f582abec44cf5c2b98fd262709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lison=20Fernandes?= Date: Wed, 9 Oct 2024 15:46:55 +0100 Subject: [PATCH 14/22] Add step to remove dotnet --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b4763938..c5e908df6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -432,6 +432,10 @@ jobs: app_output_name: App app_ci_output_filename: App_x64_Debug steps: + - name: Remove dotnet + run: | + cd /usr/local/share/dotnet && ls + rm -rf dotnet - name: Checkout repo uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: @@ -464,6 +468,7 @@ jobs: dotnet --info echo "GitHub ref: $GITHUB_REF" echo "GitHub event: $GITHUB_EVENT" + exit 1 - name: Login to Azure - CI Subscription uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 From ae122fa33e6ed2a0f22ca5b1ec2877c1103387e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lison=20Fernandes?= Date: Wed, 9 Oct 2024 16:07:36 +0100 Subject: [PATCH 15/22] Update sdk / maui to 8.0.402 --- .github/workflows/build.yml | 5 ++--- global.json | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c5e908df6..948623e88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -454,13 +454,13 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 with: - dotnet-version: '8.0.303' + dotnet-version: '8.0.402' # This step might be obsolete at some point as .NET MAUI workloads # are starting to come pre-installed on the GH Actions build agents. - name: Install MAUI Workload run: | - dotnet workload install maui --version 8.0.300 + dotnet workload install maui --version 8.0.402 - name: Print environment run: | @@ -468,7 +468,6 @@ jobs: dotnet --info echo "GitHub ref: $GITHUB_REF" echo "GitHub event: $GITHUB_EVENT" - exit 1 - name: Login to Azure - CI Subscription uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 diff --git a/global.json b/global.json index bd0a5517a..6c72f9c3d 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.303", + "version": "8.0.402", "rollForward": "disable" } } \ No newline at end of file From 961a95d82166f01ddbc53bebe1e334c29bc9bcdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lison=20Fernandes?= Date: Wed, 9 Oct 2024 16:36:53 +0100 Subject: [PATCH 16/22] Bumped xcode to 15.4 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 948623e88..f62e9e906 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -444,7 +444,7 @@ jobs: - name: Set XCode version uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 with: - xcode-version: 15.1 + xcode-version: 15.4 - name: Setup NuGet uses: nuget/setup-nuget@a21f25cd3998bf370fde17e3f1b4c12c175172f9 # v2.0.0 From 2c6b022db705c0210895ea741437558329fc7bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lison=20Fernandes?= Date: Wed, 9 Oct 2024 19:43:46 +0100 Subject: [PATCH 17/22] Revert build.yml comments --- .github/workflows/build.yml | 894 ++++++++++++++++++------------------ 1 file changed, 445 insertions(+), 449 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f62e9e906..e5778aeef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,20 +16,20 @@ env: target-net-version: net8.0 jobs: - # cloc: - # name: CLOC - # runs-on: ubuntu-22.04 - # steps: - # - name: Checkout repo - # uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + cloc: + name: CLOC + runs-on: ubuntu-22.04 + steps: + - name: Checkout repo + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - # - name: Set up CLOC - # run: | - # sudo apt-get update - # sudo apt-get -y install cloc + - name: Set up CLOC + run: | + sudo apt-get update + sudo apt-get -y install cloc - # - name: Print lines of code - # run: cloc --vcs git --exclude-dir Resources,store,test,Properties --include-lang C#,XAML + - name: Print lines of code + run: cloc --vcs git --exclude-dir Resources,store,test,Properties --include-lang C#,XAML setup: @@ -60,367 +60,367 @@ jobs: fi - # android: - # name: Android - # runs-on: windows-2022 - # needs: setup - # strategy: - # fail-fast: false - # matrix: - # variant: ["prod", "qa"] - # env: - # android_folder_path: src\App\Platforms\Android - # android_folder_path_bash: src/App/Platforms/Android - # steps: - # - name: Setup NuGet - # uses: nuget/setup-nuget@a21f25cd3998bf370fde17e3f1b4c12c175172f9 # v2.0.0 - # with: - # nuget-version: 6.4.0 - - # - name: Set up .NET - # uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 - # with: - # dotnet-version: '8.0.x' - - # - name: Set up MSBuild - # uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 - - # - name: Setup Windows builder - # run: choco install checksum --no-progress - - # - name: Install Microsoft OpenJDK 11 - # run: | - # choco install microsoft-openjdk11 --no-progress - # Write-Output "JAVA_HOME=$(Get-ChildItem -Path 'C:\Program Files\Microsoft\jdk*' | ` - # Select -First 1 -ExpandProperty FullName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - # Write-Output "Java Home: $env:JAVA_HOME" - - # - name: Print environment - # run: | - # nuget help | grep Version - # msbuild -version - # dotnet --info - # echo "GitHub ref: $GITHUB_REF" - # echo "GitHub event: $GITHUB_EVENT" - - # - name: Checkout repo - # uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - # with: - # fetch-depth: 0 - - # - name: Login to Azure - CI Subscription - # uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - # with: - # creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - # - name: Download secrets - # env: - # ACCOUNT_NAME: bitwardenci - # CONTAINER_NAME: mobile - # run: | - # mkdir -p $HOME/secrets - - # az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ - # --name app_play-keystore.jks --file ./${{ env.android_folder_path_bash }}/app_play-keystore.jks --output none - # az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ - # --name app_upload-keystore.jks --file ./${{ env.android_folder_path_bash }}/app_upload-keystore.jks --output none - # az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ - # --name play_creds.json --file $HOME/secrets/play_creds.json --output none - # shell: bash - - # - name: Download secrets - Google Services - # if: ${{ matrix.variant == 'prod' }} - # env: - # ACCOUNT_NAME: bitwardenci - # CONTAINER_NAME: mobile - # run: | - # az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ - # --name google-services.json --file ./${{ env.android_folder_path_bash }}/google-services.json --output none - # shell: bash - - # - name: Increment version - # run: | - # BUILD_NUMBER=$((11000 + $GITHUB_RUN_NUMBER)) - # echo "##### Setting Android Version Code to $BUILD_NUMBER" | tee -a $GITHUB_STEP_SUMMARY - - # sed -i "s/android:versionCode=\"1\"/android:versionCode=\"$BUILD_NUMBER\"/" \ - # ./${{ env.android_folder_path_bash }}/AndroidManifest.xml - # shell: bash - - # - name: Restore packages - # run: nuget restore - - # - name: Restore tools - # run: dotnet tool restore - - # # - name: Run Core tests - # # run: | - # # dotnet test test/Core.Test/Core.Test.csproj --logger "trx;LogFileName=test-results.trx" ` - # # /p:CustomConstants=UT - - # # - name: Report test results - # # uses: dorny/test-reporter@eaa763f6ffc21c7a37837f56cd5f9737f27fc6c8 # v1.8.0 - # # if: always() - # # with: - # # name: Test Results - # # path: "**/test-results.trx" - # # reporter: dotnet-trx - # # fail-on-error: true - - # - name: Build Play Store publisher - # if: ${{ matrix.variant == 'prod' }} - # run: dotnet build .\store\google\Publisher\Publisher.csproj /p:Configuration=Release - - # - name: Setup Android build (${{ matrix.variant }}) - # run: dotnet cake build.cake --target Android --variant ${{ matrix.variant }} - - # - name: Build & Sign Android - # env: - # PLAY_KEYSTORE_PASSWORD: ${{ secrets.PLAY_KEYSTORE_PASSWORD }} - # UPLOAD_KEYSTORE_PASSWORD: ${{ secrets.UPLOAD_KEYSTORE_PASSWORD }} - # run: | - # $projToBuild = "$($env:GITHUB_WORKSPACE)/${{ env.main_app_project_path }}"; - # $packageName = "com.x8bit.bitwarden"; - - # if ("${{ matrix.variant }}" -ne "prod") - # { - # $packageName = "com.x8bit.bitwarden.${{ matrix.variant }}"; - # } - # Write-Output "##### Sign Google Play Bundle Release Configuration" - - # $signingUploadKeyStore = "$($env:GITHUB_WORKSPACE)\${{ env.android_folder_path }}\app_upload-keystore.jks" - # dotnet publish $projToBuild -c Release -f ${{ env.target-net-version }}-android ` - # /p:AndroidPackageFormats=aab ` - # /p:AndroidKeyStore=true ` - # /p:AndroidSigningKeyStore=$signingUploadKeyStore ` - # /p:AndroidSigningKeyAlias=upload ` - # /p:AndroidSigningKeyPass="$($env:UPLOAD_KEYSTORE_PASSWORD)" ` - # /p:AndroidSigningStorePass="$($env:UPLOAD_KEYSTORE_PASSWORD)" --no-restore - - # Write-Output "##### Copy Google Play Bundle to project root" - - # $signedAabPath = "$($env:GITHUB_WORKSPACE)\${{ env.main_app_folder_path }}\bin\Release\${{ env.target-net-version }}-android\publish\$($packageName)-Signed.aab"; - # $signedAabDestPath = "$($env:GITHUB_WORKSPACE)\$($packageName).aab"; - # Copy-Item $signedAabPath $signedAabDestPath - - # Write-Output "##### Sign APK Release Configuration" - - # $signingPlayKeyStore = "$($env:GITHUB_WORKSPACE)\${{ env.android_folder_path }}\app_play-keystore.jks" - # dotnet publish $projToBuild -c Release -f ${{ env.target-net-version }}-android ` - # /p:AndroidKeyStore=true ` - # /p:AndroidSigningKeyStore=$signingPlayKeyStore ` - # /p:AndroidSigningKeyAlias=bitwarden ` - # /p:AndroidSigningKeyPass="$($env:PLAY_KEYSTORE_PASSWORD)" ` - # /p:AndroidSigningStorePass="$($env:PLAY_KEYSTORE_PASSWORD)" --no-restore - - # Write-Output "##### Copy Release APK to project root" - - # $signedApkPath = "$($env:GITHUB_WORKSPACE)\${{ env.main_app_folder_path }}\bin\Release\${{ env.target-net-version }}-android\publish\$($packageName)-Signed.apk"; - # $signedApkDestPath = "$($env:GITHUB_WORKSPACE)\$($packageName).apk"; - # Copy-Item $signedApkPath $signedApkDestPath - - # - name: Upload Prod .aab artifact - # if: ${{ matrix.variant == 'prod' }} - # uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - # with: - # name: com.x8bit.bitwarden.aab - # path: ./com.x8bit.bitwarden.aab - # if-no-files-found: error - - # - name: Upload Prod .apk artifact - # if: ${{ matrix.variant == 'prod' }} - # uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - # with: - # name: com.x8bit.bitwarden.apk - # path: ./com.x8bit.bitwarden.apk - # if-no-files-found: error - - # - name: Upload Other .apk artifact - # if: ${{ matrix.variant != 'prod' }} - # uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - # with: - # name: com.x8bit.bitwarden.${{ matrix.variant }}.apk - # path: ./com.x8bit.bitwarden.${{ matrix.variant }}.apk - # if-no-files-found: error - - # - name: Create checksum for Prod .apk artifact - # if: ${{ matrix.variant == 'prod' }} - # run: | - # checksum -f="./com.x8bit.bitwarden.apk" ` - # -t sha256 | Out-File -Encoding ASCII ./bw-android-apk-sha256.txt - - # - name: Create checksum for Other .apk artifact - # if: ${{ matrix.variant != 'prod' }} - # run: | - # checksum -f="./com.x8bit.bitwarden.${{ matrix.variant }}.apk" ` - # -t sha256 | Out-File -Encoding ASCII ./bw-android-${{ matrix.variant }}-apk-sha256.txt - - # - name: Upload .apk sha file for prod - # if: ${{ matrix.variant == 'prod' }} - # uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - # with: - # name: bw-android-apk-sha256.txt - # path: ./bw-android-apk-sha256.txt - # if-no-files-found: error - - # - name: Upload .apk sha file for other - # if: ${{ matrix.variant != 'prod' }} - # uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - # with: - # name: bw-android-${{ matrix.variant }}-apk-sha256.txt - # path: ./bw-android-${{ matrix.variant }}-apk-sha256.txt - # if-no-files-found: error - - # - name: Deploy to Play Store - # if: ${{ matrix.variant == 'prod' && (( github.ref == 'refs/heads/main' - # && needs.setup.outputs.rc_branch_exists == 0 - # && needs.setup.outputs.hotfix_branch_exists == 0) - # || (github.ref == 'refs/heads/rc' && needs.setup.outputs.hotfix_branch_exists == 0) - # || github.ref == 'refs/heads/hotfix-rc' ) }} - # run: | - # $publisherPath = "$($env:GITHUB_WORKSPACE)\store\google\Publisher\bin\Release\net8.0\Publisher.dll" - # $credsPath = "$($HOME)\secrets\play_creds.json" - # $aabPath = "$($env:GITHUB_WORKSPACE)\com.x8bit.bitwarden.aab" - # $track = "internal" - - # dotnet $publisherPath $credsPath $aabPath $track - - - # f-droid: - # name: F-Droid Build - # runs-on: windows-2022 - # env: - # android_folder_path: src\App\Platforms\Android - # android_folder_path_bash: src/App/Platforms/Android - # android_manifest_path: src/App/Platforms/Android/AndroidManifest.xml - # steps: - # - name: Setup NuGet - # uses: nuget/setup-nuget@a21f25cd3998bf370fde17e3f1b4c12c175172f9 # v2.0.0 - # with: - # nuget-version: 6.4.0 - - # - name: Set up .NET - # uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 - # with: - # dotnet-version: '8.0.x' - - # - name: Set up MSBuild - # uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 - - # - name: Setup Windows builder - # run: choco install checksum --no-progress - - # - name: Install Microsoft OpenJDK 11 - # run: | - # choco install microsoft-openjdk11 --no-progress - # Write-Output "JAVA_HOME=$(Get-ChildItem -Path 'C:\Program Files\Microsoft\jdk*' | Select -First 1 -ExpandProperty FullName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - # Write-Output "Java Home: $env:JAVA_HOME" - - # - name: Print environment - # run: | - # nuget help | grep Version - # msbuild -version - # dotnet --info - # echo "GitHub ref: $GITHUB_REF" - # echo "GitHub event: $GITHUB_EVENT" - - # - name: Checkout repo - # uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - # - name: Login to Azure - CI Subscription - # uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - # with: - # creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - # - name: Download secrets - # env: - # ACCOUNT_NAME: bitwardenci - # CONTAINER_NAME: mobile - # FILE: app_fdroid-keystore.jks - # run: | - # az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME --name $FILE \ - # --file ${{ env.android_folder_path_bash }}/$FILE --output none - # shell: bash - - # - name: Increment version - # run: | - # BUILD_NUMBER=$((11000 + $GITHUB_RUN_NUMBER)) - # echo "##### Setting F-Droid Version Code to $BUILD_NUMBER" | tee -a $GITHUB_STEP_SUMMARY - - # sed -i "s/android:versionCode=\"1\"/android:versionCode=\"$BUILD_NUMBER\"/" \ - # ./${{ env.android_manifest_path }} - # shell: bash - - # - name: Clean for F-Droid - # run: | - # $directoryBuildProps = $($env:GITHUB_WORKSPACE + "/Directory.Build.props"); - - # $androidManifest = $($env:GITHUB_WORKSPACE + "/${{ env.android_manifest_path }}"); - - # Write-Output "##### Back up project files" - - # Copy-Item $androidManifest $($androidManifest + ".original"); - # Copy-Item $directoryBuildProps $($directoryBuildProps + ".original"); - - # Write-Output "##### Cleanup Android Manifest" - - # $xml=New-Object XML; - # $xml.Load($androidManifest); - - # $nsAndroid=New-Object System.Xml.XmlNamespaceManager($xml.NameTable); - # $nsAndroid.AddNamespace("android", "http://schemas.android.com/apk/res/android"); - - # $xml.Save($androidManifest); - - # Write-Output "##### Enabling FDROID constant" - - # (Get-Content $directoryBuildProps).Replace('', 'FDROID') | Set-Content $directoryBuildProps - - # - name: Restore packages - # run: dotnet restore - - # - name: Build & Sign F-Droid - # env: - # FDROID_KEYSTORE_PASSWORD: ${{ secrets.FDROID_KEYSTORE_PASSWORD }} - # run: | - # $projToBuild = "$($env:GITHUB_WORKSPACE)\${{ env.main_app_project_path }}"; - # $packageName = "com.x8bit.bitwarden"; - - # Write-Output "##### Sign FDroid" - - # $signingFdroidKeyStore = "$($env:GITHUB_WORKSPACE)\${{ env.android_folder_path }}\app_fdroid-keystore.jks" - # dotnet build $projToBuild -c Release -f ${{ env.target-net-version }}-android ` - # /p:AndroidKeyStore=true ` - # /p:AndroidSigningKeyStore=$signingFdroidKeyStore ` - # /p:AndroidSigningKeyAlias=bitwarden ` - # /p:AndroidSigningKeyPass="$($env:FDROID_KEYSTORE_PASSWORD)" ` - # /p:AndroidSigningStorePass="$($env:FDROID_KEYSTORE_PASSWORD)" ` --no-restore + android: + name: Android + runs-on: windows-2022 + needs: setup + strategy: + fail-fast: false + matrix: + variant: ["prod", "qa"] + env: + android_folder_path: src\App\Platforms\Android + android_folder_path_bash: src/App/Platforms/Android + steps: + - name: Setup NuGet + uses: nuget/setup-nuget@a21f25cd3998bf370fde17e3f1b4c12c175172f9 # v2.0.0 + with: + nuget-version: 6.4.0 + + - name: Set up .NET + uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 + with: + dotnet-version: '8.0.x' + + - name: Set up MSBuild + uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 + + - name: Setup Windows builder + run: choco install checksum --no-progress + + - name: Install Microsoft OpenJDK 11 + run: | + choco install microsoft-openjdk11 --no-progress + Write-Output "JAVA_HOME=$(Get-ChildItem -Path 'C:\Program Files\Microsoft\jdk*' | ` + Select -First 1 -ExpandProperty FullName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + Write-Output "Java Home: $env:JAVA_HOME" + + - name: Print environment + run: | + nuget help | grep Version + msbuild -version + dotnet --info + echo "GitHub ref: $GITHUB_REF" + echo "GitHub event: $GITHUB_EVENT" + + - name: Checkout repo + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + fetch-depth: 0 + + - name: Login to Azure - CI Subscription + uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 + with: + creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} + + - name: Download secrets + env: + ACCOUNT_NAME: bitwardenci + CONTAINER_NAME: mobile + run: | + mkdir -p $HOME/secrets + + az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ + --name app_play-keystore.jks --file ./${{ env.android_folder_path_bash }}/app_play-keystore.jks --output none + az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ + --name app_upload-keystore.jks --file ./${{ env.android_folder_path_bash }}/app_upload-keystore.jks --output none + az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ + --name play_creds.json --file $HOME/secrets/play_creds.json --output none + shell: bash + + - name: Download secrets - Google Services + if: ${{ matrix.variant == 'prod' }} + env: + ACCOUNT_NAME: bitwardenci + CONTAINER_NAME: mobile + run: | + az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \ + --name google-services.json --file ./${{ env.android_folder_path_bash }}/google-services.json --output none + shell: bash + + - name: Increment version + run: | + BUILD_NUMBER=$((11000 + $GITHUB_RUN_NUMBER)) + echo "##### Setting Android Version Code to $BUILD_NUMBER" | tee -a $GITHUB_STEP_SUMMARY + + sed -i "s/android:versionCode=\"1\"/android:versionCode=\"$BUILD_NUMBER\"/" \ + ./${{ env.android_folder_path_bash }}/AndroidManifest.xml + shell: bash + + - name: Restore packages + run: nuget restore + + - name: Restore tools + run: dotnet tool restore + + # - name: Run Core tests + # run: | + # dotnet test test/Core.Test/Core.Test.csproj --logger "trx;LogFileName=test-results.trx" ` + # /p:CustomConstants=UT + + # - name: Report test results + # uses: dorny/test-reporter@eaa763f6ffc21c7a37837f56cd5f9737f27fc6c8 # v1.8.0 + # if: always() + # with: + # name: Test Results + # path: "**/test-results.trx" + # reporter: dotnet-trx + # fail-on-error: true + + - name: Build Play Store publisher + if: ${{ matrix.variant == 'prod' }} + run: dotnet build .\store\google\Publisher\Publisher.csproj /p:Configuration=Release + + - name: Setup Android build (${{ matrix.variant }}) + run: dotnet cake build.cake --target Android --variant ${{ matrix.variant }} + + - name: Build & Sign Android + env: + PLAY_KEYSTORE_PASSWORD: ${{ secrets.PLAY_KEYSTORE_PASSWORD }} + UPLOAD_KEYSTORE_PASSWORD: ${{ secrets.UPLOAD_KEYSTORE_PASSWORD }} + run: | + $projToBuild = "$($env:GITHUB_WORKSPACE)/${{ env.main_app_project_path }}"; + $packageName = "com.x8bit.bitwarden"; + + if ("${{ matrix.variant }}" -ne "prod") + { + $packageName = "com.x8bit.bitwarden.${{ matrix.variant }}"; + } + Write-Output "##### Sign Google Play Bundle Release Configuration" + + $signingUploadKeyStore = "$($env:GITHUB_WORKSPACE)\${{ env.android_folder_path }}\app_upload-keystore.jks" + dotnet publish $projToBuild -c Release -f ${{ env.target-net-version }}-android ` + /p:AndroidPackageFormats=aab ` + /p:AndroidKeyStore=true ` + /p:AndroidSigningKeyStore=$signingUploadKeyStore ` + /p:AndroidSigningKeyAlias=upload ` + /p:AndroidSigningKeyPass="$($env:UPLOAD_KEYSTORE_PASSWORD)" ` + /p:AndroidSigningStorePass="$($env:UPLOAD_KEYSTORE_PASSWORD)" --no-restore + + Write-Output "##### Copy Google Play Bundle to project root" + + $signedAabPath = "$($env:GITHUB_WORKSPACE)\${{ env.main_app_folder_path }}\bin\Release\${{ env.target-net-version }}-android\publish\$($packageName)-Signed.aab"; + $signedAabDestPath = "$($env:GITHUB_WORKSPACE)\$($packageName).aab"; + Copy-Item $signedAabPath $signedAabDestPath + + Write-Output "##### Sign APK Release Configuration" + + $signingPlayKeyStore = "$($env:GITHUB_WORKSPACE)\${{ env.android_folder_path }}\app_play-keystore.jks" + dotnet publish $projToBuild -c Release -f ${{ env.target-net-version }}-android ` + /p:AndroidKeyStore=true ` + /p:AndroidSigningKeyStore=$signingPlayKeyStore ` + /p:AndroidSigningKeyAlias=bitwarden ` + /p:AndroidSigningKeyPass="$($env:PLAY_KEYSTORE_PASSWORD)" ` + /p:AndroidSigningStorePass="$($env:PLAY_KEYSTORE_PASSWORD)" --no-restore + + Write-Output "##### Copy Release APK to project root" + + $signedApkPath = "$($env:GITHUB_WORKSPACE)\${{ env.main_app_folder_path }}\bin\Release\${{ env.target-net-version }}-android\publish\$($packageName)-Signed.apk"; + $signedApkDestPath = "$($env:GITHUB_WORKSPACE)\$($packageName).apk"; + Copy-Item $signedApkPath $signedApkDestPath + + - name: Upload Prod .aab artifact + if: ${{ matrix.variant == 'prod' }} + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + with: + name: com.x8bit.bitwarden.aab + path: ./com.x8bit.bitwarden.aab + if-no-files-found: error + + - name: Upload Prod .apk artifact + if: ${{ matrix.variant == 'prod' }} + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + with: + name: com.x8bit.bitwarden.apk + path: ./com.x8bit.bitwarden.apk + if-no-files-found: error + + - name: Upload Other .apk artifact + if: ${{ matrix.variant != 'prod' }} + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + with: + name: com.x8bit.bitwarden.${{ matrix.variant }}.apk + path: ./com.x8bit.bitwarden.${{ matrix.variant }}.apk + if-no-files-found: error + + - name: Create checksum for Prod .apk artifact + if: ${{ matrix.variant == 'prod' }} + run: | + checksum -f="./com.x8bit.bitwarden.apk" ` + -t sha256 | Out-File -Encoding ASCII ./bw-android-apk-sha256.txt + + - name: Create checksum for Other .apk artifact + if: ${{ matrix.variant != 'prod' }} + run: | + checksum -f="./com.x8bit.bitwarden.${{ matrix.variant }}.apk" ` + -t sha256 | Out-File -Encoding ASCII ./bw-android-${{ matrix.variant }}-apk-sha256.txt + + - name: Upload .apk sha file for prod + if: ${{ matrix.variant == 'prod' }} + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + with: + name: bw-android-apk-sha256.txt + path: ./bw-android-apk-sha256.txt + if-no-files-found: error + + - name: Upload .apk sha file for other + if: ${{ matrix.variant != 'prod' }} + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + with: + name: bw-android-${{ matrix.variant }}-apk-sha256.txt + path: ./bw-android-${{ matrix.variant }}-apk-sha256.txt + if-no-files-found: error + + - name: Deploy to Play Store + if: ${{ matrix.variant == 'prod' && (( github.ref == 'refs/heads/main' + && needs.setup.outputs.rc_branch_exists == 0 + && needs.setup.outputs.hotfix_branch_exists == 0) + || (github.ref == 'refs/heads/rc' && needs.setup.outputs.hotfix_branch_exists == 0) + || github.ref == 'refs/heads/hotfix-rc' ) }} + run: | + $publisherPath = "$($env:GITHUB_WORKSPACE)\store\google\Publisher\bin\Release\net8.0\Publisher.dll" + $credsPath = "$($HOME)\secrets\play_creds.json" + $aabPath = "$($env:GITHUB_WORKSPACE)\com.x8bit.bitwarden.aab" + $track = "internal" + + dotnet $publisherPath $credsPath $aabPath $track + + + f-droid: + name: F-Droid Build + runs-on: windows-2022 + env: + android_folder_path: src\App\Platforms\Android + android_folder_path_bash: src/App/Platforms/Android + android_manifest_path: src/App/Platforms/Android/AndroidManifest.xml + steps: + - name: Setup NuGet + uses: nuget/setup-nuget@a21f25cd3998bf370fde17e3f1b4c12c175172f9 # v2.0.0 + with: + nuget-version: 6.4.0 + + - name: Set up .NET + uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 + with: + dotnet-version: '8.0.x' + + - name: Set up MSBuild + uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 + + - name: Setup Windows builder + run: choco install checksum --no-progress + + - name: Install Microsoft OpenJDK 11 + run: | + choco install microsoft-openjdk11 --no-progress + Write-Output "JAVA_HOME=$(Get-ChildItem -Path 'C:\Program Files\Microsoft\jdk*' | Select -First 1 -ExpandProperty FullName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + Write-Output "Java Home: $env:JAVA_HOME" + + - name: Print environment + run: | + nuget help | grep Version + msbuild -version + dotnet --info + echo "GitHub ref: $GITHUB_REF" + echo "GitHub event: $GITHUB_EVENT" + + - name: Checkout repo + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + - name: Login to Azure - CI Subscription + uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 + with: + creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} + + - name: Download secrets + env: + ACCOUNT_NAME: bitwardenci + CONTAINER_NAME: mobile + FILE: app_fdroid-keystore.jks + run: | + az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME --name $FILE \ + --file ${{ env.android_folder_path_bash }}/$FILE --output none + shell: bash + + - name: Increment version + run: | + BUILD_NUMBER=$((11000 + $GITHUB_RUN_NUMBER)) + echo "##### Setting F-Droid Version Code to $BUILD_NUMBER" | tee -a $GITHUB_STEP_SUMMARY + + sed -i "s/android:versionCode=\"1\"/android:versionCode=\"$BUILD_NUMBER\"/" \ + ./${{ env.android_manifest_path }} + shell: bash + + - name: Clean for F-Droid + run: | + $directoryBuildProps = $($env:GITHUB_WORKSPACE + "/Directory.Build.props"); + + $androidManifest = $($env:GITHUB_WORKSPACE + "/${{ env.android_manifest_path }}"); + + Write-Output "##### Back up project files" + + Copy-Item $androidManifest $($androidManifest + ".original"); + Copy-Item $directoryBuildProps $($directoryBuildProps + ".original"); + + Write-Output "##### Cleanup Android Manifest" + + $xml=New-Object XML; + $xml.Load($androidManifest); + + $nsAndroid=New-Object System.Xml.XmlNamespaceManager($xml.NameTable); + $nsAndroid.AddNamespace("android", "http://schemas.android.com/apk/res/android"); + + $xml.Save($androidManifest); + + Write-Output "##### Enabling FDROID constant" + + (Get-Content $directoryBuildProps).Replace('', 'FDROID') | Set-Content $directoryBuildProps + + - name: Restore packages + run: dotnet restore + + - name: Build & Sign F-Droid + env: + FDROID_KEYSTORE_PASSWORD: ${{ secrets.FDROID_KEYSTORE_PASSWORD }} + run: | + $projToBuild = "$($env:GITHUB_WORKSPACE)\${{ env.main_app_project_path }}"; + $packageName = "com.x8bit.bitwarden"; + + Write-Output "##### Sign FDroid" + + $signingFdroidKeyStore = "$($env:GITHUB_WORKSPACE)\${{ env.android_folder_path }}\app_fdroid-keystore.jks" + dotnet build $projToBuild -c Release -f ${{ env.target-net-version }}-android ` + /p:AndroidKeyStore=true ` + /p:AndroidSigningKeyStore=$signingFdroidKeyStore ` + /p:AndroidSigningKeyAlias=bitwarden ` + /p:AndroidSigningKeyPass="$($env:FDROID_KEYSTORE_PASSWORD)" ` + /p:AndroidSigningStorePass="$($env:FDROID_KEYSTORE_PASSWORD)" ` --no-restore - # Write-Output "##### Copy FDroid apk to project root" + Write-Output "##### Copy FDroid apk to project root" - # $signedApkPath = "$($env:GITHUB_WORKSPACE)\${{ env.main_app_folder_path }}\bin\Release\${{ env.target-net-version }}-android\$($packageName)-Signed.apk"; - # $signedApkDestPath = "$($env:GITHUB_WORKSPACE)\com.x8bit.bitwarden-fdroid.apk"; + $signedApkPath = "$($env:GITHUB_WORKSPACE)\${{ env.main_app_folder_path }}\bin\Release\${{ env.target-net-version }}-android\$($packageName)-Signed.apk"; + $signedApkDestPath = "$($env:GITHUB_WORKSPACE)\com.x8bit.bitwarden-fdroid.apk"; - # Copy-Item $signedApkPath $signedApkDestPath + Copy-Item $signedApkPath $signedApkDestPath - # - name: Upload F-Droid .apk artifact - # uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - # with: - # name: com.x8bit.bitwarden-fdroid.apk - # path: ./com.x8bit.bitwarden-fdroid.apk - # if-no-files-found: error + - name: Upload F-Droid .apk artifact + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + with: + name: com.x8bit.bitwarden-fdroid.apk + path: ./com.x8bit.bitwarden-fdroid.apk + if-no-files-found: error - # - name: Create checksum for F-Droid artifact - # run: | - # checksum -f="./com.x8bit.bitwarden-fdroid.apk" ` - # -t sha256 | Out-File -Encoding ASCII ./bw-fdroid-apk-sha256.txt + - name: Create checksum for F-Droid artifact + run: | + checksum -f="./com.x8bit.bitwarden-fdroid.apk" ` + -t sha256 | Out-File -Encoding ASCII ./bw-fdroid-apk-sha256.txt - # - name: Upload F-Droid sha file - # uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - # with: - # name: bw-fdroid-apk-sha256.txt - # path: ./bw-fdroid-apk-sha256.txt - # if-no-files-found: error + - name: Upload F-Droid sha file + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + with: + name: bw-fdroid-apk-sha256.txt + path: ./bw-fdroid-apk-sha256.txt + if-no-files-found: error ios: @@ -432,10 +432,6 @@ jobs: app_output_name: App app_ci_output_filename: App_x64_Debug steps: - - name: Remove dotnet - run: | - cd /usr/local/share/dotnet && ls - rm -rf dotnet - name: Checkout repo uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: @@ -701,81 +697,81 @@ jobs: --username "$APPLE_ID_USERNAME" --password "$APPLE_ID_PASSWORD" - # crowdin-push: - # name: Crowdin Push - # if: github.ref == 'refs/heads/main' - # needs: - # - android - # - f-droid - # - ios - # runs-on: ubuntu-22.04 - # env: - # _CROWDIN_PROJECT_ID: "269690" - # steps: - # - name: Checkout repo - # uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - # - name: Login to Azure - CI Subscription - # uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - # with: - # creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - # - name: Retrieve secrets - # id: retrieve-secrets - # uses: bitwarden/gh-actions/get-keyvault-secrets@main - # with: - # keyvault: "bitwarden-ci" - # secrets: "crowdin-api-token" - - # - name: Upload Sources - # uses: crowdin/github-action@61ac8b980551f674046220c3e104bddae2916ac5 # v2.0.0 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }} - # with: - # config: crowdin.yml - # crowdin_branch_name: main - # upload_sources: true - # upload_translations: false - - - # check-failures: - # name: Check for failures - # if: always() - # runs-on: ubuntu-22.04 - # needs: - # - cloc - # - android - # - f-droid - # - ios - # - crowdin-push - # steps: - # - name: Check if any job failed - # if: | - # (github.ref == 'refs/heads/main' - # || github.ref == 'refs/heads/rc' - # || github.ref == 'refs/heads/hotfix-rc') - # && contains(needs.*.result, 'failure') - # run: exit 1 - - # - name: Login to Azure - CI Subscription - # uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 - # if: failure() - # with: - # creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - # - name: Retrieve secrets - # id: retrieve-secrets - # uses: bitwarden/gh-actions/get-keyvault-secrets@main - # if: failure() - # with: - # keyvault: "bitwarden-ci" - # secrets: "devops-alerts-slack-webhook-url" - - # - name: Notify Slack on failure - # uses: act10ns/slack@44541246747a30eb3102d87f7a4cc5471b0ffb7d # v2.1.0 - # if: failure() - # env: - # SLACK_WEBHOOK_URL: ${{ steps.retrieve-secrets.outputs.devops-alerts-slack-webhook-url }} - # with: - # status: ${{ job.status }} + crowdin-push: + name: Crowdin Push + if: github.ref == 'refs/heads/main' + needs: + - android + - f-droid + - ios + runs-on: ubuntu-22.04 + env: + _CROWDIN_PROJECT_ID: "269690" + steps: + - name: Checkout repo + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + - name: Login to Azure - CI Subscription + uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 + with: + creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} + + - name: Retrieve secrets + id: retrieve-secrets + uses: bitwarden/gh-actions/get-keyvault-secrets@main + with: + keyvault: "bitwarden-ci" + secrets: "crowdin-api-token" + + - name: Upload Sources + uses: crowdin/github-action@61ac8b980551f674046220c3e104bddae2916ac5 # v2.0.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }} + with: + config: crowdin.yml + crowdin_branch_name: main + upload_sources: true + upload_translations: false + + + check-failures: + name: Check for failures + if: always() + runs-on: ubuntu-22.04 + needs: + - cloc + - android + - f-droid + - ios + - crowdin-push + steps: + - name: Check if any job failed + if: | + (github.ref == 'refs/heads/main' + || github.ref == 'refs/heads/rc' + || github.ref == 'refs/heads/hotfix-rc') + && contains(needs.*.result, 'failure') + run: exit 1 + + - name: Login to Azure - CI Subscription + uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 + if: failure() + with: + creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} + + - name: Retrieve secrets + id: retrieve-secrets + uses: bitwarden/gh-actions/get-keyvault-secrets@main + if: failure() + with: + keyvault: "bitwarden-ci" + secrets: "devops-alerts-slack-webhook-url" + + - name: Notify Slack on failure + uses: act10ns/slack@44541246747a30eb3102d87f7a4cc5471b0ffb7d # v2.1.0 + if: failure() + env: + SLACK_WEBHOOK_URL: ${{ steps.retrieve-secrets.outputs.devops-alerts-slack-webhook-url }} + with: + status: ${{ job.status }} From 6b0382feb97ef10f6576425692182a092f9452a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lison=20Fernandes?= Date: Wed, 9 Oct 2024 19:44:11 +0100 Subject: [PATCH 18/22] Revert csproj and build.props --- Directory.Build.props | 3 --- src/App/App.csproj | 4 ++-- src/Core/Core.csproj | 4 ++-- src/iOS.Autofill/iOS.Autofill.csproj | 4 ++-- src/iOS.Core/iOS.Core.csproj | 4 ++-- src/iOS.Extension/iOS.Extension.csproj | 4 ++-- src/iOS.ShareExtension/iOS.ShareExtension.csproj | 4 ++-- 7 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 27521e1eb..c1cdb00de 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -6,9 +6,6 @@ True True -gcc_flags "-L$(ProjectDir)../../lib/ios -largon2 -force_load $(ProjectDir)../../lib/ios/libargon2.a" - - 17.5 - diff --git a/src/App/App.csproj b/src/App/App.csproj index 51e4525fc..900e5e048 100644 --- a/src/App/App.csproj +++ b/src/App/App.csproj @@ -83,8 +83,8 @@ - - + + diff --git a/src/Core/Core.csproj b/src/Core/Core.csproj index 7281ed116..3f880f911 100644 --- a/src/Core/Core.csproj +++ b/src/Core/Core.csproj @@ -26,8 +26,8 @@ - - + + diff --git a/src/iOS.Autofill/iOS.Autofill.csproj b/src/iOS.Autofill/iOS.Autofill.csproj index 9a574f14e..2947ad3ee 100644 --- a/src/iOS.Autofill/iOS.Autofill.csproj +++ b/src/iOS.Autofill/iOS.Autofill.csproj @@ -143,8 +143,8 @@ - - + + diff --git a/src/iOS.Core/iOS.Core.csproj b/src/iOS.Core/iOS.Core.csproj index 66aed0460..99716ff25 100644 --- a/src/iOS.Core/iOS.Core.csproj +++ b/src/iOS.Core/iOS.Core.csproj @@ -23,8 +23,8 @@ - - + + diff --git a/src/iOS.Extension/iOS.Extension.csproj b/src/iOS.Extension/iOS.Extension.csproj index 494941bcb..58a596b0f 100644 --- a/src/iOS.Extension/iOS.Extension.csproj +++ b/src/iOS.Extension/iOS.Extension.csproj @@ -111,8 +111,8 @@ - - + + diff --git a/src/iOS.ShareExtension/iOS.ShareExtension.csproj b/src/iOS.ShareExtension/iOS.ShareExtension.csproj index 85aefe879..429a91e17 100644 --- a/src/iOS.ShareExtension/iOS.ShareExtension.csproj +++ b/src/iOS.ShareExtension/iOS.ShareExtension.csproj @@ -102,8 +102,8 @@ - - + + From b1f9884b643ec5116fa5164a219a5f57b7ea6c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lison=20Fernandes?= Date: Wed, 9 Oct 2024 19:46:03 +0100 Subject: [PATCH 19/22] Remove diag flag --- .github/workflows/build.yml | 2 +- Directory.Build.props | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5778aeef..602e06802 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -585,7 +585,7 @@ jobs: - name: Archive Build for App Store run: | echo "##### Archive for Release ios-arm64" - dotnet publish ${{ env.main_app_project_path }} -c Release -f ${{ env.target-net-version }}-ios -v diag /p:RuntimeIdentifier=ios-arm64 /p:ArchiveOnBuild=true /p:MtouchUseLlvm=false + dotnet publish ${{ env.main_app_project_path }} -c Release -f ${{ env.target-net-version }}-ios /p:RuntimeIdentifier=ios-arm64 /p:ArchiveOnBuild=true /p:MtouchUseLlvm=false - name: Archive Build for Mobile Automation run: | diff --git a/Directory.Build.props b/Directory.Build.props index c1cdb00de..359798807 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -6,7 +6,6 @@ True True -gcc_flags "-L$(ProjectDir)../../lib/ios -largon2 -force_load $(ProjectDir)../../lib/ios/libargon2.a" - From 6e7f561b5e5a18bc6f85b49f3c617a579b0d078e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lison=20Fernandes?= Date: Wed, 9 Oct 2024 20:13:00 +0100 Subject: [PATCH 20/22] Android / F-droid: Install pinned version of maui workload instead of latest --- .github/workflows/build.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 602e06802..c5c9cbbc7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,8 @@ env: main_app_folder_path: src/App main_app_project_path: src/App/App.csproj target-net-version: net8.0 + dotnet-version: '8.0.402' + maui-workload-version: '8.0.402' jobs: cloc: @@ -80,7 +82,11 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 with: - dotnet-version: '8.0.x' + dotnet-version: ${{ env.dotnet-version }} + + - name: Install MAUI Workload + run: | + dotnet workload install maui --version ${{ env.maui-workload-version }} - name: Set up MSBuild uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 @@ -302,7 +308,11 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 with: - dotnet-version: '8.0.x' + dotnet-version: ${{ env.dotnet-version }} + + - name: Install MAUI Workload + run: | + dotnet workload install maui --version ${{ env.maui-workload-version }} - name: Set up MSBuild uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 @@ -450,13 +460,11 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 with: - dotnet-version: '8.0.402' + dotnet-version: ${{ env.dotnet-version }} - # This step might be obsolete at some point as .NET MAUI workloads - # are starting to come pre-installed on the GH Actions build agents. - name: Install MAUI Workload run: | - dotnet workload install maui --version 8.0.402 + dotnet workload install maui --version ${{ env.maui-workload-version }} - name: Print environment run: | From d0a3336352e12f5a31d2bea89934886de82379c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lison=20Fernandes?= Date: Wed, 9 Oct 2024 20:45:00 +0100 Subject: [PATCH 21/22] Android / F-Droid: checkout repo earlier in the build process so global.json is used --- .github/workflows/build.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c5c9cbbc7..cc9bbc6b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -74,6 +74,11 @@ jobs: android_folder_path: src\App\Platforms\Android android_folder_path_bash: src/App/Platforms/Android steps: + - name: Checkout repo + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + fetch-depth: 0 + - name: Setup NuGet uses: nuget/setup-nuget@a21f25cd3998bf370fde17e3f1b4c12c175172f9 # v2.0.0 with: @@ -109,11 +114,6 @@ jobs: echo "GitHub ref: $GITHUB_REF" echo "GitHub event: $GITHUB_EVENT" - - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - fetch-depth: 0 - - name: Login to Azure - CI Subscription uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 with: @@ -300,6 +300,11 @@ jobs: android_folder_path_bash: src/App/Platforms/Android android_manifest_path: src/App/Platforms/Android/AndroidManifest.xml steps: + - name: Checkout repo + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + fetch-depth: 0 + - name: Setup NuGet uses: nuget/setup-nuget@a21f25cd3998bf370fde17e3f1b4c12c175172f9 # v2.0.0 with: @@ -334,9 +339,6 @@ jobs: echo "GitHub ref: $GITHUB_REF" echo "GitHub event: $GITHUB_EVENT" - - name: Checkout repo - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - name: Login to Azure - CI Subscription uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 with: From b2ffb47a4b377e9e58cd829c6950d51203e5787f Mon Sep 17 00:00:00 2001 From: Opeyemi Date: Thu, 10 Oct 2024 09:27:02 +0100 Subject: [PATCH 22/22] Update .github/workflows/build.yml --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc9bbc6b3..2b4c8ae6c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -465,8 +465,7 @@ jobs: dotnet-version: ${{ env.dotnet-version }} - name: Install MAUI Workload - run: | - dotnet workload install maui --version ${{ env.maui-workload-version }} + run: dotnet workload install maui --version ${{ env.maui-workload-version }} - name: Print environment run: |