-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·60 lines (47 loc) · 2.02 KB
/
Copy pathrelease.sh
File metadata and controls
executable file
·60 lines (47 loc) · 2.02 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
# Copyright 2024 jdswardson
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#!/bin/bash
# Set the installation directory
PACKAGE_DIR_OSX="./bin/Release/net7.0/osx-x64/publish"
PACKAGE_DIR_WIN="./bin/Release/net7.0/win-x64/publish"
PACKAGE_DIR_LIN="./bin/Release/net7.0/linux-x64/publish"
INSTALLER_DIR="../Installer/build/"
# Prompt the user to enter a version name
echo -n "Enter a version name: "
read version_name
# Write the version name to version.txt
echo $version_name > $INSTALLER_DIR/version.txt ;
# Update the version in the .csproj file
sed -i '' "s/<Version>.*<\/Version>/<Version>$version_name<\/Version>/" loki.csproj
dotnet publish -c Release -r osx-x64 --self-contained ;
dotnet publish -c Release -r win-x64 --self-contained ;
dotnet publish -c Release -r linux-x64 --self-contained ;
echo "Removing existing builds"
rm -r $INSTALLER_DIR/osx ;
rm -r $INSTALLER_DIR/win ;
rm -r $INSTALLER_DIR/linux ;
echo "\tSuccessfully removed existing builds"
echo "Copying builds to installer directory"
cp -r $PACKAGE_DIR_OSX $INSTALLER_DIR/osx ;
cp -r $PACKAGE_DIR_WIN $INSTALLER_DIR/win ;
cp -r $PACKAGE_DIR_LIN $INSTALLER_DIR/linux ;
echo "\tSuccessfully Copied builds to installer directory"
echo "Renaming executable binaries to loki"
mv $INSTALLER_DIR/osx/Compiler $INSTALLER_DIR/osx/loki ;
mv $INSTALLER_DIR/win/Compiler.exe $INSTALLER_DIR/win/loki.exe ;
mv $INSTALLER_DIR/linux/Compiler $INSTALLER_DIR/linux/loki ;
echo "\tSuccessfully renamed executable binaries to loki"
# rm -r "./bin" ;
# rm -r "./obj" ;
echo "\nReleased Succesfully" ;