diff --git a/README.md b/README.md
index 1f54eaaf..0954b6d0 100644
--- a/README.md
+++ b/README.md
@@ -37,11 +37,11 @@ You can download the latest stable from [Releases](https://github.com/sourcegit-
For **Windows** users:
* **MSYS Git is NOT supported**. Please use official [Git for Windows](https://git-scm.com/download/win) instead.
-* `Source.win-x64.zip` may be reported as virus by Windows Defender. I don't know why. I have manually tested the zip to be uploaded using Windows Defender before uploading and no virus was found. If you have installed .NET 8 SDK locally, I suggest you to compile it yourself. And if you have any idea about how to fix this, please open an issue.
+* `sourcegit_x.y.win-x64.zip` may be reported as virus by Windows Defender. I don't know why. I have manually tested the zip to be uploaded using Windows Defender before uploading and no virus was found. If you have installed .NET 8 SDK locally, I suggest you to compile it yourself. And if you have any idea about how to fix this, please open an issue.
For **macOS** users:
-* Download `SourceGit.osx-x64.zip` or `SourceGit.osx-arm64.zip` from Releases. `x64` for Intel and `arm64` for Apple Silicon.
+* Download `sourcegit_x.y.osx-x64.zip` or `sourcegit_x.y.osx-arm64.zip` from Releases. `x64` for Intel and `arm64` for Apple Silicon.
* Move `SourceGit.app` to `Applications` folder.
* Make sure your mac trusts all software from anywhere. For more information, search `spctl --master-disable`.
* Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your mac.
diff --git a/build/VERSION b/build/VERSION
new file mode 100644
index 00000000..83ea3179
--- /dev/null
+++ b/build/VERSION
@@ -0,0 +1 @@
+8.8
\ No newline at end of file
diff --git a/build/build.deb.sh b/build/build.deb.sh
deleted file mode 100644
index 727950af..00000000
--- a/build/build.deb.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-rm -rf SourceGit resources/deb/opt *.deb
-dotnet publish ../src/SourceGit.csproj -c Release -r linux-x64 -o SourceGit -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
-
-mkdir -p resources/deb/opt/sourcegit
-mv SourceGit/SourceGit resources/deb/opt/sourcegit/sourcegit
-mv SourceGit/*.so resources/deb/opt/sourcegit/
-
-chmod -R 755 resources/deb
-
-rm -rf SourceGit
-
-sudo dpkg-deb --build resources/deb ./sourcegit_8.8_amd64.deb
diff --git a/build/build.linux.sh b/build/build.linux.sh
index d2c2b6d4..b5dd854b 100644
--- a/build/build.linux.sh
+++ b/build/build.linux.sh
@@ -1,6 +1,31 @@
#!/bin/sh
-rm -rf SourceGit SourceGit.linux-x64.tar.gz
+version=`cat ./VERSION`
+
+# Cleanup
+rm -rf SourceGit *.tar.gz resources/deb/opt *.deb *.rpm
+
+# Compile
dotnet publish ../src/SourceGit.csproj -c Release -r linux-x64 -o SourceGit -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
-tar -zcvf SourceGit.linux-x64.tar.gz --exclude="*/*.dbg" SourceGit
-rm -rf SourceGit
+mv SourceGit/SourceGit SourceGit/sourcegit
+rm -f SourceGit/*.dbg
+
+# General Linux archive
+tar -zcvf sourcegit_${version}.linux-x64.tar.gz SourceGit
+
+# Debain/Ubuntu package
+mkdir -p resources/deb/opt/sourcegit/
+mkdir -p resources/deb/usr/bin
+mkdir -p resources/deb/usr/share/applications
+mkdir -p resources/deb/usr/share/icons
+cp -f SourceGit/* resources/deb/opt/sourcegit/
+cp -r resources/_common/usr resources/deb/
+chmod -R 755 resources/deb
+sed -i "2s/.*/Version: ${version}/g" resources/deb/DEBIAN/control
+dpkg-deb --build resources/deb ./sourcegit_${version}-1_amd64.deb
+
+# Redhat/CentOS/Fedora package
+rpmbuild -bb --target=x86_64 resources/rpm/SPECS/build.spec --define "_topdir `pwd`/resources/rpm" --define "_version ${version}"
+mv resources/rpm/RPMS/x86_64/sourcegit-${version}-1.x86_64.rpm .
+
+rm -rf SourceGit
\ No newline at end of file
diff --git a/build/build.osx.command b/build/build.osx.command
index 2d4127c1..5e5beb70 100644
--- a/build/build.osx.command
+++ b/build/build.osx.command
@@ -1,17 +1,22 @@
#!/bin/sh
-rm -rf SourceGit.app
+version=`cat ./VERSION`
+
+rm -rf SourceGit.app *.zip
mkdir -p SourceGit.app/Contents/Resources
-cp resources/App.plist SourceGit.app/Contents/Info.plist
-cp resources/App.icns SourceGit.app/Contents/Resources/App.icns
+cp resources/app/App.plist SourceGit.app/Contents/Info.plist
+cp resources/app/App.icns SourceGit.app/Contents/Resources/App.icns
+sed -i "s/SOURCE_GIT_VERSION/${version}/g" SourceGit.app/Contents/Info.plist
mkdir -p SourceGit.app/Contents/MacOS
dotnet publish ../src/SourceGit.csproj -c Release -r osx-arm64 -o SourceGit.app/Contents/MacOS -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
-zip SourceGit.osx-arm64.zip -r SourceGit.app -x "*/*\.dsym/*"
+zip sourcegit_${version}.osx-arm64.zip -r SourceGit.app -x "*/*\.dsym/*"
rm -rf SourceGit.app/Contents/MacOS
mkdir -p SourceGit.app/Contents/MacOS
dotnet publish ../src/SourceGit.csproj -c Release -r osx-x64 -o SourceGit.app/Contents/MacOS -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
-zip SourceGit.osx-x64.zip -r SourceGit.app -x "*/*\.dsym/*"
+zip sourcegit_${version}.osx-x64.zip -r SourceGit.app -x "*/*\.dsym/*"
+
+rm -rf SourceGit.app
\ No newline at end of file
diff --git a/build/build.windows.ps1 b/build/build.windows.ps1
index e18e58e8..ddca1e1e 100644
--- a/build/build.windows.ps1
+++ b/build/build.windows.ps1
@@ -1,13 +1,13 @@
+$version = Get-Content .\VERSION
+
if (Test-Path SourceGit) {
Remove-Item SourceGit -Recurse -Force
}
-if (Test-Path SourceGit.win-x64.zip) {
- Remove-Item SourceGit.win-x64.zip -Force
-}
+Remove-Item *.zip -Force
dotnet publish ..\src\SourceGit.csproj -c Release -r win-x64 -o SourceGit -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
Remove-Item SourceGit\*.pdb -Force
-Compress-Archive -Path SourceGit -DestinationPath SourceGit.win-x64.zip
+Compress-Archive -Path SourceGit -DestinationPath "sourcegit_$version.win-x64.zip"
diff --git a/build/resources/deb/usr/share/applications/sourcegit.desktop b/build/resources/_common/usr/share/applications/sourcegit.desktop
similarity index 100%
rename from build/resources/deb/usr/share/applications/sourcegit.desktop
rename to build/resources/_common/usr/share/applications/sourcegit.desktop
diff --git a/build/resources/deb/usr/share/icons/sourcegit.png b/build/resources/_common/usr/share/icons/sourcegit.png
similarity index 100%
rename from build/resources/deb/usr/share/icons/sourcegit.png
rename to build/resources/_common/usr/share/icons/sourcegit.png
diff --git a/build/resources/App.icns b/build/resources/app/App.icns
similarity index 100%
rename from build/resources/App.icns
rename to build/resources/app/App.icns
diff --git a/build/resources/App.plist b/build/resources/app/App.plist
similarity index 90%
rename from build/resources/App.plist
rename to build/resources/app/App.plist
index 3327c5d8..01d93ad7 100644
--- a/build/resources/App.plist
+++ b/build/resources/app/App.plist
@@ -1,26 +1,26 @@
-
-
-
-
- CFBundleIconFile
- App.icns
- CFBundleIdentifier
- com.sourcegit-scm.sourcegit
- CFBundleName
- SourceGit
- CFBundleVersion
- 8.8.0
- LSMinimumSystemVersion
- 10.12
- CFBundleExecutable
- SourceGit
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundlePackageType
- APPL
- CFBundleShortVersionString
- 8.8
- NSHighResolutionCapable
-
-
-
+
+
+
+
+ CFBundleIconFile
+ App.icns
+ CFBundleIdentifier
+ com.sourcegit-scm.sourcegit
+ CFBundleName
+ SourceGit
+ CFBundleVersion
+ SOURCE_GIT_VERSION.0
+ LSMinimumSystemVersion
+ 10.12
+ CFBundleExecutable
+ SourceGit
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ SOURCE_GIT_VERSION
+ NSHighResolutionCapable
+
+
+
diff --git a/build/resources/rpm/SPECS/build.spec b/build/resources/rpm/SPECS/build.spec
new file mode 100644
index 00000000..2e6875a6
--- /dev/null
+++ b/build/resources/rpm/SPECS/build.spec
@@ -0,0 +1,31 @@
+Name: sourcegit
+Version: %_version
+Release: 1
+Summary: Open-source & Free Git Gui Client
+License: MIT
+URL: https://sourcegit-scm.github.io/
+Source: https://github.com/sourcegit-scm/sourcegit/archive/refs/tags/v%_version.tar.gz
+Requires: libX11.so.6
+Requires: libSM.so.6
+
+%define _build_id_links none
+
+%description
+Open-source & Free Git Gui Client
+
+%install
+mkdir -p $RPM_BUILD_ROOT/opt/sourcegit
+mkdir -p $RPM_BUILD_ROOT/usr/bin
+mkdir -p $RPM_BUILD_ROOT/usr/share/applications
+mkdir -p $RPM_BUILD_ROOT/usr/share/icons
+cp -r ../../_common/usr $RPM_BUILD_ROOT/
+cp -f ../../../SourceGit/* $RPM_BUILD_ROOT/opt/sourcegit/
+chmod 755 -R $RPM_BUILD_ROOT
+
+%files
+/opt
+/usr/bin
+/usr/share
+
+%changelog
+# skip
\ No newline at end of file