mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18:27 +03:00
rework build scripts
This commit is contained in:
parent
f4ad1ec8e7
commit
e9efcf1b92
5 changed files with 30 additions and 14 deletions
|
@ -4,6 +4,7 @@ $androidPath = $($rootPath + "\src\Android\Android.csproj");
|
|||
$appPath = $($rootPath + "\src\App\App.csproj");
|
||||
|
||||
$appKeystoreFdroidFilename = "app_fdroid-keystore.jks";
|
||||
$androidManifest = $($rootPath + "\src\Android\Properties\AndroidManifest.xml");
|
||||
|
||||
Write-Output "########################################"
|
||||
Write-Output "##### Clean Android and App"
|
||||
|
@ -80,11 +81,9 @@ Write-Output "########################################"
|
|||
|
||||
Invoke-Expression "& nuget restore"
|
||||
|
||||
Write-Output "########################################"
|
||||
Write-Output "##### Build FDroid Configuration"
|
||||
Write-Output "########################################"
|
||||
|
||||
msbuild "$($androidPath)" "/p:Configuration=FDroid"
|
||||
# Build F-Droid Configuration
|
||||
$buildScriptPath = $($rootPath + ".\.github\scripts\android\build.ps1");
|
||||
Invoke-Expression "& `"$buildScriptPath`" -configuration FDroid"
|
||||
|
||||
Write-Output "########################################"
|
||||
Write-Output "##### Sign FDroid Configuration"
|
13
.github/scripts/android/build.ps1
vendored
Normal file
13
.github/scripts/android/build.ps1
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
param (
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string] $configuration
|
||||
)
|
||||
|
||||
$rootPath = $env:GITHUB_WORKSPACE;
|
||||
$androidPath = $($rootPath + "\src\Android\Android.csproj");
|
||||
|
||||
Write-Output "########################################"
|
||||
Write-Output "##### Build $configuration Configuration"
|
||||
Write-Output "########################################"
|
||||
|
||||
msbuild "$($androidPath)" "/p:Configuration=$configuration"
|
4
.github/scripts/decrypt-secret.ps1
vendored
4
.github/scripts/decrypt-secret.ps1
vendored
|
@ -14,14 +14,14 @@ $passphrase = $env:DECRYPT_FILE_PASSWORD
|
|||
$secretOutputPath = $homePath + "\secrets"
|
||||
|
||||
if ([string]::IsNullOrEmpty($output)) {
|
||||
if($filename.EndsWith(".gpg")) {
|
||||
if ($filename.EndsWith(".gpg")) {
|
||||
$output = $secretOutputPath + "\" + $filename.TrimEnd(".gpg")
|
||||
} else {
|
||||
$output = $secretOutputPath + "\" + $filename + ".plaintext"
|
||||
}
|
||||
}
|
||||
|
||||
if(!(Test-Path -Path $secretOutputPath))
|
||||
if (!(Test-Path -Path $secretOutputPath))
|
||||
{
|
||||
New-Item -ItemType Directory -Path $secretOutputPath
|
||||
}
|
||||
|
|
18
.github/workflows/build.yml
vendored
18
.github/workflows/build.yml
vendored
|
@ -43,36 +43,40 @@ jobs:
|
|||
- name: Restore packages
|
||||
run: nuget restore
|
||||
|
||||
- name: Build for Play Store
|
||||
- name: Build
|
||||
run: ./.github/scripts/android/build.ps1 -configuration Release
|
||||
shell: pwsh
|
||||
|
||||
- name: Sign for Play Store
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: ./.github/scripts/android/build-play.ps1
|
||||
run: ./.github/scripts/android/sign-play.ps1
|
||||
shell: pwsh
|
||||
env:
|
||||
PLAY_KEYSTORE_PASSWORD: ${{ secrets.PLAY_KEYSTORE_PASSWORD }}
|
||||
UPLOAD_KEYSTORE_PASSWORD: ${{ secrets.UPLOAD_KEYSTORE_PASSWORD }}
|
||||
|
||||
- name: Upload Play Store .aab
|
||||
- name: Upload Play Store .aab artifact
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: com.x8bit.bitwarden.aab
|
||||
path: ./com.x8bit.bitwarden.aab
|
||||
|
||||
- name: Upload Play Store .apk
|
||||
- name: Upload Play Store .apk artifact
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: com.x8bit.bitwarden.apk
|
||||
path: ./com.x8bit.bitwarden.apk
|
||||
|
||||
- name: Build for F-Droid Store
|
||||
- name: Build and Sign for F-Droid Store
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: ./.github/scripts/android/build-fdroid.ps1
|
||||
run: ./.github/scripts/android/build-sign-fdroid.ps1
|
||||
shell: pwsh
|
||||
env:
|
||||
FDROID_KEYSTORE_PASSWORD: ${{ secrets.FDROID_KEYSTORE_PASSWORD }}
|
||||
|
||||
- name: Upload F-Droid .apk
|
||||
- name: Upload F-Droid .apk artifact
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
|
|
Loading…
Reference in a new issue