mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-22 10:21:57 -05:00
Refactor msbuild property inputs
This commit is contained in:
parent
8c1aeb8f1f
commit
04bf27e2c5
1 changed files with 30 additions and 22 deletions
|
@ -1,5 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Main msbuild project for OpenRCT2 -->
|
||||
<!-- Inputs
|
||||
- GIT_TAG
|
||||
- GIT_BRANCH
|
||||
- GIT_COMMIT_SHA1
|
||||
- GIT_COMMIT_SHA1_SHORT
|
||||
- SIGN_PASSWORD
|
||||
- OPENRCT2_ORG_TOKEN
|
||||
-->
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!-- Import custom build tasks -->
|
||||
<Import Project="openrct2.targets" />
|
||||
|
@ -25,8 +33,8 @@
|
|||
<SignTimestampUrl>http://timestamp.comodoca.com/authenticode</SignTimestampUrl>
|
||||
|
||||
<PublishZip>$(ArtifactsDir)openrct2.zip</PublishZip>
|
||||
<PublishSymbolsZip Condition="'$(GitSha1Short)'==''">$(ArtifactsDir)openrct2-symbols.zip</PublishSymbolsZip>
|
||||
<PublishSymbolsZip Condition="'$(GitSha1Short)'!=''">$(ArtifactsDir)openrct2-symbols-$(GitSha1Short).zip</PublishSymbolsZip>
|
||||
<PublishSymbolsZip Condition="'$(GIT_COMMIT_SHA1_SHORT)'==''">$(ArtifactsDir)openrct2-symbols.zip</PublishSymbolsZip>
|
||||
<PublishSymbolsZip Condition="'$(GIT_COMMIT_SHA1_SHORT)'!=''">$(ArtifactsDir)openrct2-symbols-$(GIT_COMMIT_SHA1_SHORT).zip</PublishSymbolsZip>
|
||||
<PublishInstallerExe>$(ArtifactsDir)openrct2-install.exe</PublishInstallerExe>
|
||||
|
||||
<UploadFilename>OpenRCT2-$(Version)$(VersionExtension)-windows</UploadFilename>
|
||||
|
@ -90,13 +98,13 @@
|
|||
</Target>
|
||||
|
||||
<!-- Target to sign OpenRCT2 (exe and dll)
|
||||
This requires the project parameter SignPassword to be set -->
|
||||
This requires the project parameter SIGN_PASSWORD to be set -->
|
||||
<Target Name="Sign" DependsOnTargets="Build" Inputs="@(SignItems)" Outputs="%(Identity).bogus">
|
||||
<Warning Condition="'$(SignPassword)'==''" Text="SignPassword was not set, skipping signing of %(SignItems.Filename)%(SignItems.Extension)." />
|
||||
<Message Condition="'$(SignPassword)'!=''" Text="Signing %(SignItems.Filename)%(SignItems.Extension)"
|
||||
<Warning Condition="'$(SIGN_PASSWORD)'==''" Text="SIGN_PASSWORD was not set, skipping signing of %(SignItems.Filename)%(SignItems.Extension)." />
|
||||
<Message Condition="'$(SIGN_PASSWORD)'!=''" Text="Signing %(SignItems.Filename)%(SignItems.Extension)"
|
||||
Importance="high" />
|
||||
<Exec Condition="'$(SignPassword)'!=''"
|
||||
Command="signtool.exe sign /f $(SignCertificate) /p $(SignPassword) /t $(SignTimestampUrl) %(SignItems.Identity)"
|
||||
<Exec Condition="'$(SIGN_PASSWORD)'!=''"
|
||||
Command="signtool.exe sign /f $(SignCertificate) /p $(SIGN_PASSWORD) /t $(SignTimestampUrl) %(SignItems.Identity)"
|
||||
StandardOutputImportance="low" />
|
||||
</Target>
|
||||
|
||||
|
@ -136,9 +144,9 @@
|
|||
Inputs="@(PublishItems);$(NsisScript)"
|
||||
Outputs="$(PublishInstallerExe)">
|
||||
<PropertyGroup>
|
||||
<VersionExtra Condition="'$(GitBranch)'!=''">-$(GitBranch)-$(GitCommitSha1Short)</VersionExtra>
|
||||
<VersionTag Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('$(GitTag)', '^v[0-9]'))">$(GitTag)</VersionTag>
|
||||
<VersionExtra Condition="'$(GitTag)'!='' AND '$(VersionTag)'==''">-$(GitTag)</VersionExtra>
|
||||
<VersionExtra Condition="'$(GIT_BRANCH)'!=''">-$(GIT_BRANCH)-$(GIT_COMMIT_SHA1_SHORT)</VersionExtra>
|
||||
<VersionTag Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('$(GIT_TAG)', '^v[0-9]'))">$(GIT_TAG)</VersionTag>
|
||||
<VersionExtra Condition="'$(GIT_TAG)'!='' AND '$(VersionTag)'==''">-$(GIT_TAG)</VersionExtra>
|
||||
<PublishInstallerExeName>$([System.IO.Path]::GetFilename($(PublishInstallerExe)))</PublishInstallerExeName>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -148,11 +156,11 @@
|
|||
StandardOutputImportance="normal" />
|
||||
|
||||
<!-- Sign the installer -->
|
||||
<Warning Condition="'$(SignPassword)'==''" Text="SignPassword was not set, skipping signing of $(PublishInstallerExeName)." />
|
||||
<Message Condition="'$(SignPassword)'!=''" Text="Signing $(PublishInstallerExeName)"
|
||||
<Warning Condition="'$(SIGN_PASSWORD)'==''" Text="SIGN_PASSWORD was not set, skipping signing of $(PublishInstallerExeName)." />
|
||||
<Message Condition="'$(SIGN_PASSWORD)'!=''" Text="Signing $(PublishInstallerExeName)"
|
||||
Importance="high" />
|
||||
<Exec Condition="'$(SignPassword)'!=''"
|
||||
Command="signtool.exe sign /f $(SignCertificate) /p $(SignPassword) /t $(SignTimestampUrl) $(PublishInstallerExe)"
|
||||
<Exec Condition="'$(SIGN_PASSWORD)'!=''"
|
||||
Command="signtool.exe sign /f $(SignCertificate) /p $(SIGN_PASSWORD) /t $(SignTimestampUrl) $(PublishInstallerExe)"
|
||||
StandardOutputImportance="low" />
|
||||
</Target>
|
||||
|
||||
|
@ -167,16 +175,16 @@
|
|||
</PropertyGroup>
|
||||
<Message Text="Uploading $(UploadFileNameShort)" Importance="high" />
|
||||
<Error Condition="'$(OPENRCT2_ORG_TOKEN)'==''" Text="OPENRCT2_ORG_TOKEN not set." />
|
||||
<Error Condition="'$(GitCommitSha1)'==''" Text="GitCommitSha1 not set." />
|
||||
<Error Condition="'$(GitBranch)'==''" Text="GitBranch not set." />
|
||||
<Error Condition="'$(GIT_COMMIT_SHA1)'==''" Text="GIT_COMMIT_SHA1 not set." />
|
||||
<Error Condition="'$(GIT_BRANCH)'==''" Text="GIT_BRANCH not set." />
|
||||
<Exec Command="curl.exe -s -o - ^
|
||||
--form "key=$(OPENRCT2_ORG_TOKEN)" ^
|
||||
--form "fileName=%(UploadArtifacts.Name)" ^
|
||||
--form "version=$(Version)" ^
|
||||
--form "gitHash=$(GitCommitSha1)" ^
|
||||
--form "gitBranch=$(GitBranch)" ^
|
||||
--form "key=$(OPENRCT2_ORG_TOKEN)" ^
|
||||
--form "fileName=%(UploadArtifacts.Name)" ^
|
||||
--form "version=$(Version)" ^
|
||||
--form "gitHash=$(GIT_COMMIT_SHA1)" ^
|
||||
--form "gitBranch=$(GIT_BRANCH)" ^
|
||||
--form "flavourId=%(UploadArtifacts.FlavourId)" ^
|
||||
--form "file=@%(UploadArtifacts.Identity)" ^
|
||||
--form "file=@%(UploadArtifacts.Identity)" ^
|
||||
"$(UploadLink)""
|
||||
CustomErrorRegularExpression=""error":1" />
|
||||
</Target>
|
||||
|
|
Loading…
Reference in a new issue