2020-06-05 20:51:57 +03:00
|
|
|
name: Build
|
|
|
|
|
2020-06-08 19:14:10 +03:00
|
|
|
on:
|
|
|
|
push:
|
2020-06-08 19:17:53 +03:00
|
|
|
branches-ignore:
|
|
|
|
- 'l10n_master'
|
|
|
|
- 'gh-pages'
|
2020-06-05 20:51:57 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
2020-06-09 20:18:22 +03:00
|
|
|
cloc:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- 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
|
|
|
|
|
2020-06-05 20:51:57 +03:00
|
|
|
android:
|
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
steps:
|
2020-06-05 21:39:29 +03:00
|
|
|
- name: Set up NuGet
|
2020-06-05 21:40:44 +03:00
|
|
|
uses: nuget/setup-nuget@v1
|
2020-06-05 21:39:29 +03:00
|
|
|
with:
|
|
|
|
nuget-version: 'latest'
|
|
|
|
|
|
|
|
- name: Set up MSBuild
|
2020-06-05 21:40:44 +03:00
|
|
|
uses: microsoft/setup-msbuild@v1.0.0
|
2020-06-05 21:39:29 +03:00
|
|
|
|
2020-06-05 20:51:57 +03:00
|
|
|
- name: Print environment
|
|
|
|
run: |
|
2020-06-05 21:39:29 +03:00
|
|
|
nuget help
|
|
|
|
msbuild -version
|
2020-06-09 16:58:28 +03:00
|
|
|
dotnet --info
|
2020-06-05 20:51:57 +03:00
|
|
|
|
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2020-06-08 19:14:10 +03:00
|
|
|
- name: Decrypt secrets
|
2020-06-08 19:17:53 +03:00
|
|
|
if: github.ref == 'refs/heads/master'
|
2020-06-08 19:55:02 +03:00
|
|
|
run: ./.github/scripts/android/decrypt-secrets.ps1
|
2020-06-08 19:29:57 +03:00
|
|
|
shell: pwsh
|
2020-06-08 19:14:10 +03:00
|
|
|
env:
|
|
|
|
DECRYPT_FILE_PASSWORD: ${{ secrets.DECRYPT_FILE_PASSWORD }}
|
|
|
|
|
|
|
|
- name: Increment version
|
2020-06-08 19:17:53 +03:00
|
|
|
if: github.ref == 'refs/heads/master'
|
2020-06-08 19:55:02 +03:00
|
|
|
run: ./.github/scripts/android/increment-version.ps1
|
2020-06-08 19:29:57 +03:00
|
|
|
shell: pwsh
|
2020-06-08 19:14:10 +03:00
|
|
|
|
2020-06-05 22:23:15 +03:00
|
|
|
- name: Restore packages
|
|
|
|
run: nuget restore
|
|
|
|
|
2020-06-09 17:47:20 +03:00
|
|
|
- name: Build Play Store publisher
|
|
|
|
run: dotnet build ./store/google/Publisher/Publisher.csproj -p:Configuration=Release
|
|
|
|
|
2020-06-08 23:04:04 +03:00
|
|
|
- name: Build for Play Store
|
2020-06-08 20:19:44 +03:00
|
|
|
run: ./.github/scripts/android/build.ps1 -configuration Release
|
|
|
|
shell: pwsh
|
|
|
|
|
|
|
|
- name: Sign for Play Store
|
2020-06-08 19:17:53 +03:00
|
|
|
if: github.ref == 'refs/heads/master'
|
2020-06-08 20:19:44 +03:00
|
|
|
run: ./.github/scripts/android/sign-play.ps1
|
2020-06-08 19:29:57 +03:00
|
|
|
shell: pwsh
|
2020-06-08 19:14:10 +03:00
|
|
|
env:
|
|
|
|
PLAY_KEYSTORE_PASSWORD: ${{ secrets.PLAY_KEYSTORE_PASSWORD }}
|
|
|
|
UPLOAD_KEYSTORE_PASSWORD: ${{ secrets.UPLOAD_KEYSTORE_PASSWORD }}
|
2020-06-05 20:51:57 +03:00
|
|
|
|
2020-06-08 20:19:44 +03:00
|
|
|
- name: Upload Play Store .aab artifact
|
2020-06-08 19:17:53 +03:00
|
|
|
if: github.ref == 'refs/heads/master'
|
2020-06-08 19:14:10 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: com.x8bit.bitwarden.aab
|
|
|
|
path: ./com.x8bit.bitwarden.aab
|
2020-06-05 20:51:57 +03:00
|
|
|
|
2020-06-08 20:19:44 +03:00
|
|
|
- name: Upload Play Store .apk artifact
|
2020-06-08 19:17:53 +03:00
|
|
|
if: github.ref == 'refs/heads/master'
|
2020-06-08 19:14:10 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: com.x8bit.bitwarden.apk
|
|
|
|
path: ./com.x8bit.bitwarden.apk
|
|
|
|
|
2020-06-08 23:04:04 +03:00
|
|
|
- name: Clean for F-Droid
|
|
|
|
run: ./.github/scripts/android/clean-fdroid.ps1
|
|
|
|
shell: pwsh
|
|
|
|
|
|
|
|
- name: Restore packages
|
|
|
|
run: nuget restore
|
|
|
|
|
|
|
|
- name: Build for F-Droid
|
|
|
|
run: ./.github/scripts/android/build.ps1 -configuration FDroid
|
|
|
|
shell: pwsh
|
|
|
|
|
|
|
|
- name: Sign for F-Droid
|
2020-06-08 19:17:53 +03:00
|
|
|
if: github.ref == 'refs/heads/master'
|
2020-06-08 23:04:04 +03:00
|
|
|
run: ./.github/scripts/android/sign-fdroid.ps1
|
2020-06-08 19:29:57 +03:00
|
|
|
shell: pwsh
|
2020-06-08 19:14:10 +03:00
|
|
|
env:
|
|
|
|
FDROID_KEYSTORE_PASSWORD: ${{ secrets.FDROID_KEYSTORE_PASSWORD }}
|
|
|
|
|
2020-06-08 20:19:44 +03:00
|
|
|
- name: Upload F-Droid .apk artifact
|
2020-06-08 19:17:53 +03:00
|
|
|
if: github.ref == 'refs/heads/master'
|
2020-06-08 19:14:10 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: com.x8bit.bitwarden-fdroid.apk
|
|
|
|
path: ./com.x8bit.bitwarden-fdroid.apk
|
|
|
|
|
2020-06-09 17:21:46 +03:00
|
|
|
- name: Deploy to Play Store
|
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
run: ./.github/scripts/android/deploy-play.ps1
|
|
|
|
shell: pwsh
|
|
|
|
|
2020-06-08 19:14:10 +03:00
|
|
|
ios:
|
2020-06-05 20:51:57 +03:00
|
|
|
runs-on: macos-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Print environment
|
|
|
|
run: |
|
2020-06-05 21:39:29 +03:00
|
|
|
nuget help
|
|
|
|
msbuild -version
|
2020-06-09 16:58:28 +03:00
|
|
|
dotnet --info
|
2020-06-05 20:51:57 +03:00
|
|
|
|
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2020-06-09 17:47:09 +03:00
|
|
|
- name: Decrypt secrets
|
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
run: ./.github/scripts/ios/decrypt-secrets.ps1
|
|
|
|
shell: pwsh
|
|
|
|
env:
|
|
|
|
DECRYPT_FILE_PASSWORD: ${{ secrets.DECRYPT_FILE_PASSWORD }}
|
|
|
|
|
2020-06-10 04:23:10 +03:00
|
|
|
- name: Increment version
|
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
run: ./.github/scripts/ios/increment-version.ps1
|
|
|
|
shell: pwsh
|
|
|
|
|
2020-06-09 18:37:40 +03:00
|
|
|
- name: Set up keychain
|
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
run: ./.github/scripts/ios/setup-keychain.ps1
|
|
|
|
shell: pwsh
|
|
|
|
env:
|
|
|
|
KEYCHAIN_PASSWORD: ${{ secrets.IOS_KEYCHAIN_PASSWORD }}
|
|
|
|
MOBILE_KEY_PASSWORD: ${{ secrets.IOS_KEY_PASSWORD }}
|
|
|
|
DIST_CERT_PASSWORD: ${{ secrets.IOS_DIST_CERT_PASSWORD }}
|
|
|
|
|
2020-06-09 19:25:09 +03:00
|
|
|
- name: Set up provisioning profiles
|
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
run: ./.github/scripts/ios/setup-profiles.ps1
|
|
|
|
shell: pwsh
|
|
|
|
|
2020-06-05 22:23:15 +03:00
|
|
|
- name: Restore packages
|
|
|
|
run: nuget restore
|
|
|
|
|
2020-06-10 16:03:12 +03:00
|
|
|
- name: Archive Build for App Store
|
|
|
|
run: ./.github/scripts/ios/build.ps1 -configuration AppStore -platform iPhone -archive
|
2020-06-09 17:47:09 +03:00
|
|
|
shell: pwsh
|
2020-06-10 00:32:53 +03:00
|
|
|
env:
|
|
|
|
KEYCHAIN_PASSWORD: ${{ secrets.IOS_KEYCHAIN_PASSWORD }}
|