-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·72 lines (58 loc) · 2 KB
/
build.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
#!/bin/bash
if [ -z "$M" ]; then
echo "Missing message"
exit 1
fi
T="patch"
if [ "$T" != "major" ] && [ "$T" != "minor" ] && [ "$T" != "patch" ]; then
echo "Invalid type! Please use major, minor or patch"
exit 1
fi
skiptv=false
skipbuild=false
# Processa os argumentos passados para o script
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
--skip-tv)
# Se a flag --skip for passada, define a variável skip como true
skiptv=true
;;
*)
# Ignora argumentos desconhecidos (opcional)
;;
esac
case $key in
--skip-build)
# Se a flag --skip for passada, define a variável skip como true
skipbuild=true
;;
*)
# Ignora argumentos desconhecidos (opcional)
;;
esac
shift
done
if [ "$skiptv" != "true" ]; then
npx turnv tv -fp "./" "./release/app" -m "$M" -t "$T"
fi
if [ "$skipbuild" != "true" ]; then
export $(cat .env | xargs)
docker run --rm -it -v $(pwd)/:/app fictional npm run package:dev
fi
USERT=$(stat -c '%U' .)
chown -R "$USERT":"$USERT" ./release
sudo M="$M" -u "$USERT" bash -c '
projectVersion=$(npx turnv gv)
echo "projectVersion:" $projectVersion
releaseBuildFolder="./release/build/$projectVersion"
winExe="$releaseBuildFolder/Fictional Setup $projectVersion.exe"
outWinExe="$releaseBuildFolder/Fictional$projectVersion.exe"
outWinExeBlockmap="$releaseBuildFolder/Fictional Setup $projectVersion.exe.blockmap"
outLinuxAppImage="$releaseBuildFolder/Fictional-$projectVersion.AppImage"
outLatestLinux="$releaseBuildFolder/latest-linux.yml"
outLatest="$releaseBuildFolder/latest.yml"
osslsigncode sign -pkcs12 certificate.pfx -pass thisapparedream -n "Fictional" -i http://www.github.com/JPDovale -t http://timestamp.digicert.com -in "$winExe" -out "$outWinExe"
gh release create "$projectVersion" -t "$projectVersion" -n "$M" -d
gh release upload "$projectVersion" "$outWinExe" "$outWinExeBlockmap" "$outLinuxAppImage" "$outLatestLinux" "$outLatest"
'