mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 07:05:35 +03:00
[PM-6852 ] Fix F-Droid build constant (#3085)
* Fix FDROID trackers removal by changing publish to build to see if doing this it adds the corresponding CustomConstants
* Changed parameters in new line delimiter to the one used in bash to see if that fixes passing the corresponding parameters to the build
* Revert "Changed parameters in new line delimiter to the one used in bash to see if that fixes passing the corresponding parameters to the build"
This reverts commit 608b23d115
.
* Enable FDROID constant by replacing the content of Directory.Build.props in the clean stage of F-Droid
This commit is contained in:
parent
9a9fb85ad8
commit
f343a2cdbb
2 changed files with 12 additions and 7 deletions
16
.github/workflows/build.yml
vendored
16
.github/workflows/build.yml
vendored
|
@ -363,15 +363,14 @@ jobs:
|
||||||
|
|
||||||
- name: Clean for F-Droid
|
- name: Clean for F-Droid
|
||||||
run: |
|
run: |
|
||||||
$appPath = $($env:GITHUB_WORKSPACE + "/${{ env.main_app_project_path }}");
|
$directoryBuildProps = $($env:GITHUB_WORKSPACE + "/Directory.Build.props");
|
||||||
$corePath = $($env:GITHUB_WORKSPACE + "/src/Core/Core.csproj");
|
|
||||||
|
|
||||||
$androidManifest = $($env:GITHUB_WORKSPACE + "/${{ env.android_manifest_path }}");
|
$androidManifest = $($env:GITHUB_WORKSPACE + "/${{ env.android_manifest_path }}");
|
||||||
|
|
||||||
Write-Output "##### Back up project files"
|
Write-Output "##### Back up project files"
|
||||||
|
|
||||||
Copy-Item $androidManifest $($androidManifest + ".original");
|
Copy-Item $androidManifest $($androidManifest + ".original");
|
||||||
Copy-Item $appPath $($appPath + ".original");
|
Copy-Item $directoryBuildProps $($directoryBuildProps + ".original");
|
||||||
|
|
||||||
Write-Output "##### Cleanup Android Manifest"
|
Write-Output "##### Cleanup Android Manifest"
|
||||||
|
|
||||||
|
@ -383,6 +382,10 @@ jobs:
|
||||||
|
|
||||||
$xml.Save($androidManifest);
|
$xml.Save($androidManifest);
|
||||||
|
|
||||||
|
Write-Output "##### Enabling FDROID constant"
|
||||||
|
|
||||||
|
(Get-Content $directoryBuildProps).Replace('<!-- <CustomConstants>FDROID</CustomConstants> -->', '<CustomConstants>FDROID</CustomConstants>') | Set-Content $directoryBuildProps
|
||||||
|
|
||||||
- name: Restore packages
|
- name: Restore packages
|
||||||
run: dotnet restore
|
run: dotnet restore
|
||||||
|
|
||||||
|
@ -396,17 +399,16 @@ jobs:
|
||||||
Write-Output "##### Sign FDroid"
|
Write-Output "##### Sign FDroid"
|
||||||
|
|
||||||
$signingFdroidKeyStore = "$($env:GITHUB_WORKSPACE)\${{ env.android_folder_path }}\app_fdroid-keystore.jks"
|
$signingFdroidKeyStore = "$($env:GITHUB_WORKSPACE)\${{ env.android_folder_path }}\app_fdroid-keystore.jks"
|
||||||
dotnet publish $projToBuild -c Release -f ${{ env.target-net-version }}-android `
|
dotnet build $projToBuild -c Release -f ${{ env.target-net-version }}-android `
|
||||||
/p:AndroidKeyStore=true `
|
/p:AndroidKeyStore=true `
|
||||||
/p:AndroidSigningKeyStore=$signingFdroidKeyStore `
|
/p:AndroidSigningKeyStore=$signingFdroidKeyStore `
|
||||||
/p:AndroidSigningKeyAlias=bitwarden `
|
/p:AndroidSigningKeyAlias=bitwarden `
|
||||||
/p:AndroidSigningKeyPass="$($env:FDROID_KEYSTORE_PASSWORD)" `
|
/p:AndroidSigningKeyPass="$($env:FDROID_KEYSTORE_PASSWORD)" `
|
||||||
/p:AndroidSigningStorePass="$($env:FDROID_KEYSTORE_PASSWORD)" `
|
/p:AndroidSigningStorePass="$($env:FDROID_KEYSTORE_PASSWORD)" ` --no-restore
|
||||||
/p:CustomConstants="FDROID" --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\publish\$($packageName)-Signed.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";
|
$signedApkDestPath = "$($env:GITHUB_WORKSPACE)\com.x8bit.bitwarden-fdroid.apk";
|
||||||
|
|
||||||
Copy-Item $signedApkPath $signedApkDestPath
|
Copy-Item $signedApkPath $signedApkDestPath
|
||||||
|
|
|
@ -9,5 +9,8 @@
|
||||||
|
|
||||||
<!-- Uncomment this when Unit Testing-->
|
<!-- Uncomment this when Unit Testing-->
|
||||||
<!-- <CustomConstants>UT</CustomConstants> -->
|
<!-- <CustomConstants>UT</CustomConstants> -->
|
||||||
|
|
||||||
|
<!-- Uncomment this when building FDROID-->
|
||||||
|
<!-- <CustomConstants>FDROID</CustomConstants> -->
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
Loading…
Reference in a new issue