2019-06-10 20:57:12 +03:00
|
|
|
image:
|
2019-10-18 21:21:07 +03:00
|
|
|
- Visual Studio 2019
|
2019-06-10 20:57:12 +03:00
|
|
|
- Ubuntu1804
|
2019-06-04 19:01:51 +03:00
|
|
|
|
|
|
|
branches:
|
|
|
|
except:
|
|
|
|
- l10n_master
|
2019-06-10 20:57:12 +03:00
|
|
|
- gh-pages
|
2019-06-04 19:01:51 +03:00
|
|
|
|
|
|
|
configuration: Release
|
|
|
|
|
2019-06-10 20:57:12 +03:00
|
|
|
stack: node 10
|
|
|
|
|
2019-06-04 19:01:51 +03:00
|
|
|
init:
|
2019-06-10 20:57:12 +03:00
|
|
|
- sh: |
|
|
|
|
if [ "${DEBUG_SSH}" == "true" ]
|
|
|
|
then
|
|
|
|
curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -
|
|
|
|
fi
|
2019-06-04 19:01:51 +03:00
|
|
|
- ps: |
|
2019-06-10 20:57:12 +03:00
|
|
|
if($isWindows -and $env:DEBUG_RDP -eq "true") {
|
2019-06-04 19:01:51 +03:00
|
|
|
iex ((new-object net.webclient).DownloadString(`
|
|
|
|
'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
|
|
|
}
|
|
|
|
- ps: |
|
|
|
|
if($env:APPVEYOR_REPO_TAG -eq "true") {
|
|
|
|
$tagName = $env:APPVEYOR_REPO_TAG_NAME.TrimStart("v")
|
|
|
|
$env:RELEASE_NAME = "Version ${tagName}"
|
|
|
|
}
|
|
|
|
|
2019-06-04 06:54:40 +03:00
|
|
|
install:
|
2019-06-10 20:57:12 +03:00
|
|
|
- sh: |
|
|
|
|
curl -sflL 'https://raw.githubusercontent.com/appveyor/secure-file/master/install.sh' | bash -e -
|
|
|
|
./appveyor-tools/secure-file -decrypt ./store/fdroid/keystore.jks.enc -secret $FDROID_KEYSTORE_ENC_PASSWORD
|
|
|
|
- sh: npm install
|
|
|
|
- sh: |
|
|
|
|
sudo apt-get -qq update
|
|
|
|
sudo apt-get -qqy install --no-install-recommends fdroidserver wget
|
|
|
|
- sh: |
|
2019-06-11 00:01:27 +03:00
|
|
|
if [ "${APPVEYOR_REPO_TAG}" == "true" -a "${GH_TOKEN}" != "" ]
|
|
|
|
then
|
2019-06-10 20:57:12 +03:00
|
|
|
git config --global credential.helper store
|
|
|
|
echo "https://${GH_TOKEN}:x-oauth-basic@github.com" >> ~/.git-credentials
|
|
|
|
git config --global user.email "ci@bitwarden.com"
|
|
|
|
git config --global user.name "Bitwarden CI"
|
2019-06-11 00:01:27 +03:00
|
|
|
fi
|
2019-06-10 20:57:12 +03:00
|
|
|
- cmd: choco install cloc --no-progress
|
|
|
|
- cmd: "cloc --vcs git --exclude-dir Resources,store,test,Properties --include-lang C#,XAML"
|
|
|
|
#- cmd: appveyor DownloadFile https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
|
|
|
|
#- cmd: appveyor DownloadFile https://aka.ms/vs/15/release/vs_community.exe
|
|
|
|
#- cmd: vs_community.exe update --wait --quiet --norestart --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
|
|
|
|
#- cmd: ps: .\src\Android\update-android.ps1
|
2019-06-04 19:01:51 +03:00
|
|
|
|
2019-05-28 20:29:09 +03:00
|
|
|
before_build:
|
2019-06-10 21:28:05 +03:00
|
|
|
- ps: |
|
|
|
|
if($isWindows) {
|
|
|
|
nuget restore
|
|
|
|
if($env:KEYSTORE_DEC_SECRET -or $env:GOOGLE_SERVICES_DEC_SECRET -or $env:PLAY_DEC_SECRET) {
|
|
|
|
nuget install secure-file -ExcludeVersion
|
|
|
|
}
|
|
|
|
if($env:GOOGLE_SERVICES_DEC_SECRET) {
|
|
|
|
secure-file\tools\secure-file -decrypt src\Android\google-services.json.enc `
|
|
|
|
-secret $env:GOOGLE_SERVICES_DEC_SECRET
|
|
|
|
}
|
|
|
|
}
|
2019-06-04 19:01:51 +03:00
|
|
|
|
2019-06-10 21:10:14 +03:00
|
|
|
build_script:
|
2019-06-10 20:57:12 +03:00
|
|
|
- sh: |
|
2019-06-11 00:01:27 +03:00
|
|
|
if [ "${APPVEYOR_REPO_TAG}" == "true" ]
|
|
|
|
then
|
2019-06-10 22:05:49 +03:00
|
|
|
mkdir dist
|
|
|
|
cp CNAME ./dist
|
|
|
|
cd store
|
2019-06-13 15:49:10 +03:00
|
|
|
chmod 600 fdroid/config.py fdroid/keystore.jks
|
2019-06-10 22:05:49 +03:00
|
|
|
mkdir -p temp/fdroid
|
|
|
|
TEMP_DIR="$APPVEYOR_BUILD_FOLDER/store/temp/fdroid"
|
|
|
|
cd fdroid
|
|
|
|
echo "keypass=\"$FDROID_KEYSTORE_PASSWORD\"" >>config.py
|
|
|
|
echo "keystorepass=\"$FDROID_KEYSTORE_PASSWORD\"" >>config.py
|
|
|
|
echo "local_copy_dir=\"$TEMP_DIR\"" >>config.py
|
|
|
|
mkdir -p repo
|
|
|
|
curl -Lo repo/com.x8bit.bitwarden-fdroid.apk \
|
2019-06-11 00:01:27 +03:00
|
|
|
https://github.com/bitwarden/mobile/releases/download/$APPVEYOR_REPO_TAG_NAME/com.x8bit.bitwarden-fdroid.apk
|
2019-06-10 22:05:49 +03:00
|
|
|
fdroid update
|
|
|
|
fdroid server update
|
|
|
|
cd ..
|
|
|
|
rm -rf temp/fdroid/archive
|
|
|
|
mv -v temp/fdroid ../dist
|
2019-06-10 23:09:34 +03:00
|
|
|
cd fdroid
|
|
|
|
cp index.html btn.png qr.png ../../dist/fdroid
|
2019-06-10 22:05:49 +03:00
|
|
|
cd $APPVEYOR_BUILD_FOLDER
|
2019-06-11 00:01:27 +03:00
|
|
|
fi
|
2019-06-10 20:57:12 +03:00
|
|
|
- ps: |
|
|
|
|
if($isWindows -and $env:KEYSTORE_DEC_SECRET) {
|
2019-06-10 21:50:26 +03:00
|
|
|
msbuild bitwarden-mobile.sln `
|
|
|
|
"/logger:C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" `
|
|
|
|
"/p:Configuration=Release"
|
2019-07-23 07:10:25 +03:00
|
|
|
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
|
2019-06-10 20:57:12 +03:00
|
|
|
.\src\Android\ci-build-apks.ps1
|
2019-07-23 07:10:25 +03:00
|
|
|
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
|
2019-06-10 20:57:12 +03:00
|
|
|
Push-AppveyorArtifact .\com.x8bit.bitwarden.apk
|
|
|
|
Push-AppveyorArtifact .\com.x8bit.bitwarden-fdroid.apk
|
|
|
|
}
|
2019-06-04 19:01:51 +03:00
|
|
|
|
2019-05-28 20:29:09 +03:00
|
|
|
on_success:
|
2019-06-10 20:57:12 +03:00
|
|
|
- sh: |
|
2019-06-11 00:01:27 +03:00
|
|
|
if [ "${APPVEYOR_REPO_TAG}" == "true" -a "${GH_TOKEN}" != "" ]
|
|
|
|
then
|
2019-06-10 20:57:12 +03:00
|
|
|
npm run deploy
|
2019-06-11 00:01:27 +03:00
|
|
|
fi
|
2019-06-10 21:28:05 +03:00
|
|
|
- ps: |
|
|
|
|
if($isWindows -and $env:PLAY_DEC_SECRET) {
|
|
|
|
secure-file\tools\secure-file -decrypt store\google\Publisher\play_creds.json.enc -secret $env:PLAY_DEC_SECRET
|
2019-06-10 21:40:38 +03:00
|
|
|
cd store\google\Publisher\bin\Release\netcoreapp2.0
|
|
|
|
dotnet Publisher.dll `
|
2019-06-10 21:28:05 +03:00
|
|
|
$env:APPVEYOR_BUILD_FOLDER\store\google\Publisher\play_creds.json `
|
2019-06-10 21:50:26 +03:00
|
|
|
$env:APPVEYOR_BUILD_FOLDER\com.x8bit.bitwarden.apk `
|
|
|
|
alpha
|
2019-06-10 21:40:38 +03:00
|
|
|
cd $env:APPVEYOR_BUILD_FOLDER
|
2019-06-10 21:28:05 +03:00
|
|
|
}
|
2019-06-04 19:01:51 +03:00
|
|
|
|
|
|
|
on_finish:
|
2019-06-10 20:57:12 +03:00
|
|
|
- sh: |
|
|
|
|
if [ "${DEBUG_SSH}" == "true" ]
|
|
|
|
then
|
|
|
|
export APPVEYOR_SSH_BLOCK=true
|
|
|
|
curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -
|
|
|
|
fi
|
|
|
|
- ps: |
|
|
|
|
if($isWindows -and $env:DEBUG_RDP -eq "true") {
|
|
|
|
$blockRdp = $true
|
|
|
|
iex ((new-object net.webclient).DownloadString(`
|
|
|
|
'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
|
|
|
}
|
2019-06-04 19:01:51 +03:00
|
|
|
|
|
|
|
deploy:
|
|
|
|
tag: $(APPVEYOR_REPO_TAG_NAME)
|
|
|
|
release: $(RELEASE_NAME)
|
|
|
|
provider: GitHub
|
|
|
|
auth_token: $(GH_TOKEN)
|
|
|
|
artifact: /.*/
|
|
|
|
force_update: true
|
|
|
|
on:
|
|
|
|
branch: master
|
|
|
|
APPVEYOR_REPO_TAG: true
|