Update build files

This commit is contained in:
de4dot 2019-09-25 20:20:56 +02:00
parent e90ebe36ff
commit 93d7525ac4
4 changed files with 83 additions and 23 deletions

View File

@ -1,5 +1,5 @@
name: GitHub CI name: GitHub CI
on: [push, pull_request] on: push
jobs: jobs:
build: build:
@ -9,7 +9,6 @@ jobs:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
with: with:
submodules: true submodules: true
fetch-depth: 1
- name: Install .NET Core - name: Install .NET Core
shell: pwsh shell: pwsh
@ -17,6 +16,7 @@ jobs:
Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -UseBasicParsing -OutFile "$env:temp\dotnet-install.ps1" Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -UseBasicParsing -OutFile "$env:temp\dotnet-install.ps1"
& $env:temp\dotnet-install.ps1 -Version 3.0.100 -InstallDir "$env:ProgramFiles\dotnet" -Architecture x64 & $env:temp\dotnet-install.ps1 -Version 3.0.100 -InstallDir "$env:ProgramFiles\dotnet" -Architecture x64
# build.cmd needs to use msbuild since dotnet build doesn't support COMReference: https://github.com/0xd4d/dnSpy/issues/1053
- name: Install VS build tools - name: Install VS build tools
shell: pwsh shell: pwsh
run: | run: |
@ -26,22 +26,64 @@ jobs:
& "$env:TEMP\vs_BuildTools.exe" --quiet --wait --norestart --installPath "C:\vsbuildtools" --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools --add Microsoft.VisualStudio.Workload.NetCoreBuildTools & "$env:TEMP\vs_BuildTools.exe" --quiet --wait --norestart --installPath "C:\vsbuildtools" --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools --add Microsoft.VisualStudio.Workload.NetCoreBuildTools
Wait-Process vs_BuildTools Wait-Process vs_BuildTools
- name: Build # Build each tfm separately since building all requires too much diskspace
- name: Build .NET Framework x86 + x64 files
shell: pwsh
run: | run: |
set path=C:\vsbuildtools\MSBuild\Current\Bin\amd64;%path% $env:Path = "C:\vsbuildtools\MSBuild\Current\Bin\amd64;%PATH%;" + $env:Path
build.cmd .\build.cmd net
New-Item -ItemType directory -Path "C:\builtfiles" -Force
Compress-Archive -Path "dnSpy\dnSpy\bin\Release\net472" -DestinationPath C:\builtfiles\dnSpy-net472.zip
.\clean-all.cmd
- name: Build .NET Core x86 files
shell: pwsh
run: |
$env:Path = "C:\vsbuildtools\MSBuild\Current\Bin\amd64;%PATH%;" + $env:Path
.\build.cmd corex86
New-Item -ItemType directory -Path "C:\builtfiles" -Force
Compress-Archive -Path "dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x86\publish" -DestinationPath C:\builtfiles\dnSpy-netcore-win32.zip
.\clean-all.cmd
- name: Build .NET Core x64 files
shell: pwsh
run: |
$env:Path = "C:\vsbuildtools\MSBuild\Current\Bin\amd64;%PATH%;" + $env:Path
.\build.cmd corex64
New-Item -ItemType directory -Path "C:\builtfiles" -Force
Compress-Archive -Path "dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x64\publish" -DestinationPath C:\builtfiles\dnSpy-netcore-win64.zip
.\clean-all.cmd
- uses: actions/upload-artifact@v1 - uses: actions/upload-artifact@v1
with: with:
name: dnSpy-net472 name: dnSpy-net472
path: dnSpy/dnSpy/bin/Release/net472 path: C:\builtfiles\dnSpy-net472.zip
- uses: actions/upload-artifact@v1 - uses: actions/upload-artifact@v1
with: with:
name: dnSpy-netcore-win32 name: dnSpy-netcore-win32
path: dnSpy/dnSpy/bin/Release/netcoreapp3.0/win-x86/publish path: C:\builtfiles\dnSpy-netcore-win32.zip
- uses: actions/upload-artifact@v1 - uses: actions/upload-artifact@v1
with: with:
name: dnSpy-netcore-win64 name: dnSpy-netcore-win64
path: dnSpy/dnSpy/bin/Release/netcoreapp3.0/win-x64/publish path: C:\builtfiles\dnSpy-netcore-win64.zip
# Create a new release: create a tag, then git push origin <tagname>, wait for it to build
- name: Release
uses: softprops/action-gh-release@b28d815 #@v1
with:
files: |
C:\builtfiles\dnSpy-net472.zip
C:\builtfiles\dnSpy-netcore-win32.zip
C:\builtfiles\dnSpy-netcore-win64.zip
body: |
`dnSpy-net472.zip` requires .NET Framework 4.7.2 or later.
`dnSpy-netcore-win32.zip` and `dnSpy-netcore-win64.zip` don't depend on .NET Framework, but use .NET Core instead which is included in the zip files. If `dnSpy.exe` fails to start, try:
- Install VC dependencies: https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads
- Windows 7: Must have KB2999226 and KB2533623 installed
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

View File

@ -11,7 +11,7 @@ install:
start /wait vs_BuildTools.exe --quiet --wait --norestart --installPath "C:\vsbuildtools" --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools --add Microsoft.VisualStudio.Workload.NetCoreBuildTools start /wait vs_BuildTools.exe --quiet --wait --norestart --installPath "C:\vsbuildtools" --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools --add Microsoft.VisualStudio.Workload.NetCoreBuildTools
build_script: build_script:
- cmd: | - cmd: |
set path=C:\vsbuildtools\MSBuild\Current\Bin\amd64;%path% set PATH=C:\vsbuildtools\MSBuild\Current\Bin\amd64;%PATH%
build.cmd build.cmd
test: off test: off
artifacts: artifacts:
@ -21,17 +21,3 @@ artifacts:
name: dnSpy-netcore-win32 name: dnSpy-netcore-win32
- path: dnSpy/dnSpy/bin/Release/netcoreapp3.0/win-x64/publish - path: dnSpy/dnSpy/bin/Release/netcoreapp3.0/win-x64/publish
name: dnSpy-netcore-win64 name: dnSpy-netcore-win64
deploy:
- provider: GitHub
description: New release
on:
APPVEYOR_REPO_TAG: true
auth_token:
secure: A8Xfg1Sr7/XmTlvOyNEBQVwMARF+uyigNNJXQYq4pQFaR3Z3x0iaXGZMLlvA0oTO
notifications:
- provider: Email
to:
- de4dot@gmail.com
on_build_success: false
on_build_failure: true
on_build_status_changed: false

View File

@ -14,6 +14,11 @@ REM ...add commands to patch apphost and move files to bin sub dir, see below...
REM dotnet publish -c Release -f netcoreapp3.0 -r win-x64 --self-contained REM dotnet publish -c Release -f netcoreapp3.0 -r win-x64 --self-contained
REM ...add commands to patch apphost and move files to bin sub dir, see below... REM ...add commands to patch apphost and move files to bin sub dir, see below...
msbuild -v:m -restore -t:Build -p:Configuration=Release -p:TargetFramework=net472 Build\AppHostPatcher\AppHostPatcher.csproj
if "%1"=="" set build_this=y
if "%1"=="net" set build_this=y
if not "%build_this%"=="y" goto :skip_netframework
echo Building .NET Framework x86 and x64 binaries echo Building .NET Framework x86 and x64 binaries
msbuild -v:m -restore -t:Build -p:Configuration=Release -p:TargetFramework=net472 || goto :error msbuild -v:m -restore -t:Build -p:Configuration=Release -p:TargetFramework=net472 || goto :error
REM move all files to a bin sub dir but keep the exe files REM move all files to a bin sub dir but keep the exe files
@ -29,7 +34,12 @@ move dnSpy\dnSpy\bin\Release\net472\bin\dnSpy.pdb dnSpy\dnSpy\bin\Release\net472
move dnSpy\dnSpy\bin\Release\net472\bin\dnSpy.Console.exe dnSpy\dnSpy\bin\Release\net472 || goto :error move dnSpy\dnSpy\bin\Release\net472\bin\dnSpy.Console.exe dnSpy\dnSpy\bin\Release\net472 || goto :error
move dnSpy\dnSpy\bin\Release\net472\bin\dnSpy.Console.exe.config dnSpy\dnSpy\bin\Release\net472 || goto :error move dnSpy\dnSpy\bin\Release\net472\bin\dnSpy.Console.exe.config dnSpy\dnSpy\bin\Release\net472 || goto :error
move dnSpy\dnSpy\bin\Release\net472\bin\dnSpy.Console.pdb dnSpy\dnSpy\bin\Release\net472 || goto :error move dnSpy\dnSpy\bin\Release\net472\bin\dnSpy.Console.pdb dnSpy\dnSpy\bin\Release\net472 || goto :error
:skip_netframework
set build_this=
if "%1"=="" set build_this=y
if "%1"=="corex86" set build_this=y
if not "%build_this%"=="y" goto :skip_corex86
echo Building .NET Core x86 binaries echo Building .NET Core x86 binaries
msbuild -v:m -restore -t:Publish -p:Configuration=Release -p:TargetFramework=netcoreapp3.0 -p:RuntimeIdentifier=win-x86 -p:SelfContained=True || goto :error msbuild -v:m -restore -t:Publish -p:Configuration=Release -p:TargetFramework=netcoreapp3.0 -p:RuntimeIdentifier=win-x86 -p:SelfContained=True || goto :error
REM move all files to a bin sub dir but keep the exe apphosts REM move all files to a bin sub dir but keep the exe apphosts
@ -41,7 +51,12 @@ move dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x86\publish\bin\dnSpy.exe dnSpy\d
move dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x86\publish\bin\dnSpy.Console.exe dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x86\publish || goto :error move dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x86\publish\bin\dnSpy.Console.exe dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x86\publish || goto :error
Build\AppHostPatcher\bin\Release\net472\AppHostPatcher.exe dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x86\publish\dnSpy.exe -d bin || goto :error Build\AppHostPatcher\bin\Release\net472\AppHostPatcher.exe dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x86\publish\dnSpy.exe -d bin || goto :error
Build\AppHostPatcher\bin\Release\net472\AppHostPatcher.exe dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x86\publish\dnSpy.Console.exe -d bin || goto :error Build\AppHostPatcher\bin\Release\net472\AppHostPatcher.exe dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x86\publish\dnSpy.Console.exe -d bin || goto :error
:skip_corex86
set build_this=
if "%1"=="" set build_this=y
if "%1"=="corex64" set build_this=y
if not "%build_this%"=="y" goto :corex64
echo Building .NET Core x64 binaries echo Building .NET Core x64 binaries
msbuild -v:m -restore -t:Publish -p:Configuration=Release -p:TargetFramework=netcoreapp3.0 -p:RuntimeIdentifier=win-x64 -p:SelfContained=True || goto :error msbuild -v:m -restore -t:Publish -p:Configuration=Release -p:TargetFramework=netcoreapp3.0 -p:RuntimeIdentifier=win-x64 -p:SelfContained=True || goto :error
REM move all files to a bin sub dir but keep the exe apphosts REM move all files to a bin sub dir but keep the exe apphosts
@ -53,6 +68,8 @@ move dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x64\publish\bin\dnSpy.exe dnSpy\d
move dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x64\publish\bin\dnSpy.Console.exe dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x64\publish || goto :error move dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x64\publish\bin\dnSpy.Console.exe dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x64\publish || goto :error
Build\AppHostPatcher\bin\Release\net472\AppHostPatcher.exe dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x64\publish\dnSpy.exe -d bin || goto :error Build\AppHostPatcher\bin\Release\net472\AppHostPatcher.exe dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x64\publish\dnSpy.exe -d bin || goto :error
Build\AppHostPatcher\bin\Release\net472\AppHostPatcher.exe dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x64\publish\dnSpy.Console.exe -d bin || goto :error Build\AppHostPatcher\bin\Release\net472\AppHostPatcher.exe dnSpy\dnSpy\bin\Release\netcoreapp3.0\win-x64\publish\dnSpy.Console.exe -d bin || goto :error
:corex64
set build_this=
goto :EOF goto :EOF

15
clean-all.cmd Normal file
View File

@ -0,0 +1,15 @@
@echo off
pushd Extensions\ILSpy.Decompiler\NRefactory && git clean -xdf && popd || goto :error
pushd Libraries\ICSharpCode.TreeView && git clean -xdf && popd || goto :error
pushd Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler && git clean -xdf && popd || goto :error
pushd dnSpy\dnSpy.Images && git clean -xdf && popd || goto :error
pushd Extensions\dnSpy.Debugger\netcorefiles && git clean -xdf && popd || goto :error
pushd dnSpy\Roslyn\Roslyn.ExpressionCompiler && git clean -xdf && popd || goto :error
pushd Extensions\dnSpy.Debugger\Mono.Debugger.Soft && git clean -xdf && popd || goto :error
git clean -xdf || goto :error
goto :EOF
:error
exit /b %errorlevel%