-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.appveyor.yml
More file actions
118 lines (107 loc) · 5.18 KB
/
.appveyor.yml
File metadata and controls
118 lines (107 loc) · 5.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
##
# AppVeyor build automation:
# - application on Windows and Linux (x86 + x64)
# - signed extension dev-release
##
branches: { only: [ master ] } # build only on master
skip_non_tags: false # build on every commit push (or manually)
skip_tags: true # (commits create tags, so) don't build on tags
# appveyor automatically skips commits with `[skip ci]` in the message (title)
# TODO:
# Cross-compile on one (linux) machine for all targets (e.g. `npm install --production --target_arch=arm --target_platform=linux`),
# then build actual installers (https://installbuilder.bitrock.com/open-source-licenses.html)
# that just zip the current node LTS (in system bitness), the sources and the (compiled) modules.
# The sources/modules and node LTS (like the browser) can then be updated independently.
# Also, unzip/copy each extension in each profile config dir and simply set the cwd/mainModule to that path.
# This allows for much less manipulation of the node environment, devs know exactly what they get (node LTS)
# and can even fork/span new processes.
# The only difference for the entry process is the stdio redirection and the arguments to the entry script.
image: # build for windows and linux
- Ubuntu # builds the extension as well, so do this first
- Visual Studio 2015
environment:
AMO_JWT_ISSUER: "user:11844708:244" # generate at https://addons.mozilla.org/developers/addon/api/key/
AMO_JWT_SECRET: # encrypt the secret with https://ci.appveyor.com/tools/encrypt
secure: qK0cmL39oH20zxiczXoa9W/xovxGLKXDx/bgBGBfTSJ3mqw/smXs3nE1eHGaOpwgVb3yn1/d76USsqFD0+2K70ZIp1OpHNrs4pjw9oaIc2g=
nodejs_version: 8.9.0
matrix:
- nodejs_arch: x64
- nodejs_arch: x86
init: # run before 'git clone'
- cmd: git config --global core.autocrlf true # use \r\n line endings on windows
clone_depth: 1 # git clone argument
install:
#
# read version from package.json
- ps: $env:package_version = (Get-Content -Raw -Path package.json | ConvertFrom-Json).version
- ps: $env:manifest_version = "$($env:package_version)b$($env:APPVEYOR_BUILD_NUMBER)"
- ps: Update-AppveyorBuild -Version "$env:manifest_version"
#
# install specified version of node.js
# windows
- ps: if ($isWindows) { Install-Product node $env:nodejs_version $env:nodejs_arch }
# linux
- sh: nvm install $nodejs_version # always x64
- sh: | # install x86 libs and node.js
if [ $nodejs_arch = 'x86' ]; then
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y libc6:i386 libncurses5:i386 libstdc++6:i386 libx32gcc-4.8-dev libc6-dev-i386 gcc-multilib g++-multilib
wget -qO- https://nodejs.org/dist/v$nodejs_version/node-v$nodejs_version-linux-x86.tar.xz | \
tar -Jx node-v$nodejs_version-linux-x86/bin/node
mv node-v$nodejs_version-linux-x86/bin/node $(which node)
node -e 'console.log("process.arch:", process.arch)'
fi
#
# application build
- cd application
# install modules, build ffi
- npm install
# pack
- npm run build && cd release
- cmd: ren native-ext.exe native-ext-v%manifest_version%-win-%nodejs_arch%.exe
- sh: mv native-ext native-ext-v$manifest_version-linux-$nodejs_arch.bin # must use extension because GitHub doesn't allow to change file extensions, which makes changing the version in the name difficult
- cd ..
# application build done
- cd ..
#
# extension build
- sh: |
if [ $nodejs_arch = 'x64' ]; then
#
cd library && npm link && cd .. # must be available to link
#
cd extension
mkdir artifacts
#
npm install # install and create a unsigned potential release version
mv build/*.zip artifacts # move to artifacts for optional manual publish
#
npm run sign # create `-dev`-channel beta build, uses $APPVEYOR_BUILD_NUMBER for version
mv build/*.xpi artifacts # move to artifacts for GitHub release
#
# invalidate current automatic update manifest, see https://gist.github.com/NiklasGollenstede/60aa2dc957f985eff2b7a2655ea1092b
export update_url=$(node -e 'process.stdout.write(JSON.parse(require("fs").readFileSync("./build/manifest.json")).applications.gecko.update_url || "")')
# must do it manually after publishing the release on GitHub
echo wget --method=DELETE -qO- $update_url > artifacts/update.sh
#
cd ..
fi
build: off # already done in install step
# grab renamed file from release/
artifacts:
- path: application/release/*
- path: extension/artifacts/*
deploy:
release: v$(manifest_version) # rename manually to v$(package_version), which should be the name of the pushed tag
description: build v$(manifest_version) # edit manually
provider: GitHub
auth_token: # created in GitHubs UI (public repo only), then encrypted in AppVoeyors UI
secure: maxxggRkssdjgLe3OEQaVQXBOtFyHVit/AsK0gBqSn8Uwf2tg9w/dvAR5Ivyn27O
artifact: /.*/
draft: true # publish manually (or delete)
prerelease: true
force_update: false # name should be unique anyway
on:
branch: master # release from master branch only
# don't restrict appveyor_repo_tag: if triggered manually on non-tag, still deploy