bitwarden-estensione-browser/appveyor.yml

139 lines
4.1 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:
2019-03-15 06:01:26 +01:00
- ps: |
if($isWindows -and $env:DEBUG_RDP -eq "true") {
iex ((new-object net.webclient).DownloadString(`
'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
}
2019-03-12 19:39:09 +01:00
- sh: sudo apt-get update
- sh: sudo apt-get -y install pkg-config libxss-dev libsecret-1-dev rpm
- ps: |
if($isWindows) {
Install-Product node 10
}
if($env:APPVEYOR_REPO_TAG -eq "true") {
$env:RELEASE_NAME = $env:APPVEYOR_REPO_TAG_NAME.TrimStart("v")
}
2019-03-12 19:39:09 +01:00
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 05:29:51 +01:00
# Get new $SNAP_TOKEN with:
# $ snapcraft export-login --snaps bitwarden --acls package_push,package_release -
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
2020-03-11 04:13:25 +01:00
sudo apt-get update
sudo apt-get -y install snapd
2019-03-13 05:39:21 +01:00
sudo snap install snapcraft --classic
2020-03-25 13:39:42 +01:00
export PATH="$PATH:/snap/bin"
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") {
2020-03-25 13:39:42 +01:00
choco install checksum --no-progress
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
2020-03-12 20:30:48 +01:00
- npm run lint
2019-03-12 17:31:30 +01:00
- 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
Rename-Item -Path .\dist\Bitwarden-${env:PACKAGE_VERSION}-x64.appx `
-NewName Bitwarden-${env:PACKAGE_VERSION}-x64-store.appx
Rename-Item -Path .\dist\Bitwarden-${env:PACKAGE_VERSION}-ia32.appx `
-NewName Bitwarden-${env:PACKAGE_VERSION}-ia32-store.appx
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-store.appx
Push-AppveyorArtifact .\dist\Bitwarden-${env:PACKAGE_VERSION}-ia32-store.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-17 04:31:36 +01:00
.\scripts\choco-update.ps1 -version $env:PACKAGE_VERSION
Push-AppveyorArtifact .\dist\chocolatey\bitwarden.${env:PACKAGE_VERSION}.nupkg
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
2019-03-15 06:01:26 +01:00
on_finish:
- 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'))
}
for:
2019-03-12 19:53:00 +01:00
-
matrix:
only:
- image: Visual Studio 2017
cache:
2019-03-23 03:23:50 +01:00
- '%LOCALAPPDATA%\electron'
- '%LOCALAPPDATA%\electron-builder'
2019-03-12 19:53:00 +01:00
-
matrix:
only:
- image: Ubuntu1804
cache:
2019-03-23 03:23:50 +01:00
- '/home/appveyor/.cache/electron'
- '/home/appveyor/.cache/electron-builder'
deploy:
tag: $(APPVEYOR_REPO_TAG_NAME)
release: $(RELEASE_NAME)
provider: GitHub
auth_token: $(GH_TOKEN)
artifact: .*(\.nupkg|_store\.appx)$
force_update: true
on:
branch: master
APPVEYOR_REPO_TAG: true
2019-08-02 03:55:34 +02:00
PROD_DEPLOY: true