1
+ #! /bin/bash
2
+
3
+ # example usage:
4
+ # ./deploy.sh 1.2.3
5
+
6
+ # 1. Get the version from the first command-line argument
7
+ if [ -z " $1 " ]; then
8
+ echo " Error: Please provide the version as the first argument."
9
+ exit 1
10
+ fi
11
+ version=" $1 "
12
+
13
+ echo " Building version $version "
14
+
15
+ # 2. Write the version to version.txt. This is purely to generate a commit on master for new version
16
+ echo " $version " > AvaGui/version.txt
17
+
18
+ # 3. Make a release commit
19
+ git add AvaGui/version.txt
20
+ git commit -m " prepare $version "
21
+ git push
22
+
23
+ # # 4. Make a tag
24
+ git tag -a " $version " -m " tag $version "
25
+ git push --tags
26
+
27
+ # # 5. Build the project for different platforms
28
+ echo " Building"
29
+ dotnet publish AvaGui/AvaGui.csproj -c Release -p:PublishSingleFile=true -p:Version=$version --self-contained --runtime win-x64
30
+ dotnet publish AvaGui/AvaGui.csproj -c Release -p:PublishSingleFile=true -p:Version=$version --self-contained --runtime linux-x64
31
+ dotnet publish AvaGui/AvaGui.csproj -c Release -p:PublishSingleFile=true -p:Version=$version --self-contained --runtime osx-x64
32
+
33
+ # 6. Create the ZIP and tar archives
34
+ echo " Zipping"
35
+
36
+ pushd " AvaGui/bin/Release/net8.0/"
37
+
38
+ pushd " win-x64/publish"
39
+ zip -r " object-editor-$version -win-x64.zip" .
40
+ mv " object-editor-$version -win-x64.zip" ../..
41
+ popd
42
+
43
+ pushd " linux-x64/publish"
44
+ chmod +x " ./ObjectEditor"
45
+ tar -jcvf " object-editor-$version -linux-x64.tar" .
46
+ mv " object-editor-$version -linux-x64.tar" ../..
47
+ popd
48
+
49
+ pushd " osx-x64/publish"
50
+ chmod +x " ./ObjectEditor"
51
+ tar -jcvf " object-editor-$version -osx-x64.tar" .
52
+ mv " object-editor-$version -osx-x64.tar" ../..
53
+ popd
54
+
55
+ popd
56
+ echo " Build and packaging complete!"
0 commit comments