build: update build scripts

This commit is contained in:
leo 2024-07-26 11:43:59 +08:00
parent 5f02f95e62
commit 17b0d7ddcb
No known key found for this signature in database
5 changed files with 16 additions and 11 deletions

View file

@ -22,7 +22,7 @@ jobs:
- name: Build - name: Build
run: dotnet build -c Release run: dotnet build -c Release
- name: Publish - name: Publish
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r win-x64 -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained run: dotnet publish src/SourceGit.csproj -c Release -o publish -r win-x64
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
@ -43,7 +43,7 @@ jobs:
- name: Build - name: Build
run: dotnet build -c Release run: dotnet build -c Release
- name: Publish - name: Publish
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r osx-x64 -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained run: dotnet publish src/SourceGit.csproj -c Release -o publish -r osx-x64
- name: Packing Program - name: Packing Program
run: tar -cvf sourcegit.osx-x64.tar -C publish/ . run: tar -cvf sourcegit.osx-x64.tar -C publish/ .
- name: Upload Artifact - name: Upload Artifact
@ -66,7 +66,7 @@ jobs:
- name: Build - name: Build
run: dotnet build -c Release run: dotnet build -c Release
- name: Publish - name: Publish
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r osx-arm64 -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained run: dotnet publish src/SourceGit.csproj -c Release -o publish -r osx-arm64
- name: Packing Program - name: Packing Program
run: tar -cvf sourcegit.osx-arm64.tar -C publish/ . run: tar -cvf sourcegit.osx-arm64.tar -C publish/ .
- name: Upload Artifact - name: Upload Artifact
@ -89,7 +89,7 @@ jobs:
- name: Build - name: Build
run: dotnet build -c Release run: dotnet build -c Release
- name: Publish - name: Publish
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r linux-x64 -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained run: dotnet publish src/SourceGit.csproj -c Release -o publish -r linux-x64
- name: Rename Executable File - name: Rename Executable File
run: mv publish/SourceGit publish/sourcegit run: mv publish/SourceGit publish/sourcegit
- name: Packing Program - name: Packing Program

View file

@ -9,13 +9,13 @@ cp resources/app/App.icns SourceGit.app/Contents/Resources/App.icns
sed "s/SOURCE_GIT_VERSION/${version}/g" resources/app/App.plist > SourceGit.app/Contents/Info.plist sed "s/SOURCE_GIT_VERSION/${version}/g" resources/app/App.plist > SourceGit.app/Contents/Info.plist
mkdir -p SourceGit.app/Contents/MacOS 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 dotnet publish ../src/SourceGit.csproj -c Release -r osx-arm64 -o SourceGit.app/Contents/MacOS
zip sourcegit_${version}.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 rm -rf SourceGit.app/Contents/MacOS
mkdir -p 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 dotnet publish ../src/SourceGit.csproj -c Release -r osx-x64 -o SourceGit.app/Contents/MacOS
zip sourcegit_${version}.osx-x64.zip -r SourceGit.app -x "*/*\.dsym/*" zip sourcegit_${version}.osx-x64.zip -r SourceGit.app -x "*/*\.dsym/*"
rm -rf SourceGit.app rm -rf SourceGit.app

View file

@ -6,7 +6,7 @@ if (Test-Path SourceGit) {
Remove-Item *.zip -Force Remove-Item *.zip -Force
dotnet publish ..\src\SourceGit.csproj -c Release -r win-arm64 -o SourceGit -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained dotnet publish ..\src\SourceGit.csproj -c Release -r win-arm64 -o SourceGit
Remove-Item SourceGit\*.pdb -Force Remove-Item SourceGit\*.pdb -Force
@ -16,7 +16,7 @@ if (Test-Path SourceGit) {
Remove-Item SourceGit -Recurse -Force Remove-Item SourceGit -Recurse -Force
} }
dotnet publish ..\src\SourceGit.csproj -c Release -r win-x64 -o SourceGit -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained dotnet publish ..\src\SourceGit.csproj -c Release -r win-x64 -o SourceGit
Remove-Item SourceGit\*.pdb -Force Remove-Item SourceGit\*.pdb -Force

View file

@ -82,7 +82,7 @@ DOTNET_PROJECT_PATH="../../../src/SourceGit.csproj"
# Additional useful arguments include: # Additional useful arguments include:
# "-p:DebugType=None -p:DebugSymbols=false -p:PublishSingleFile=true -p:PublishTrimmed=true -p:TrimMode=link" # "-p:DebugType=None -p:DebugSymbols=false -p:PublishSingleFile=true -p:PublishTrimmed=true -p:TrimMode=link"
# Refer: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish # Refer: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish
DOTNET_PUBLISH_ARGS="-c Release -p:DebugType=None -p:DebugSymbols=false -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained" DOTNET_PUBLISH_ARGS="-c Release -p:DebugType=None -p:DebugSymbols=false"
######################################## ########################################
@ -137,4 +137,4 @@ PKG_APPIMAGE_SUFFIX=".AppImage"
APPIMAGETOOL_COMMAND="appimagetool" APPIMAGETOOL_COMMAND="appimagetool"
# Internal use only. Used for compatibility between conf and script. Do not modify. # Internal use only. Used for compatibility between conf and script. Do not modify.
CONF_IMPL_VERSION=1 CONF_IMPL_VERSION=1

View file

@ -9,7 +9,12 @@
<BuiltInComInteropSupport>false</BuiltInComInteropSupport> <BuiltInComInteropSupport>false</BuiltInComInteropSupport>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault> <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings> <SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
<PublishAot>true</PublishAot>
<PublishTrimmed>true</PublishTrimmed>
<TrimMode>link</TrimMode>
<OptimizationPreference>Size</OptimizationPreference>
<Product>SourceGit</Product> <Product>SourceGit</Product>
<Description>OpenSource GIT client</Description> <Description>OpenSource GIT client</Description>
<Company>sourcegit-scm</Company> <Company>sourcegit-scm</Company>