Skip to content

Commit 7435e5f

Browse files
committed
add deployment script
1 parent 92ee093 commit 7435e5f

File tree

5 files changed

+67
-21
lines changed

5 files changed

+67
-21
lines changed

AvaGui/AvaGui.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@
1010
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1111
<PackageReadmeFile>README.md</PackageReadmeFile>
1212
<RepositoryUrl>https://github.com/OpenLoco/OpenLocoObjectEditor</RepositoryUrl>
13-
<AssemblyVersion>2.3.0</AssemblyVersion>
14-
<FileVersion>$(AssemblyVersion)</FileVersion>
13+
<AssemblyVersion>$(Version)</AssemblyVersion>
14+
<FileVersion>$(Version)</FileVersion>
1515
<AssemblyName>ObjectEditor</AssemblyName>
16-
<Product>$(AssemblyName) $(AssemblyVersion)</Product>
17-
<Version>$(AssemblyVersion)</Version>
16+
<Product>$(AssemblyName) $(Version)</Product>
1817
<Authors>LeftofZen</Authors>
1918
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
2019
</PropertyGroup>

AvaGui/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.0
1+
2.3.0

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,10 @@ A modern implementation of 'LocoTool' for Locomotion `dat` file parsing and edit
102102
- [x] Use a proper C# image library for image creation instead of WinForms
103103

104104
...many more things
105+
106+
# Building
107+
- Open AvaGui/AvaGui.sln in Visual Studio
108+
- You'll need the `Avalonia for Visual Studio` plugin to use the visual XAML previewer
109+
110+
# Deploying
111+
See `deploy.sh`

deploy.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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!"

release-procedure.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)