Skip to content

Commit

Permalink
test build
Browse files Browse the repository at this point in the history
  • Loading branch information
yatima1460 committed May 15, 2024
1 parent 8a29537 commit d453626
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@ jobs:
dotnet-version: 8.0.x

- name: Build win-x64
run: dotnet publish WinForms\WinForms.csproj /p:Configuration=Release /p:Platform=x64 /p:SelfContained=true /p:PublishSingleFile=true /p:PublishReadyToRun=true /p:TargetFramework=net8.0-windows /p:RuntimeIdentifier=win-x64 /p:PublishDir=Drill_win-x64

- name: Zip win-x64
run: 7z a Drill_win-x64.zip WinForms\Drill_win-x64\*
run: Build_-win-x64.bat
shell: cmd

- name: Upload win-x64
uses: actions/upload-artifact@v4
with:
name: Drill_win-x64
path: Drill_win-x64.zip
path: bin\Drill_win-x64.exe
if-no-files-found: error

- name: Create a Release
Expand All @@ -45,7 +43,7 @@ jobs:
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
files: Drill_win-x64.zip
files: bin\Drill_win-x64.exe


#- name: Build MAUI
Expand Down
28 changes: 28 additions & 0 deletions Build_win-x64.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@echo off

dotnet clean -maxCpuCount WinForms\WinForms.csproj
if %ERRORLEVEL% neq 0 (
echo Cleaning failed with error code %ERRORLEVEL%.
exit /b %ERRORLEVEL%
)

dotnet publish -maxCpuCount WinForms\WinForms.csproj /p:DebugType=None /p:DebugSymbols=False /p:Configuration=Release /p:Platform=x64 /p:EnableCompressionInSingleFile=true /p:CopyOutputSymbolsToPublishDirectory=false /p:IncludeNativeLibrariesForSelfExtract=true /p:PublishTrimmed=false /p:SelfContained=true /p:PublishSingleFile=true /p:PublishReadyToRun=true /p:TargetFramework=net8.0-windows /p:RuntimeIdentifier=win-x64 /p:PublishDir=%CD%\bin
if %ERRORLEVEL% neq 0 (
echo Publishing failed with error code %ERRORLEVEL%.
exit /b %ERRORLEVEL%
)

move bin\Drill.exe bin\Drill_win-x64.exe
if %ERRORLEVEL% neq 0 (
echo Moving file failed with error code %ERRORLEVEL%.
exit /b %ERRORLEVEL%
)

dir bin\Drill_win-x64.exe
if %ERRORLEVEL% neq 0 (
echo Directory listing failed with error code %ERRORLEVEL%.
exit /b %ERRORLEVEL%
)

echo Script completed successfully.
exit /b 0

0 comments on commit d453626

Please sign in to comment.