mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Move build number script to prebuild.ps1
This commit is contained in:
parent
c7de065434
commit
ee6714b75b
11
.github/workflows/nightly.yml
vendored
11
.github/workflows/nightly.yml
vendored
|
|
@ -21,17 +21,6 @@ jobs:
|
|||
|
||||
- name: Setup msbuild
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Set BuildVer.h
|
||||
shell: bash
|
||||
run: |
|
||||
cat > Minecraft.Client/Common/BuildVer.h << EOF
|
||||
#pragma once
|
||||
#define VER_PRODUCTBUILD $GITHUB_RUN_NUMBER
|
||||
#define VER_PRODUCTVERSION_STR_W L"${GITHUB_SHA::7} ($GITHUB_REF)"
|
||||
#define VER_FILEVERSION_STR_W VER_PRODUCTVERSION_STR_W
|
||||
#define VER_NETWORK VER_PRODUCTBUILD
|
||||
EOF
|
||||
|
||||
- name: Build
|
||||
run: MSBuild.exe MinecraftConsoles.sln /p:Configuration=Release /p:Platform="Windows64"
|
||||
|
|
|
|||
|
|
@ -1595,6 +1595,12 @@ if not exist "$(TargetDir)\savedata" mkdir "$(TargetDir)\savedata"</Command>
|
|||
<PostBuildEvent>
|
||||
<Message>Run post-build script</Message>
|
||||
</PostBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Command>powershell -ExecutionPolicy Bypass -File "$(ProjectDir)prebuild.ps1"</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Run pre-build script</Message>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64EC'">
|
||||
<ClCompile>
|
||||
|
|
@ -1823,6 +1829,12 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CU</C
|
|||
<DeploymentType>CopyToHardDrive</DeploymentType>
|
||||
<DeploymentFiles>$(RemoteRoot)=$(ImagePath);$(RemoteRoot)\res=Xbox\res;$(RemoteRoot)=Xbox\AvatarAwards;$(RemoteRoot)\Tutorial=Xbox\Tutorial\Tutorial;$(RemoteRoot)=Xbox\584111F70AAAAAAA;$(RemoteRoot)=Xbox\kinect\speech;$(RemoteRoot)=Xbox\XZP\TMSFiles.xzp</DeploymentFiles>
|
||||
</Deploy>
|
||||
<PreBuildEvent>
|
||||
<Command>powershell -ExecutionPolicy Bypass -File "$(ProjectDir)prebuild.ps1"</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Run pre-build script</Message>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64EC'">
|
||||
<ClCompile>
|
||||
|
|
|
|||
23
Minecraft.Client/prebuild.ps1
Normal file
23
Minecraft.Client/prebuild.ps1
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
$sha = (git rev-parse --short=7 HEAD)
|
||||
$ref = (git symbolic-ref HEAD)
|
||||
$build = -1
|
||||
$suffix = ""
|
||||
|
||||
# If we are running in GitHub Actions, use the run number as the build number
|
||||
if ($env:GITHUB_RUN_NUMBER) {
|
||||
$build = $env:GITHUB_RUN_NUMBER
|
||||
}
|
||||
|
||||
# If we have uncommitted changes, add a suffix to the version string
|
||||
if (git status --porcelain) {
|
||||
$suffix = "-dev"
|
||||
}
|
||||
|
||||
@"
|
||||
#pragma once
|
||||
|
||||
#define VER_PRODUCTBUILD $build
|
||||
#define VER_PRODUCTVERSION_STR_W L"$sha$suffix ($ref)"
|
||||
#define VER_FILEVERSION_STR_W VER_PRODUCTVERSION_STR_W
|
||||
#define VER_NETWORK VER_PRODUCTBUILD
|
||||
"@ | Set-Content "Common/BuildVer.h"
|
||||
Loading…
Reference in a new issue