diff --git a/.github/scripts/ApplySemanticVersioningToAssemblies.ps1 b/.github/scripts/ApplySemanticVersioningToAssemblies.ps1 deleted file mode 100644 index d28f2e70..00000000 --- a/.github/scripts/ApplySemanticVersioningToAssemblies.ps1 +++ /dev/null @@ -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 diff --git a/.github/workflows/asm.yml b/.github/workflows/asm.yml deleted file mode 100644 index 4d986291..00000000 --- a/.github/workflows/asm.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/csm.yml b/.github/workflows/csm.yml deleted file mode 100644 index a656d40b..00000000 --- a/.github/workflows/csm.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/discord.yml b/.github/workflows/discord.yml deleted file mode 100644 index 9ec37945..00000000 --- a/.github/workflows/discord.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml deleted file mode 100644 index 461af9fb..00000000 --- a/.github/workflows/msbuild.yml +++ /dev/null @@ -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}} diff --git a/src/Server-Managers.sln b/src/Server-Managers.sln index c2acb5bd..285cf426 100644 --- a/src/Server-Managers.sln +++ b/src/Server-Managers.sln @@ -19,10 +19,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{F8DB EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{385BF0EA-D67F-44A4-910C-2E6E84A38525}" ProjectSection(SolutionItems) = preProject - ..\.github\workflows\asm.yml = ..\.github\workflows\asm.yml - ..\.github\workflows\csm.yml = ..\.github\workflows\csm.yml - ..\.github\workflows\discord.yml = ..\.github\workflows\discord.yml - ..\.github\workflows\msbuild.yml = ..\.github\workflows\msbuild.yml Nuget.config = Nuget.config ..\.github\workflows\webapi.yml = ..\.github\workflows\webapi.yml EndProjectSection