0
0
mirror of https://github.com/sp-tarkov/build.git synced 2025-02-13 09:50:45 -05:00
build/project/build.ps1
Refringe 816f791eeb
Changes:
- Removes git directory from container
- Changes all projects to build within a `build` directory
- Adds a combine_builds script that takes the individual project builds and merges them into an `output` directory
- Adds placeholder tag_validate script
- Validates MODULE_DOMAIN env variable
- Updates the Launcher project build to use the `dotnet build` command
- Pins the `dotnet build` command to one thread to prevent Avalonia file access errors on build:
  https://github.com/AvaloniaUI/Avalonia/pull/13840
- Bleeding edge builds are now built as such.

TODO:
- Add additional static project files
- Compress output directory
- Upload release to public folder
- Adapt to work within Drone env
- Adapt build script to work with a dynamic tag value
- Only run project builds when the tag exists in all three projects
2024-02-26 11:15:58 -05:00

29 lines
1.1 KiB
PowerShell

## Orchestrate the build process for the SPT project
Write-Output " » Beginning SPT Build Process"
# Check for the required MODULE_DOMAIN environment variable
$MODULE_DOMAIN = $env:MODULE_DOMAIN
$MODULE_DOMAIN_REGEX = '^(https?:\/\/)?([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(\/)?$'
if ([string]::IsNullOrWhiteSpace($MODULE_DOMAIN) -or -not $MODULE_DOMAIN -match $MODULE_DOMAIN_REGEX -or $MODULE_DOMAIN.EndsWith("/")) {
Write-Output " » FAIL: The MODULE_DOMAIN environment variable is invalid."
exit 1 # Fail the build
}
# TODO: Make dynamic, based on the commit information
$RELEASE_TAG = "3.8.0-BE"
# Get the current directory
$DIR_ABS = (Get-Location).Path
# TODO: Validate that the tag exists in all three repositories before continuing the build.
pwsh $DIR_ABS\project\validate_tag.ps1 $RELEASE_TAG
# Build the projects
pwsh $DIR_ABS\project\build_server.ps1 $RELEASE_TAG
pwsh $DIR_ABS\project\build_modules.ps1 $RELEASE_TAG $MODULE_DOMAIN
pwsh $DIR_ABS\project\build_launcher.ps1 $RELEASE_TAG
# Combine the built files into the output directory
pwsh $DIR_ABS\project\combine_builds.ps1