1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-06-28 10:54:54 +02:00
bitwarden-desktop/appveyor.yml

99 lines
2.7 KiB
YAML
Raw Normal View History

2019-03-12 17:31:30 +01:00
image:
2019-03-13 05:23:08 +01:00
- Visual Studio 2017
2019-03-12 17:31:30 +01:00
- Ubuntu1804
branches:
except:
- l10n_master
stack: node 10
2019-03-12 19:39:09 +01:00
init:
- sh: sudo apt-get update
- sh: sudo apt-get -y install pkg-config libxss-dev libsecret-1-dev rpm
2019-03-13 04:34:59 +01:00
- sh: sudo snap install snapcraft --classic
2019-03-12 19:39:09 +01:00
- ps: |
if($isWindows) {
Install-Product node 10
}
2019-03-12 17:31:30 +01:00
install:
2019-03-12 17:52:59 +01:00
- ps: |
2019-03-13 05:07:36 +01:00
$env:PACKAGE_VERSION = (Get-Content -Raw -Path .\src\package.json | ConvertFrom-Json).version
$env:PROD_DEPLOY = "false"
2019-03-13 03:10:40 +01:00
if($env:APPVEYOR_REPO_TAG -eq "true" -and $env:APPVEYOR_RE_BUILD -eq "True") {
2019-03-13 05:07:36 +01:00
$env:PROD_DEPLOY = "true"
2019-03-13 03:10:40 +01:00
echo "This is a production deployment."
2019-03-12 20:32:16 +01:00
}
2019-03-12 17:52:59 +01:00
if($isWindows) {
choco install cloc --no-progress
cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
}
2019-03-13 04:59:35 +01:00
before_build:
- node --version
- npm --version
2019-03-13 04:34:59 +01:00
- sh: |
2019-03-13 05:07:36 +01:00
if [ "${SNAP_TOKEN}" != "" -a "${PROD_DEPLOY}" == "true" ]
2019-03-13 04:34:59 +01:00
then
2019-03-13 04:51:03 +01:00
echo "$SNAP_TOKEN" | snapcraft login --with -
2019-03-13 04:34:59 +01:00
fi
2019-03-13 05:23:08 +01:00
- ps: |
2019-03-13 05:25:23 +01:00
if($isWindows -and $env:CHOCO_API_KEY -ne $null -and $env:PROD_DEPLOY -eq "true") {
2019-03-13 05:23:08 +01:00
choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/
}
2019-03-12 17:31:30 +01:00
build_script:
- npm install
- ps: |
2019-03-12 17:52:59 +01:00
if($isLinux) {
2019-03-12 18:46:06 +01:00
npm run dist:lin
2019-03-13 05:07:36 +01:00
Push-AppveyorArtifact ./dist/Bitwarden-${env:PACKAGE_VERSION}-x86_64.AppImage
Push-AppveyorArtifact ./dist/bitwarden_${env:PACKAGE_VERSION}_amd64.snap
Push-AppveyorArtifact ./dist/Bitwarden-${env:PACKAGE_VERSION}-amd64.deb
Push-AppveyorArtifact ./dist/Bitwarden-${env:PACKAGE_VERSION}-x64.freebsd
Push-AppveyorArtifact ./dist/Bitwarden-${env:PACKAGE_VERSION}-x86_64.rpm
2019-03-12 17:52:59 +01:00
}
else {
2019-03-12 18:46:06 +01:00
npm run dist:win:ci
2019-03-13 05:07:36 +01:00
Push-AppveyorArtifact .\dist\Bitwarden-Portable-${env:PACKAGE_VERSION}.exe
Push-AppveyorArtifact .\dist\nsis-web\Bitwarden-Installer-${env:PACKAGE_VERSION}.exe
Push-AppveyorArtifact .\dist\Bitwarden-${env:PACKAGE_VERSION}-x64.appx
Push-AppveyorArtifact .\dist\Bitwarden-${env:PACKAGE_VERSION}-ia32.appx
2019-03-12 17:52:59 +01:00
}
2019-03-12 19:02:17 +01:00
2019-03-12 20:32:16 +01:00
after_build:
- ps: |
2019-03-13 05:07:36 +01:00
if($env:PROD_DEPLOY -eq "true") {
2019-03-12 21:37:36 +01:00
if($isLinux) {
echo "Deploy Linux..."
2019-03-13 05:07:36 +01:00
./scripts/snap-update.ps1 -version $env:PACKAGE_VERSION
2019-03-12 21:37:36 +01:00
}
else {
echo "Deploy Windows..."
2019-03-13 05:07:36 +01:00
./scripts/choco-update.ps1 -version $env:PACKAGE_VERSION
2019-03-12 21:37:36 +01:00
}
2019-03-12 20:32:16 +01:00
}
2019-03-13 04:51:03 +01:00
- sh: |
2019-03-13 05:23:08 +01:00
if [ "${SNAP_TOKEN}" != "" -a "${PROD_DEPLOY}" == "true" ]
2019-03-13 04:51:03 +01:00
then
snapcraft logout
fi
2019-03-12 20:32:16 +01:00
for:
2019-03-12 19:53:00 +01:00
-
matrix:
only:
- image: Visual Studio 2017
cache:
2019-03-13 03:22:10 +01:00
- '%LOCALAPPDATA%\electron -> appveyor.yml'
- '%LOCALAPPDATA%\electron-builder -> appveyor.yml'
2019-03-12 19:53:00 +01:00
-
matrix:
only:
- image: Ubuntu1804
cache:
- '/home/appveyor/.cache/electron -> appveyor.yml'
- '/home/appveyor/.cache/electron-builder -> appveyor.yml'