mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Merge pull request #140 from Thealexbarney/build-ver-fix
Fix a logic error in the build script loader and update MyGet publishing
This commit is contained in:
commit
13648b4cec
4 changed files with 11 additions and 20 deletions
|
@ -1 +1 @@
|
||||||
3.1.200
|
3.1.300
|
20
build.ps1
20
build.ps1
|
@ -1,7 +1,5 @@
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param(
|
Param(
|
||||||
#[switch]$CustomParam,
|
|
||||||
[switch]$BuildDotnetCoreOnly,
|
|
||||||
[Parameter(Position = 0, Mandatory = $false, ValueFromRemainingArguments = $true)]
|
[Parameter(Position = 0, Mandatory = $false, ValueFromRemainingArguments = $true)]
|
||||||
[string[]]$BuildArguments
|
[string[]]$BuildArguments
|
||||||
)
|
)
|
||||||
|
@ -16,10 +14,10 @@ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
||||||
$BuildProjectFile = "$PSScriptRoot\build\_build.csproj"
|
$BuildProjectFile = "$PSScriptRoot\build\_build.csproj"
|
||||||
$TempDirectory = "$PSScriptRoot\\.tmp"
|
$TempDirectory = "$PSScriptRoot\.tmp"
|
||||||
|
|
||||||
$DotNetGlobalFile = "$PSScriptRoot\\global.json"
|
$DotNetGlobalFile = "$PSScriptRoot\global.json"
|
||||||
$DotNetInstallUrl = "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1"
|
$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1"
|
||||||
$DotNetChannel = "Current"
|
$DotNetChannel = "Current"
|
||||||
$DotNetCliVersion = Get-Content DotnetCliVersion.txt
|
$DotNetCliVersion = Get-Content DotnetCliVersion.txt
|
||||||
|
|
||||||
|
@ -53,12 +51,13 @@ try {
|
||||||
(!(Test-Path variable:DotNetVersion) -or $(& cmd.exe /c 'dotnet --version 2>&1') -eq $DotNetVersion)) {
|
(!(Test-Path variable:DotNetVersion) -or $(& cmd.exe /c 'dotnet --version 2>&1') -eq $DotNetVersion)) {
|
||||||
$env:DOTNET_EXE = (Get-Command "dotnet").Path
|
$env:DOTNET_EXE = (Get-Command "dotnet").Path
|
||||||
}
|
}
|
||||||
elseif ($null -eq (Get-Command $env:DOTNET_EXE -ErrorAction SilentlyContinue) -and `
|
elseif ($null -eq (Get-Command $env:DOTNET_EXE -ErrorAction SilentlyContinue) -or `
|
||||||
(!(Test-Path variable:DotNetVersion) -or $(& cmd.exe /c '$env:DOTNET_EXE --version 2>&1') -ne $DotNetVersion)) {
|
!(Test-Path variable:DotNetVersion) -or $(& cmd.exe /c "$env:DOTNET_EXE --version 2>&1") -ne $DotNetVersion) {
|
||||||
|
|
||||||
# Download install script
|
# Download install script
|
||||||
$DotNetInstallFile = "$TempDirectory\dotnet-install.ps1"
|
$DotNetInstallFile = "$TempDirectory\dotnet-install.ps1"
|
||||||
mkdir -force $TempDirectory > $null
|
New-Item -ItemType Directory -Path $TempDirectory -Force | Out-Null
|
||||||
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||||
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallUrl, $DotNetInstallFile)
|
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallUrl, $DotNetInstallFile)
|
||||||
|
|
||||||
# Install by channel or version
|
# Install by channel or version
|
||||||
|
@ -72,11 +71,6 @@ try {
|
||||||
|
|
||||||
Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)"
|
Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)"
|
||||||
|
|
||||||
if($BuildDotnetCoreOnly) {
|
|
||||||
$BuildArguments += "-DoCoreBuildOnly"
|
|
||||||
$BuildArguments += "true"
|
|
||||||
}
|
|
||||||
|
|
||||||
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile -- $BuildArguments }
|
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile -- $BuildArguments }
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
|
|
|
@ -291,17 +291,13 @@ namespace LibHacBuild
|
||||||
.Executes(() =>
|
.Executes(() =>
|
||||||
{
|
{
|
||||||
AbsolutePath nupkgFile = ArtifactsDirectory.GlobFiles("*.nupkg").Single();
|
AbsolutePath nupkgFile = ArtifactsDirectory.GlobFiles("*.nupkg").Single();
|
||||||
AbsolutePath snupkgFile = ArtifactsDirectory.GlobFiles("*.snupkg").Single();
|
|
||||||
|
|
||||||
string apiKey = EnvironmentInfo.GetVariable<string>("myget_api_key");
|
string apiKey = EnvironmentInfo.GetVariable<string>("myget_api_key");
|
||||||
DotNetNuGetPushSettings settings = new DotNetNuGetPushSettings()
|
DotNetNuGetPushSettings settings = new DotNetNuGetPushSettings()
|
||||||
.SetApiKey(apiKey)
|
.SetApiKey(apiKey)
|
||||||
.SetSymbolApiKey(apiKey)
|
.SetSource("https://www.myget.org/F/libhac/api/v3/index.json");
|
||||||
.SetSource("https://www.myget.org/F/libhac/api/v2/package")
|
|
||||||
.SetSymbolSource("https://www.myget.org/F/libhac/symbols/api/v2/package");
|
|
||||||
|
|
||||||
DotNetNuGetPush(settings.SetTargetPath(nupkgFile));
|
DotNetNuGetPush(settings.SetTargetPath(nupkgFile));
|
||||||
DotNetNuGetPush(settings.SetTargetPath(snupkgFile));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Target Sign => _ => _
|
Target Sign => _ => _
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Authors>Alex Barney</Authors>
|
<Authors>Alex Barney</Authors>
|
||||||
<Copyright>Copyright © 2018 Alex Barney</Copyright>
|
<Copyright>Copyright © 2018-2020 Alex Barney</Copyright>
|
||||||
<Description>A library for reading content formats used by the Nintendo Switch.</Description>
|
<Description>A library for reading content formats used by the Nintendo Switch.</Description>
|
||||||
<PackageTags>Nintendo;Switch;nca;xci;savefile</PackageTags>
|
<PackageTags>Nintendo;Switch;nca;xci;savefile</PackageTags>
|
||||||
<PackageProjectUrl>https://github.com/Thealexbarney/LibHac</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/Thealexbarney/LibHac</PackageProjectUrl>
|
||||||
|
@ -19,6 +19,7 @@
|
||||||
<IncludeSymbols>true</IncludeSymbols>
|
<IncludeSymbols>true</IncludeSymbols>
|
||||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||||
|
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
|
|
||||||
<!-- When doing a release build with a Git directory, SourceLink will set the SourceRoot needed for DeterministicSourcePaths -->
|
<!-- When doing a release build with a Git directory, SourceLink will set the SourceRoot needed for DeterministicSourcePaths -->
|
||||||
|
|
Loading…
Reference in a new issue