-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
package.sh
executable file
·43 lines (32 loc) · 1.79 KB
/
package.sh
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
#!/usr/bin/env sh
# couldnt figure out undocumented 'output template' mode for pkg so wrote this
# also need to include .node files until pkg supports including them in binary
# https://github.com/zeit/pkg/issues/329
NODE_ABI="node.napi"
VERSION=$(node -pe "require('./package.json').version")
rm -rf dist
mkdir dist
mkdir builds/cabal-$VERSION-linux-x64
mkdir builds/cabal-$VERSION-macos-x64
mkdir builds/cabal-$VERSION-win-x64
mv builds/cabal-linux builds/cabal-$VERSION-linux-x64/cabal
mv builds/cabal-macos builds/cabal-$VERSION-macos-x64/cabal
mv builds/cabal-win.exe builds/cabal-$VERSION-win-x64/cabal.exe
cp node_modules/utp-native/prebuilds/linux-x64/$NODE_ABI.node builds/cabal-$VERSION-linux-x64/
cp node_modules/utp-native/prebuilds/darwin-x64/$NODE_ABI.node builds/cabal-$VERSION-macos-x64/
cp node_modules/utp-native/prebuilds/win32-x64/$NODE_ABI.node builds/cabal-$VERSION-win-x64/
cp node_modules/leveldown/prebuilds/linux-x64/$NODE_ABI.node builds/cabal-$VERSION-linux-x64/
cp node_modules/leveldown/prebuilds/darwin-x64/$NODE_ABI.node builds/cabal-$VERSION-macos-x64/
cp node_modules/leveldown/prebuilds/win32-x64/$NODE_ABI.node builds/cabal-$VERSION-win-x64/
cp LICENSE builds/cabal-$VERSION-linux-x64/
cp LICENSE builds/cabal-$VERSION-macos-x64/
cp LICENSE builds/cabal-$VERSION-win-x64/
cp README.md builds/cabal-$VERSION-linux-x64/README
cp README.md builds/cabal-$VERSION-macos-x64/README
cp README.md builds/cabal-$VERSION-win-x64/README
cd builds
../node_modules/.bin/cross-zip cabal-$VERSION-linux-x64 ../dist/cabal-$VERSION-linux-x64.zip
../node_modules/.bin/cross-zip cabal-$VERSION-macos-x64 ../dist/cabal-$VERSION-macos-x64.zip
../node_modules/.bin/cross-zip cabal-$VERSION-win-x64 ../dist/cabal-$VERSION-win-x64.zip
rm -rf builds
# now travis will upload the 3 zips in dist to the release