-
Notifications
You must be signed in to change notification settings - Fork 29
/
pack.sh
executable file
·127 lines (105 loc) · 3.33 KB
/
pack.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
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
119
120
121
122
123
124
125
#!/bin/bash
# usage:
# pack.sh linux-x64
# pack.sh osx-x64
# pack.sh linux-arm64
# pack.sh osx.11.0-arm64
mkdir -p publish
rm -rf bin
rm -ir publish/*
PKG_TFM=$1
VERSION=$(git describe)
VERSION=${VERSION:1}
PKG_ROOT="bin/Release/net6.0/$PKG_TFM/publish"
dotnet publish -f net6.0 -c Release --self-contained -r $PKG_TFM fvim.fsproj
function pack-linux-x64()
{
rm -f ./{*.deb,*.rpm}
pushd $PKG_ROOT
cd ..
mv publish fvim
mkdir -p publish/usr/share
mkdir -p publish/usr/share/applications
mkdir -p publish/usr/share/icons/hicolor/48x48/apps/
mkdir -p publish/usr/bin
mv fvim publish/usr/share/
popd
cp lib/fvim-linux-launcher $PKG_ROOT/usr/bin/fvim
cp Assets/fvim.png $PKG_ROOT/usr/share/icons/hicolor/48x48/apps/fvim.png
cp lib/fvim.desktop $PKG_ROOT/usr/share/applications/fvim.desktop
chmod +x $PKG_ROOT/usr/share/fvim/FVim
chmod +x $PKG_ROOT/usr/bin/fvim
fpm -s dir -t deb -n fvim -v $VERSION -C $PKG_ROOT
fpm -s dir -t rpm -n fvim -v $VERSION -C $PKG_ROOT
mv {*.deb,*.rpm} publish/
# also drop version to build pipeline
git describe > publish/version
}
function pack-linux-arm64()
{
rm -f ./{*.deb,*.rpm}
pushd $PKG_ROOT
cd ..
mv publish fvim
mkdir -p publish/usr/share
mkdir -p publish/usr/share/applications
mkdir -p publish/usr/share/icons/hicolor/48x48/apps/
mkdir -p publish/usr/bin
mv fvim publish/usr/share/
popd
cp lib/fvim-linux-launcher $PKG_ROOT/usr/bin/fvim
cp Assets/fvim.png $PKG_ROOT/usr/share/icons/hicolor/48x48/apps/fvim.png
cp lib/fvim.desktop $PKG_ROOT/usr/share/applications/fvim.desktop
chmod +x $PKG_ROOT/usr/share/fvim/FVim
chmod +x $PKG_ROOT/usr/bin/fvim
fpm -a arm64 -s dir -t deb -n fvim -v $VERSION -C $PKG_ROOT
fpm -a arm64 -s dir -t rpm -n fvim -v $VERSION -C $PKG_ROOT
mv {*.deb,*.rpm} publish/
}
function pack-osx.11.0-arm64()
{
rm -rf ./*.app
rm -f ./*.zip
pushd $PKG_ROOT
cd ..
mv publish fvim_pkg
mkdir -p publish/Contents/
mv fvim_pkg publish/Contents/MacOS
mkdir -p publish/Contents/Resources/
popd
cp lib/fvim-osx-launcher $PKG_ROOT/Contents/MacOS/fvim-osx-launcher
cp images/icon.icns $PKG_ROOT/Contents/Resources/fvim.icns
cp lib/Info.plist $PKG_ROOT/Contents/Info.plist
cp icons-icns/* $PKG_ROOT/Contents/Resources/
rm -rf $PKG_ROOT/Contents/MacOS/icons
chmod +x $PKG_ROOT/Contents/MacOS/FVim
chmod +x $PKG_ROOT/Contents/MacOS/fvim-osx-launcher
mv $PKG_ROOT FVim.app
zip -r FVim.$VERSION.zip FVim.app
rm -rf FVim.app
mv FVim.$VERSION.zip publish/
}
function pack-osx-x64()
{
rm -rf ./*.app
rm -f ./*.zip
pushd $PKG_ROOT
cd ..
mv publish fvim_pkg
mkdir -p publish/Contents/
mv fvim_pkg publish/Contents/MacOS
mkdir -p publish/Contents/Resources/
popd
cp lib/fvim-osx-launcher $PKG_ROOT/Contents/MacOS/fvim-osx-launcher
cp images/icon.icns $PKG_ROOT/Contents/Resources/fvim.icns
cp lib/Info.plist $PKG_ROOT/Contents/Info.plist
cp icons-icns/* $PKG_ROOT/Contents/Resources/
rm -rf $PKG_ROOT/Contents/MacOS/icons
chmod +x $PKG_ROOT/Contents/MacOS/FVim
chmod +x $PKG_ROOT/Contents/MacOS/fvim-osx-launcher
mv $PKG_ROOT FVim.app
zip -r FVim.$VERSION.zip FVim.app
rm -rf FVim.app
mv FVim.$VERSION.zip publish/
}
pack-$PKG_TFM