build file removal

This commit is contained in:
Brett Hewitson 2021-12-10 23:01:25 +10:00
parent 17516fa014
commit 1ca90f99ee
6 changed files with 0 additions and 297 deletions

View file

@ -1,128 +0,0 @@
Param
(
[string]$applicationName = $env:BUILD_APPLICATION_NAME,
[string]$pathToSearch = $env:BUILD_SOURCE_PATH,
[string]$versionFile = $env:BUILD_VERSION_FILE,
[regex]$pattern = "\d+\.\d+\.\d+\.\d+",
[string]$patternSplitCharacters = ".",
[int]$patternExpectedVersionNumbers = 4,
[int]$versionNumbersInVersion = 4,
[string]$searchFilter = "AssemblyInfo.*",
[string]$debugMode = 'false'
)
# Declare functions
function Replace-Version($content, $version, $attribute)
{
$exitFunction = $false
$content | %{
if ($_ -match 'exclude from semantic versioning')
{
Write-Host " * Skipping $attribute due to exclude"
$exitFunction = $true
}
if ($_ -match 'include semantic versioning' -and $_ -notmatch "include semantic versioning - $applicationName")
{
Write-Host " * Skipping $attribute due to include not matching"
$exitFunction = $true
}
}
if ($exitFunction)
{
return $content
}
$versionAttribute = "[assembly: $attribute(""$version"")]"
$pattern = "\[assembly: $attribute\("".*""\)\]"
$versionReplaced = $false
$content = $content | %{
if ($_ -match $pattern)
{
$versionReplaced = $true
$_ = $_ -replace [regex]::Escape($Matches[0]),$versionAttribute
Write-Host " * Replaced $($Matches[0]) with $versionAttribute"
}
$_
}
if (-not $versionReplaced)
{
$content += [Environment]::NewLine + $versionAttribute
Write-Host " * Added $versionAttribute to end of content"
}
return $content
}
function Get-VersionString($numberOfVersions, $extractedBuildNumbers)
{
return [string]::Join(".",($extractedBuildNumbers | select -First ($numberOfVersions)))
}
$ErrorActionPreference = "Stop"
if ($debugMode -eq "true")
{
Write-Host "##[section]Starting: DEBUG INFORMATION"
Write-Host "##[debug]applicationName = $applicationName"
Write-Host "##[debug]pathToSearch = $pathToSearch"
Write-Host "##[debug]versionFile = $versionFile"
Write-Host "##[debug]pattern = $pattern"
Write-Host "##[debug]patternSplitCharacters = $patternSplitCharacters"
Write-Host "##[debug]patternExpectedVersionNumbers = $patternExpectedVersionNumbers"
Write-Host "##[debug]versionNumbersInVersion = $versionNumbersInVersion"
Write-Host "##[debug]searchFilter = $searchFilter"
Write-Host "##[section]Finishing: DEBUG INFORMATION"
Write-Host ""
}
# read the build number from the version file
$buildNumber = Get-Content $versionFile
if ($buildNumber -match $pattern -ne $true)
{
Write-Host "Could not extract a version from [$buildNumber] using pattern [$pattern]"
exit 2
}
# Set version variables
$extractedBuildNumbers = @($Matches[0].Split(([char[]]$patternSplitCharacters)))
if ($extractedBuildNumbers.Length -ne $patternExpectedVersionNumbers)
{
Write-Host "The extracted build number $($Matches[0]) does not contain the expected $patternExpectedVersionNumbers elements"
exit 2
}
$version = Get-VersionString -numberOfVersions $versionNumbersInVersion -extractedBuildNumbers $extractedBuildNumbers
$fileVersion = Get-VersionString -numberOfVersions $versionNumbersInVersion -extractedBuildNumbers $extractedBuildNumbers
Write-Host "Using version $version and file version $fileVersion"
# iterate the search path (and sub directories) looking for files that match the search filter
Get-ChildItem -Path $pathToSearch -Filter $searchFilter -Recurse | %{
Write-Host " -> Checking $($_.FullName)"
# remove the read-only bit on the file
#sp $_.FullName IsReadOnly $false
Set-ItemProperty $_.FullName -name IsReadOnly -value $false
# run the regex replace
$content = Get-Content $_.FullName
$content = Replace-Version -content $content -version $version -attribute 'AssemblyVersion'
$content = Replace-Version -content $content -version $fileVersion -attribute 'AssemblyFileVersion'
$content | Set-Content $_.FullName -Encoding UTF8
}
Write-Host "Done"
exit 0

View file

@ -1,43 +0,0 @@
name: Build and Deploy ASM
on:
workflow_dispatch:
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: ./src
PROJECT_FILE_PATH: ./src/ARKServerManager
# Configuration type to build.
BUILD_CONFIGURATION: Release
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /t:publish /p:PublishDir="publish/" ${{env.PROJECT_FILE_PATH}}
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v2
with:
name: .net-app
path: ${{env.PROJECT_FILE_PATH}}/publish
#deploy:
# runs-on: self-hosted
# needs: build

View file

@ -1,43 +0,0 @@
name: Build and Deploy CSM
on:
workflow_dispatch:
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: ./src
PROJECT_FILE_PATH: ./src/ConanServerManager
# Configuration type to build.
BUILD_CONFIGURATION: Release
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /t:publish /p:PublishDir="publish/" ${{env.PROJECT_FILE_PATH}}
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v2
with:
name: .net-app
path: ${{env.PROJECT_FILE_PATH}}/publish
#deploy:
# runs-on: self-hosted
# needs: build

View file

@ -1,43 +0,0 @@
name: Build and Deploy Discord Plugin
on:
workflow_dispatch:
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: ./src
PROJECT_FILE_PATH: ./src/Plugin.Discord
# Configuration type to build.
BUILD_CONFIGURATION: Release
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /t:publish /p:PublishDir="publish/" ${{env.PROJECT_FILE_PATH}}
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v2
with:
name: .net-app
path: ${{env.PROJECT_FILE_PATH}}/publish
#deploy:
# runs-on: self-hosted
# needs: build

View file

@ -1,36 +0,0 @@
name: Build server manager applications - servermanagers
on:
push:
paths:
- 'src/**'
workflow_dispatch:
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: ./src
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}