Skip to content

Commit

Permalink
Change build config
Browse files Browse the repository at this point in the history
  • Loading branch information
CCRcmcpe committed Jul 7, 2021
1 parent 9125407 commit d0e250c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 20 deletions.
8 changes: 3 additions & 5 deletions Source/CLI/Build-Artifact.ps1
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
if (Test-Path .\artifact\) { Remove-Item -Recurse .\artifact\ }

git version
$publishCommand = 'dotnet publish -o .\artifact -c Release -p:PublishProfile="Windows x64" -p:DebugType=none -p:DebugSymbols=false'
if ($?)
{
$tag = git describe --abbrev=0
$version = $tag.Substring(1)
$commit = git -c log.showSignature=false log --format=format:%h -n 1
$infoVersion = "$version+$commit"
dotnet publish -o .\artifact -c Release -p:PublishProfile="Windows x64" -p:Version=$infoVersion
$publishCommand += " -p:Version=$infoVersion"
}
else
{
dotnet publish -o .\artifact -c Release -p:PublishProfile="Windows x64"
}
Invoke-Expression $publishCommand
3 changes: 0 additions & 3 deletions Source/CLI/Properties/PublishProfiles/Windows x64.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishReadyToRun>true</PublishReadyToRun>
<PublishReadyToRunShowWarnings>true</PublishReadyToRunShowWarnings>
<PublishSingleFile>true</PublishSingleFile>
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions Source/Core/Auto Arknights Core.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>REVUnit.AutoArknights.Core</RootNamespace>
<nullable>enable</nullable>
<Platforms>x64</Platforms>
<Platform>x64</Platform>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

Expand Down
12 changes: 2 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,11 @@ jobs:
- task: PowerShell@2
displayName: Build
inputs:
filePath: 'Build-Artifact.ps1'
filePath: 'Source/CLI/Build-Artifact.ps1'
pwsh: true
workingDirectory: 'Source/CLI'
- task: ArchiveFiles@2
displayName: Archive
inputs:
rootFolderOrFile: 'Source/CLI/artifact'
includeRootFolder: false
archiveType: '7z'
sevenZipCompression: 'ultra'
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
- task: PublishPipelineArtifact@1
displayName: Publish
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
targetPath: 'Source/CLI/artifact'
artifactName: Auto Arknights CLI

0 comments on commit d0e250c

Please sign in to comment.