Fix build scripts

This commit is contained in:
Caelan Sayler
2021-08-12 15:36:36 +01:00
parent 544f95535e
commit c824f2f380
8 changed files with 44 additions and 145 deletions

View File

@@ -1,29 +0,0 @@
---
name: Bug report
about: Feedback to help us improve the project
title: ''
labels: ''
assignees: ''
---
**Squirrel version(s)**
_Which version(s) of the project are you using?_
**Description**
_Replace this text with a short description of the problem_
**Steps to recreate**
1. Replace this
2. text with
3. the steps
4. to recreate
**Expected behavior**
_Explain what it's doing and why it's wrong_
**Actual behavior**
_Explain what it should be doing after it's fixed_
**Additional information**
_Add any other context about the problem here_

Binary file not shown.

View File

@@ -1,57 +0,0 @@
pool:
name: Hosted VS2017
demands:
- msbuild
- visualstudio
- vstest
trigger:
- master
- develop
variables:
solution: 'Squirrel.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- checkout: self
submodules: true
- task: NuGetToolInstaller@1
inputs:
versionSpec: 4.9.4
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
testAssemblyVer2: |
**\$(buildConfiguration)\*test*.dll
!**\obj\**
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: PublishSymbols@2
inputs:
SearchPattern: '**\bin\**\*.pdb'
PublishSymbols: false
continueOnError: true
- task: CopyFiles@2
inputs:
SourceFolder: '$(system.defaultWorkingDirectory)'
Contents: '**\bin\$(buildConfiguration)\**'
TargetFolder: '$(build.artifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(build.artifactStagingDirectory)'

1
build.cmd Normal file
View File

@@ -0,0 +1 @@
powershell -ExecutionPolicy Bypass -File ./build.ps1

35
build.ps1 Normal file
View File

@@ -0,0 +1,35 @@
# Stop the script if an error occurs
$ErrorActionPreference = "Stop"
$In = ".\build\Release\"
$Out = ".\build\publish\"
$Folders = @("./build", "./packages", "./test/bin", "./test/obj")
# Ensure a clean state by removing build/package folders
foreach ($Folder in $Folders) {
if (Test-Path $Folder) {
Remove-Item -path $Folder -Recurse -Force
}
}
# Build Squirrel C++ and library files
msbuild /restore /p:Configuration=Release
# Build single-exe packaged projects
dotnet publish -c Release src\Update\Update.csproj -o $Out
dotnet publish -c Release src\SyncReleases\SyncReleases.csproj -o $Out
# Copy over all files we need
# Copy-Item "$In\net45\Update.exe" -Destination "$Out\Squirrel.exe"
# Copy-Item "$In\net45\update.com" -Destination "$Out\Squirrel.com"
# Copy-Item "$In\net45\Update.pdb" -Destination "$Out\Squirrel.pdb"
Copy-Item "$In\Win32\Setup.exe" -Destination $Out
Copy-Item "$In\Win32\Setup.pdb" -Destination $Out
# Copy-Item "$In\net45\Update-Mono.exe" -Destination "$Out\Squirrel-Mono.exe"
# Copy-Item "$In\net45\Update-Mono.pdb" -Destination "$Out\Squirrel-Mono.pdb"
Copy-Item "$In\Win32\StubExecutable.exe" -Destination $Out
# Copy-Item "$In\net45\SyncReleases.exe" -Destination $Out
# Copy-Item "$In\net45\SyncReleases.pdb" -Destination $Out
Copy-Item "$In\Win32\WriteZipToSetup.exe" -Destination $Out
Copy-Item "$In\Win32\WriteZipToSetup.pdb" -Destination $Out
Write-Output "Successfully copied files to './build/publish'"

View File

@@ -1,48 +0,0 @@
<#
Package script for electron-winstaller
The NPM package electron-winstaller allows developers to
build Windows installers for Electron apps using Squirrel
(https://github.com/electron/windows-installer)
This script copies the required files into a single folder
which can then be copied to the electron-winstaller/vendor folder
(either manually or in an automated way).
#>
# Stop the script if an error occurs
$ErrorActionPreference = "Stop"
$In = ".\build\Release\"
$Out = ".\build\electron-winstaller\"
$Folders = @("./build", "./packages", "./test/bin", "./test/obj")
# Ensure a clean state by removing build/package folders
foreach ($Folder in $Folders) {
if (Test-Path $Folder) {
Remove-Item -path $Folder -Recurse -Force
}
}
# Build Squirrel
git submodule update --init --recursive
.\.NuGet\NuGet.exe restore
msbuild /p:Configuration=Release
# Create the electron-winstaller folder
New-Item -Path $Out -ItemType "directory" | Out-Null
# Copy over all files we need
Copy-Item "$In\net45\Update.exe" -Destination "$Out\Squirrel.exe"
Copy-Item "$In\net45\update.com" -Destination "$Out\Squirrel.com"
Copy-Item "$In\net45\Update.pdb" -Destination "$Out\Squirrel.pdb"
Copy-Item "$In\Win32\Setup.exe" -Destination $Out
Copy-Item "$In\Win32\Setup.pdb" -Destination $Out
Copy-Item "$In\net45\Update-Mono.exe" -Destination "$Out\Squirrel-Mono.exe"
Copy-Item "$In\net45\Update-Mono.pdb" -Destination "$Out\Squirrel-Mono.pdb"
Copy-Item "$In\Win32\StubExecutable.exe" -Destination $Out
Copy-Item "$In\net45\SyncReleases.exe" -Destination $Out
Copy-Item "$In\net45\SyncReleases.pdb" -Destination $Out
Copy-Item "$In\Win32\WriteZipToSetup.exe" -Destination $Out
Copy-Item "$In\Win32\WriteZipToSetup.pdb" -Destination $Out
Write-Output "Successfully copied files for electron-winstaller to build/electron-winstaller."

View File

@@ -10,7 +10,7 @@
<OutputPath>$(BaseOutputPath)$(Configuration)\</OutputPath>
<LangVersion>9.0</LangVersion>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<Company>GitHub</Company>

View File

@@ -1,25 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net45</TargetFramework>
<TargetFramework>net48</TargetFramework>
<Description>Squirrel.Tests</Description>
<Title>Squirrel.Tests</Title>
<IsPackable>false</IsPackable>
<IsTest>true</IsTest>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\src\Squirrel\Squirrel.csproj" />
<ProjectReference Include="..\vendor\nuget\src\Core\Core.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="xunit" Version="2.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.0.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\Squirrel\Squirrel.csproj" />
</ItemGroup>
</Project>