forked from Azure/azure-functions-nodejs-worker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
package.ps1
56 lines (53 loc) · 3.04 KB
/
package.ps1
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
param (
[Switch]$NugetPack,
[string]$buildNumber = $env:name
)
# A function that checks exit codes and fails script if an error is found
function StopOnFailedExecution {
if ($LastExitCode)
{
exit $LastExitCode
}
}
Write-Host "buildNumber: " $buildNumber
npm install
npm run build-nomaps
remove-item pkg -Recurse -ErrorAction Ignore
mkdir ./pkg/deps/grpc/etc/
mkdir ./pkg/grpc/
mkdir ./pkg/dist/src
copy-item ./node_modules/grpc/deps/grpc/etc/roots.pem ./pkg/deps/grpc/etc/
copy-item ./node_modules/grpc/package.json ./pkg/grpc/
copy-item ./dist/src/nodejsWorker.js ./pkg/dist/src/
copy-item ./worker.config.json pkg
./node_modules/.bin/webpack
StopOnFailedExecution # fail if error
# Node 8 support
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=ia32 --target=8.4.0 --target_platform=win32
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=ia32 --target=8.4.0 --target_platform=darwin
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=ia32 --target=8.4.0 --target_platform=linux --target_libc=glibc
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=x64 --target=8.4.0 --target_platform=win32
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=x64 --target=8.4.0 --target_platform=darwin
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=x64 --target=8.4.0 --target_platform=linux --target_libc=glibc
# Node 10 support
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=ia32 --target=10.1.0 --target_platform=win32
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=ia32 --target=10.1.0 --target_platform=darwin
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=ia32 --target=10.1.0 --target_platform=linux --target_libc=glibc
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=x64 --target=10.1.0 --target_platform=win32
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=x64 --target=10.1.0 --target_platform=darwin
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=x64 --target=10.1.0 --target_platform=linux --target_libc=glibc
# Node 12 support
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=ia32 --target=12.13.0 --target_platform=win32
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=ia32 --target=12.13.0 --target_platform=darwin
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=ia32 --target=12.13.0 --target_platform=linux --target_libc=glibc
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=x64 --target=12.13.0 --target_platform=win32
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=x64 --target=12.13.0 --target_platform=darwin
./node_modules/.bin/node-pre-gyp install -C pkg/grpc --target_arch=x64 --target=12.13.0 --target_platform=linux --target_libc=glibc
copy-item Worker.nuspec pkg/
if ($NugetPack)
{
set-location pkg
nuget pack -Properties version=$buildNumber
StopOnFailedExecution # fail if error
set-location ..
}