diff --git a/.gitignore b/.gitignore index 1bebd70e..e60ba83d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,18 @@ -.idea -.vs -.vscode -bin -build -obj -*.user -.DS_Store -publish +# IDE / System +.idea +.vs +.vscode +.DS_Store + +# Output folders. +bin/ +obj/ +build/SourceGit/ +build/SourceGit.app/ + +# Files +*.user +SourceGit.win-x64.zip +SourceGit.linux-x64.tar.gz +SourceGit.osx-x64.zip +SourceGit.osx-arm64.zip diff --git a/README.md b/README.md index 237615cb..45a3569d 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ You can download the latest stable from [Releases](https://github.com/sourcegit- For **macOS** users: -* Download `SourceGit.macOS.zip` from Releases. -* Choose the app that fits your system's CPU architecture and copy it to Applications. `x64` for Intel and `arm64` for Apple Silicon. +* Download `SourceGit.osx-x64.zip` or `SourceGit.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`. * You may need to run `sudo xattr -cr /Applications/SourceGit.app` to make sure the software works. diff --git a/build/build.linux.sh b/build/build.linux.sh new file mode 100644 index 00000000..35dca61e --- /dev/null +++ b/build/build.linux.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +rm -rf SourceGit +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 SourceGit --exclude=en --exclude=zh --exclude="*.dbg" +rm -rf SourceGit diff --git a/build/build.osx.command b/build/build.osx.command new file mode 100644 index 00000000..66d7d7a8 --- /dev/null +++ b/build/build.osx.command @@ -0,0 +1,17 @@ +#!/bin/sh + +rm -rf SourceGit.app + +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 + +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 -x "*/en/*" -x "*/zh/*" -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-arm64.zip -r SourceGit -x "*/en/*" -x "*/zh/*" -x "*/*\.dsym/*" diff --git a/build/build.windows.bat b/build/build.windows.bat new file mode 100644 index 00000000..bde2185c --- /dev/null +++ b/build/build.windows.bat @@ -0,0 +1,5 @@ + +rmdir /S /Q SourceGit +dotnet publish ..\src\SourceGit.csproj -c Release -r win-x64 -o SourceGit -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained +resources\7z.exe a SourceGit.win-x64.zip SourceGit "-xr!en/" "-xr!zh/" "-xr!*.pdb" +rmdir /S /Q SourceGit \ No newline at end of file diff --git a/build/resources/7z.exe b/build/resources/7z.exe new file mode 100644 index 00000000..a739ca0f Binary files /dev/null and b/build/resources/7z.exe differ diff --git a/src/App.icns b/build/resources/App.icns similarity index 100% rename from src/App.icns rename to build/resources/App.icns diff --git a/src/App.plist b/build/resources/App.plist similarity index 96% rename from src/App.plist rename to build/resources/App.plist index e14fffca..d19a2116 100644 --- a/src/App.plist +++ b/build/resources/App.plist @@ -1,26 +1,26 @@ - - - - - CFBundleIconFile - App.icns - CFBundleIdentifier - com.sourcegit-scm.sourcegit - CFBundleName - SourceGit - CFBundleVersion - 8.4.0 - LSMinimumSystemVersion - 10.12 - CFBundleExecutable - SourceGit - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - APPL - CFBundleShortVersionString - 8.4 - NSHighResolutionCapable - - + + + + + CFBundleIconFile + App.icns + CFBundleIdentifier + com.sourcegit-scm.sourcegit + CFBundleName + SourceGit + CFBundleVersion + 8.4.0 + LSMinimumSystemVersion + 10.12 + CFBundleExecutable + SourceGit + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleShortVersionString + 8.4 + NSHighResolutionCapable + + \ No newline at end of file diff --git a/src/BuildLinux.sh b/src/BuildLinux.sh deleted file mode 100644 index e8cc4c7b..00000000 --- a/src/BuildLinux.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -dotnet publish -c Release -r linux-x64 -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained \ No newline at end of file diff --git a/src/BuildMacOS.command b/src/BuildMacOS.command deleted file mode 100644 index c8a028ea..00000000 --- a/src/BuildMacOS.command +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -dotnet publish -c Release -r osx-x64 -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained -dotnet publish -c Release -r osx-arm64 -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained - -rm -rf build - -mkdir -p build/SourceGit -mkdir -p build/SourceGit/x64/SourceGit.app/Contents/MacOS -mkdir -p build/SourceGit/arm64/SourceGit.app/Contents/MacOS -mkdir -p build/SourceGit/x64/SourceGit.app/Contents/Resources -mkdir -p build/SourceGit/arm64/SourceGit.app/Contents/Resources - -cp App.plist build/SourceGit/x64/SourceGit.app/Contents/Info.plist -cp App.plist build/SourceGit/arm64/SourceGit.app/Contents/Info.plist - -cp App.icns build/SourceGit/x64/SourceGit.app/Contents/Resources/App.icns -cp App.icns build/SourceGit/arm64/SourceGit.app/Contents/Resources/App.icns - -cp -r bin/Release/net8.0/osx-x64/publish/* build/SourceGit/x64/SourceGit.app/Contents/MacOS/ -cp -r bin/Release/net8.0/osx-arm64/publish/* build/SourceGit/arm64/SourceGit.app/Contents/MacOS/ - -rm -rf build/SourceGit/x64/SourceGit.app/Contents/MacOS/SourceGit.dsym -rm -rf build/SourceGit/arm64/SourceGit.app/Contents/MacOS/SourceGit.dsym - -cd build -zip SourceGit.macOS.zip -r SourceGit \ No newline at end of file diff --git a/src/BuildWindows.bat b/src/BuildWindows.bat deleted file mode 100644 index 8ec72502..00000000 --- a/src/BuildWindows.bat +++ /dev/null @@ -1 +0,0 @@ -dotnet publish -c Release -r win-x64 -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained \ No newline at end of file