diff --git a/.github/workflows/build_application.yml b/.github/workflows/build_application.yml new file mode 100644 index 000000000..88d3dac18 --- /dev/null +++ b/.github/workflows/build_application.yml @@ -0,0 +1,188 @@ +name: Application build + +on: + push: + branches: [ develop, release/pre, master ] + paths: + - Application/** + - .github/workflows/build_application.yml + pull_request: + branches: [ develop ] + paths: + - Application/** + +env: + releaseType: prerelease + +jobs: + make_version: + runs-on: ubuntu-latest + outputs: + build_num: ${{ steps.generate_build_number.outputs.build_num }} + + steps: + - name: Make build number + id: generate_build_number + run: | + build_num=$(date +'%Y.%-m.%-d').$(date +'%3N' | sed 's/^0*//') + echo "build_num=$build_num" >> $GITHUB_OUTPUT + echo "Build number is $build_num" + + build: + runs-on: ubuntu-latest + needs: [ make_version ] + + env: + solution: IW4MAdmin.sln + buildConfiguration: Prerelease + isPreRelease: false + + buildPlatform: Any CPU + outputFolder: ${{ github.workspace }}/Publish/Prerelease + buildNumber: ${{ needs.make_version.outputs.build_num }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Restore NuGet packages + run: dotnet restore ${{ env.solution }} + + - name: Preload external resources + run: | + echo "Build Configuration is ${{ env.buildConfiguration }}, Release Type is ${{ env.releaseType }}" + mkdir -p WebfrontCore/wwwroot/lib/open-iconic/font/css + curl -o WebfrontCore/wwwroot/lib/open-iconic/font/css/open-iconic-bootstrap-override.scss https://raw.githubusercontent.com/iconic/open-iconic/master/font/css/open-iconic-bootstrap.scss + sed -i 's#../fonts/#/font/#g' WebfrontCore/wwwroot/lib/open-iconic/font/css/open-iconic-bootstrap-override.scss + + - name: Build webfront + run: dotnet build WebfrontCore/WebfrontCore.csproj -c ${{ env.buildConfiguration }} /p:Configuration=${{ env.buildConfiguration }} /p:Platform="x64" + + - name: Compile SCSS files + run: | + dotnet tool install Excubo.WebCompiler --global + webcompiler -r WebfrontCore/wwwroot/css/src -o WebfrontCore/wwwroot/css/ -m disable -z disable + webcompiler WebfrontCore/wwwroot/lib/open-iconic/font/css/open-iconic-bootstrap-override.scss -o WebfrontCore/wwwroot/css/ -m disable -z disable + + - name: Bundle JS files + run: | + echo 'Getting dotnet bundle' + curl -o ${{ github.workspace }}/dotnet-bundle.zip https://raidmax.org/IW4MAdmin/res/dotnet-bundle.zip + echo 'Unzipping download' + unzip ${{ github.workspace }}/dotnet-bundle.zip -d ${{ github.workspace }}/bundle + echo 'Executing dotnet-bundle' + cd ${{ github.workspace }}/bundle + dotnet dotnet-bundle.dll clean ${{ github.workspace }}/WebfrontCore/bundleconfig.json + dotnet dotnet-bundle.dll ${{ github.workspace }}/WebfrontCore/bundleconfig.json + + - name: Build plugins + run: | + cd Plugins + find . -name "*.csproj" -print0 | xargs -0 -I {} dotnet publish {} -c ${{ env.buildConfiguration }} -o ../BUILD/Plugins /p:Configuration=${{ env.buildConfiguration }} /p:Platform="x64" /p:DeployOnBuild=false /p:PackageAsSingleFile=false /p:SkipInvalidConfigurations=true /p:Version=${{ env.buildNumber }} --no-restore + + - name: Build application + run: dotnet publish Application/Application.csproj -c ${{ env.buildConfiguration }} -o ${{ env.outputFolder }} /p:Version=${{ env.buildNumber }} /p:Configuration=${{ env.buildConfiguration }} /p:Platform="x64" --no-restore + + - name: Download translations + run: | + mkdir -p "${{ env.outputFolder }}/Localization" + localizations=("en-US" "ru-RU" "es-EC" "pt-BR" "de-DE") + for localization in "${localizations[@]}" + do + url="https://master.iw4.zip/localization/$localization" + filePath="${{ env.outputFolder }}/Localization/IW4MAdmin.$localization.json" + curl -s "$url" -o "$filePath" + done + + - name: Clean up publish files + run: | + chmod +x ${{ github.workspace }}/Application/BuildScripts/PostBuild.sh + bash ${{ github.workspace }}/Application/BuildScripts/PostBuild.sh ${{ env.outputFolder }} ${{ github.workspace }} + + - name: Generate start scripts + run: | + cat << EOF > "${{ env.outputFolder }}/StartIW4MAdmin.cmd" + @echo off + @title IW4MAdmin + set DOTNET_CLI_TELEMETRY_OPTOUT=1 + dotnet Lib\IW4MAdmin.dll + pause + EOF + + cat << EOF > "${{ env.outputFolder }}/StartIW4MAdmin.sh" + #!/bin/bash + export DOTNET_CLI_TELEMETRY_OPTOUT=1 + dotnet Lib/IW4MAdmin.dll + EOF + + - name: Move extra content into publish directory + run: | + cp ${{ github.workspace }}/Plugins/ScriptPlugins/*.js ${{ env.outputFolder }}/Plugins/ + cp ${{ github.workspace }}/BUILD/Plugins/*.dll ${{ env.outputFolder }}/Plugins/ + mkdir ${{ env.outputFolder }}/wwwroot/css + cp ${{ github.workspace }}/WebfrontCore/wwwroot/css/global.min.css ${{ env.outputFolder }}/wwwroot/css/global.min.css + mkdir ${{ env.outputFolder }}/wwwroot/js + cp ${{ github.workspace }}/WebfrontCore/wwwroot/js/global.min.js ${{ env.outputFolder }}/wwwroot/js/global.min.js + rsync -a ${{ github.workspace }}/WebfrontCore/font/ ${{ env.outputFolder }}/wwwroot/font/ + rsync -a ${{ github.workspace }}/GameFiles/ ${{ env.outputFolder }}/ + rsync -a ${{ github.workspace }}/BUILD/Plugins/wwwroot/ ${{ env.outputFolder }}/wwwroot/ + + - name: Upload artifact for analysis + uses: actions/upload-artifact@v4 + with: + name: IW4MAdmin-${{ env.buildNumber }} + path: ${{ env.outputFolder }} + + release_github: + runs-on: ubuntu-latest + needs: [ make_version, build ] + permissions: + contents: write + environment: prerelease + if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/release/pre' }} + + env: + buildNumber: ${{ needs.make_version.outputs.build_num }} + + steps: + - name: Download build + uses: actions/download-artifact@v4 + with: + name: IW4MAdmin-${{ env.buildNumber }} + path: ${{ github.workspace }} + + - name: Zip build + run: zip -r IW4MAdmin-${{ env.buildNumber }}.zip ${{ github.workspace }}/* + + - name: Make release + uses: ncipollo/release-action@v1 + with: + tag: ${{ env.buildNumber }}-${{ env.releaseType }} + name: IW4MAdmin ${{ env.buildNumber }} + draft: true + prerelease: true + body: Automated rolling release - changelog below. [Updating Instructions](https://github.com/RaidMax/IW4M-Admin/wiki/Getting-Started#updating) + generateReleaseNotes: true + artifacts: ${{ github.workspace }}/*.zip + artifactErrorsFailBuild: true + + update_master_version: + runs-on: ubuntu-latest + needs: [ make_version, build, release_github ] + if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/release/pre' }} + + env: + buildNumber: ${{ needs.make_version.outputs.build_num }} + + steps: + - name: Update master version + run: | + curl --header "Content-Type: application/json" \ + --request POST \ + --data '{"current-version-${{ env.releaseType }}":"${{ env.buildNumber }}","jwt-secret": "${{ secrets.JWTSecret }}"}' \ + http://api.raidmax.org:5000/version diff --git a/.github/workflows/shared_library_nuget.yml b/.github/workflows/shared_library_nuget.yml index 269daef06..d4ef51c97 100644 --- a/.github/workflows/shared_library_nuget.yml +++ b/.github/workflows/shared_library_nuget.yml @@ -1,44 +1,73 @@ -name: Build and Pack SharedLibraryCore Nuget +name: SharedLibraryCore NuGet on: push: - branches: [ "develop" ] + branches: [ develop ] + paths: + - SharedLibraryCore/** + - .github/workflows/shared_library_nuget.yml pull_request: - branches: [ "develop" ] + branches: [ develop ] + paths: + - SharedLibraryCore/** + +env: + outputDirectory: ${{ github.workspace}}/nuget + buildConfiguration: Prerelease jobs: build_pack: - runs-on: ubuntu-latest - env: - buildConfiguration: 'Prerelease' + outputs: + build_num: ${{ steps.generate_build_number.outputs.build_num }} + + steps: + - name: Make build number + id: generate_build_number + run: | + build_num=$(date +'%Y.%-m.%-d').$(date +'%3N' | sed 's/^0*//') + echo "build_num=$build_num" >> $GITHUB_ENV + echo "build_num=$build_num" >> $GITHUB_OUTPUT + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build Data + run: dotnet build **/Data.csproj -c ${{env.buildConfiguration}} /p:Version=${{ env.build_num }} --no-restore + - name: Build SLC + run: dotnet build **/SharedLibraryCore.csproj -c ${{env.buildConfiguration}} /p:Version=${{ env.build_num }} --no-restore + - name: Pack SLC + run: dotnet pack **/SharedLibraryCore.csproj -c ${{env.buildConfiguration}} -p:PackageVersion=${{ env.build_num }} -o ${{ env.outputDirectory }} + - name: Publish nuget package artifact + uses: actions/upload-artifact@v4 + with: + name: SharedLibraryCore-${{ steps.generate_build_number.outputs.build_num }} + path: ${{ env.outputDirectory }}/*.nupkg + + publish: + runs-on: ubuntu-latest + + needs: [ build_pack ] + steps: - - name: Make build number - id: generate_build_number - run: | - echo "build_num=$(date +'%Y.%m.%d').$(( $(date +'%H') + $(date +'%M') + $(date +'%S') + $(date +'%3N') ))" >> "$GITHUB_OUTPUT" - - name: Display build number - run: echo "$build_num" - env: - release_name: ${{ steps.generate_build_number.build_num }} - - uses: actions/checkout@v4 - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 8.0.x - - name: Restore dependencies - run: dotnet restore - - name: Build Data - run: dotnet build **/Data.csproj -c ${{env.buildConfiguration}} --no-restore - - name: Build SLC - run: dotnet build **/SharedLibraryCore.csproj -c ${{env.buildConfiguration}} /p:Version=${{env.release_name}} --no-restore - - name: Pack SLC - run: dotnet pack **/SharedLibraryCore.csproj -c ${{env.buildConfiguration}} --version-suffix ${{env.release_name}} + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: SharedLibraryCore-${{ needs.build_pack.outputs.build_num }} + path: ${{ env.outputDirectory }} + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x - - name: Publish nuget package artifact - uses: actions/upload-artifact@v3 - with: - name: SharedLibraryCore.${{env.release_name}}.nupkg - path: '**/RaidMax.IW4MAdmin.SharedLibraryCore.${{env.release_name}}.nupkg' + - name: Publish NuGet package + run: | + for file in ${{ env.outputDirectory }}/*.nupkg; do + dotnet nuget push "$file" --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate + done diff --git a/Application/Application.csproj b/Application/Application.csproj index f64967e30..2204fdcf2 100644 --- a/Application/Application.csproj +++ b/Application/Application.csproj @@ -73,18 +73,4 @@ - - - - - - - - - - - - - - diff --git a/Application/BuildScripts/PostBuild.sh b/Application/BuildScripts/PostBuild.sh new file mode 100644 index 000000000..f855be560 --- /dev/null +++ b/Application/BuildScripts/PostBuild.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +PublishDir="$1" +SourceDir="$2" + +if [ -z "$PublishDir" ] || [ -z "$SourceDir" ]; then + echo "Usage: $0 " + exit 1 +fi + +echo "Deleting extra runtime files" +declare -a runtimes=("linux-arm" "linux-arm64" "linux-armel" "osx" "osx-x64" "win-arm" "win-arm64" "alpine-x64" "linux-musl-x64") +for runtime in "${runtimes[@]}"; do + if [ -d "$PublishDir/runtimes/$runtime" ]; then + rm -rf "$PublishDir/runtimes/$runtime" + fi +done + +echo "Deleting misc files" +if [ -f "$PublishDir/web.config" ]; then rm "$PublishDir/web.config"; fi +if [ -f "$PublishDir/libman.json" ]; then rm "$PublishDir/libman.json"; fi +rm -f "$PublishDir"/*.exe +rm -f "$PublishDir"/*.pdb +rm -f "$PublishDir"/IW4MAdmin + +echo "Setting up default folders" +mkdir -p "$PublishDir/Plugins" +mkdir -p "$PublishDir/Configuration" +mv "$PublishDir/DefaultSettings.json" "$PublishDir/Configuration/" + +mkdir -p "$PublishDir/Lib" +rm -f "$PublishDir/Microsoft.CodeAnalysis*.dll" +mv "$PublishDir"/*.dll "$PublishDir/Lib/" +mv "$PublishDir"/*.json "$PublishDir/Lib/" +mv "$PublishDir/runtimes" "$PublishDir/Lib/runtimes" +mv "$PublishDir/ru" "$PublishDir/Lib/ru" +mv "$PublishDir/de" "$PublishDir/Lib/de" +mv "$PublishDir/pt" "$PublishDir/Lib/pt" +mv "$PublishDir/es" "$PublishDir/Lib/es" +rm -rf "$PublishDir/cs" +rm -rf "$PublishDir/fr" +rm -rf "$PublishDir/it" +rm -rf "$PublishDir/ja" +rm -rf "$PublishDir/ko" +rm -rf "$PublishDir/pl" +rm -rf "$PublishDir/pt-BR" +rm -rf "$PublishDir/tr" +rm -rf "$PublishDir/zh-Hans" +rm -rf "$PublishDir/zh-Hant" +if [ -d "$PublishDir/refs" ]; then mv "$PublishDir/refs" "$PublishDir/Lib/refs"; fi diff --git a/DeploymentFiles/PostPublish.ps1 b/DeploymentFiles/PostPublish.ps1 index 0bcc9bbda..2ffa4f65d 100644 --- a/DeploymentFiles/PostPublish.ps1 +++ b/DeploymentFiles/PostPublish.ps1 @@ -12,12 +12,3 @@ foreach($localization in $localizations) $response = Invoke-WebRequest $url -UseBasicParsing Out-File -FilePath $filePath -InputObject $response.Content -Encoding utf8 } - -$versionInfo = (Get-Command ("{0}\IW4MAdmin.exe" -f $PublishDir)).FileVersionInfo -$json = @{ -Major = $versionInfo.ProductMajorPart -Minor = $versionInfo.ProductMinorPart -Build = $versionInfo.ProductBuildPart -Revision = $versionInfo.ProductPrivatePart -} -$json | ConvertTo-Json | Out-File -FilePath ("{0}\VersionInformation.json" -f $PublishDir) -Encoding ASCII diff --git a/DeploymentFiles/deployment-pipeline.yml b/DeploymentFiles/deployment-pipeline.yml deleted file mode 100644 index 4f1a9b7ba..000000000 --- a/DeploymentFiles/deployment-pipeline.yml +++ /dev/null @@ -1,264 +0,0 @@ -name: '$(Date:yyyy.M.d)$(Rev:.r)' - -trigger: - batch: true - branches: - include: - - release/pre - - master - - develop - paths: - exclude: - - '**/*.yml' - - '*.yml' - -pr: none - -pool: - vmImage: 'windows-2022' - -variables: - solution: 'IW4MAdmin.sln' - buildPlatform: 'Any CPU' - outputFolder: '$(Build.ArtifactStagingDirectory)\Publish\$(buildConfiguration)' - releaseType: verified - buildConfiguration: Stable - isPreRelease: false - -jobs: - - job: Build_Deploy - steps: - - task: UseDotNet@2 - displayName: 'Install .NET Core 6 SDK' - inputs: - packageType: 'sdk' - version: '8.0.x' - includePreviewVersions: true - - - task: NuGetToolInstaller@1 - - - task: PowerShell@2 - displayName: 'Setup Pre-Release configuration' - condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/release/pre'), eq(variables['Build.SourceBranch'], 'refs/heads/develop')) - inputs: - targetType: 'inline' - script: | - echo '##vso[task.setvariable variable=releaseType]prerelease' - echo '##vso[task.setvariable variable=buildConfiguration]Prerelease' - echo '##vso[task.setvariable variable=isPreRelease]true' - failOnStderr: true - - - task: NuGetCommand@2 - displayName: 'Restore nuget packages' - inputs: - restoreSolution: '$(solution)' - - - task: PowerShell@2 - displayName: 'Preload external resources' - inputs: - targetType: 'inline' - script: | - Write-Host 'Build Configuration is $(buildConfiguration), Release Type is $(releaseType)' - md -Force lib\open-iconic\font\css - wget https://raw.githubusercontent.com/iconic/open-iconic/master/font/css/open-iconic-bootstrap.scss -o lib\open-iconic\font\css\open-iconic-bootstrap-override.scss - cd lib\open-iconic\font\css - (Get-Content open-iconic-bootstrap-override.scss).replace('../fonts/', '/font/') | Set-Content open-iconic-bootstrap-override.scss - failOnStderr: true - workingDirectory: '$(Build.Repository.LocalPath)\WebfrontCore\wwwroot' - - - task: VSBuild@1 - displayName: 'Build projects' - inputs: - solution: '$(solution)' - msbuildArgs: '/p:DeployOnBuild=false /p:PackageAsSingleFile=false /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)" /p:Version=$(Build.BuildNumber) /p:PackageVersion=$(Build.BuildNumber)' - platform: '$(buildPlatform)' - configuration: '$(buildConfiguration)' - - - task: PowerShell@2 - displayName: 'Bundle JS Files' - inputs: - targetType: 'inline' - script: | - Write-Host 'Getting dotnet bundle' - wget http://raidmax.org/IW4MAdmin/res/dotnet-bundle.zip -o $(Build.Repository.LocalPath)\dotnet-bundle.zip - Write-Host 'Unzipping download' - Expand-Archive -LiteralPath $(Build.Repository.LocalPath)\dotnet-bundle.zip -DestinationPath $(Build.Repository.LocalPath) - Write-Host 'Executing dotnet-bundle' - $(Build.Repository.LocalPath)\dotnet-bundle.exe clean $(Build.Repository.LocalPath)\WebfrontCore\bundleconfig.json - $(Build.Repository.LocalPath)\dotnet-bundle.exe $(Build.Repository.LocalPath)\WebfrontCore\bundleconfig.json - failOnStderr: true - workingDirectory: '$(Build.Repository.LocalPath)\WebfrontCore' - - - task: DotNetCoreCLI@2 - displayName: 'Publish projects' - inputs: - command: 'publish' - publishWebProjects: false - projects: | - **/WebfrontCore.csproj - **/Application.csproj - arguments: '-c $(buildConfiguration) -o $(outputFolder) /p:Version=$(Build.BuildNumber)' - zipAfterPublish: false - modifyOutputPath: false - - - task: PowerShell@2 - displayName: 'Run publish script 1' - inputs: - filePath: 'DeploymentFiles/PostPublish.ps1' - arguments: '$(outputFolder)' - failOnStderr: true - workingDirectory: '$(Build.Repository.LocalPath)' - - - task: BatchScript@1 - displayName: 'Run publish script 2' - inputs: - filename: 'Application\BuildScripts\PostPublish.bat' - workingFolder: '$(Build.Repository.LocalPath)' - arguments: '$(outputFolder) $(Build.Repository.LocalPath)' - failOnStandardError: true - - - task: PowerShell@2 - displayName: 'Download dos2unix for line endings' - inputs: - targetType: 'inline' - script: 'wget https://raidmax.org/downloads/dos2unix.exe' - failOnStderr: true - workingDirectory: '$(Build.Repository.LocalPath)\Application\BuildScripts' - - - task: CmdLine@2 - displayName: 'Convert Linux start script line endings' - inputs: - script: | - echo changing to encoding for linux start script - dos2unix $(outputFolder)\StartIW4MAdmin.sh - dos2unix $(outputFolder)\UpdateIW4MAdmin.sh - echo creating website version filename - @echo IW4MAdmin-$(Build.BuildNumber) > $(Build.ArtifactStagingDirectory)\version_$(releaseType).txt - workingDirectory: '$(Build.Repository.LocalPath)\Application\BuildScripts' - - - task: CopyFiles@2 - displayName: 'Move script plugins into publish directory' - inputs: - SourceFolder: '$(Build.Repository.LocalPath)\Plugins\ScriptPlugins' - Contents: '*.js' - TargetFolder: '$(outputFolder)\Plugins' - - - task: CopyFiles@2 - displayName: 'Move binary plugins into publish directory' - inputs: - SourceFolder: '$(Build.Repository.LocalPath)\BUILD\Plugins\' - Contents: '*.dll' - TargetFolder: '$(outputFolder)\Plugins' - - - task: CmdLine@2 - displayName: 'Move webfront resources into publish directory' - inputs: - script: 'xcopy /s /y /f wwwroot $(outputFolder)\wwwroot' - workingDirectory: '$(Build.Repository.LocalPath)\BUILD\Plugins' - failOnStderr: true - - - task: CmdLine@2 - displayName: 'Move gamescript files into publish directory' - inputs: - script: 'echo d | xcopy /s /y /f GameFiles $(outputFolder)\GameFiles' - workingDirectory: '$(Build.Repository.LocalPath)' - failOnStderr: true - - - task: ArchiveFiles@2 - displayName: 'Generate final zip file' - inputs: - rootFolderOrFile: '$(outputFolder)' - includeRootFolder: false - archiveType: 'zip' - archiveFile: '$(Build.ArtifactStagingDirectory)/IW4MAdmin-$(Build.BuildNumber).zip' - replaceExistingArchive: true - - - task: PublishPipelineArtifact@1 - inputs: - targetPath: '$(Build.ArtifactStagingDirectory)/IW4MAdmin-$(Build.BuildNumber).zip' - artifact: 'IW4MAdmin-$(Build.BuildNumber).zip' - - - task: PublishPipelineArtifact@1 - displayName: 'Publish artifact for analysis' - inputs: - targetPath: '$(outputFolder)' - artifact: 'IW4MAdmin.$(buildConfiguration)' - publishLocation: 'pipeline' - - - task: PublishPipelineArtifact@1 - displayName: 'Publish nuget package artifact' - inputs: - targetPath: '$(Build.Repository.LocalPath)/SharedLibraryCore/bin/$(buildConfiguration)/RaidMax.IW4MAdmin.SharedLibraryCore.$(Build.BuildNumber).nupkg' - artifact: 'SharedLibraryCore.$(Build.BuildNumber).nupkg' - publishLocation: 'pipeline' - - - task: FtpUpload@2 - condition: ne(variables['Build.SourceBranch'], 'refs/heads/develop') - displayName: 'Upload zip file to website' - inputs: - credentialsOption: 'inputs' - serverUrl: '$(FTPUrl)' - username: '$(FTPUsername)' - password: '$(FTPPassword)' - rootDirectory: '$(Build.ArtifactStagingDirectory)' - filePatterns: '*.zip' - remoteDirectory: 'IW4MAdmin/Download' - clean: false - cleanContents: false - preservePaths: false - trustSSL: false - - - task: FtpUpload@2 - condition: ne(variables['Build.SourceBranch'], 'refs/heads/develop') - displayName: 'Upload version info to website' - inputs: - credentialsOption: 'inputs' - serverUrl: '$(FTPUrl)' - username: '$(FTPUsername)' - password: '$(FTPPassword)' - rootDirectory: '$(Build.ArtifactStagingDirectory)' - filePatterns: 'version_$(releaseType).txt' - remoteDirectory: 'IW4MAdmin' - clean: false - cleanContents: false - preservePaths: false - trustSSL: false - - - task: GitHubRelease@1 - condition: ne(variables['Build.SourceBranch'], 'refs/heads/develop') - displayName: 'Make GitHub release' - inputs: - gitHubConnection: 'github.com_RaidMax' - repositoryName: 'RaidMax/IW4M-Admin' - action: 'create' - target: '$(Build.SourceVersion)' - tagSource: 'userSpecifiedTag' - tag: '$(Build.BuildNumber)-$(releaseType)' - title: 'IW4MAdmin $(Build.BuildNumber) ($(releaseType))' - assets: '$(Build.ArtifactStagingDirectory)/*.zip' - isPreRelease: $(isPreRelease) - releaseNotesSource: 'inline' - releaseNotesInline: 'Automated rolling release - changelog below. [Updating Instructions](https://github.com/RaidMax/IW4M-Admin/wiki/Getting-Started#updating)' - changeLogCompareToRelease: 'lastNonDraftRelease' - changeLogType: 'commitBased' - - - task: PowerShell@2 - condition: ne(variables['Build.SourceBranch'], 'refs/heads/develop') - displayName: 'Update master version' - inputs: - targetType: 'inline' - script: | - $payload = @{ - 'current-version-$(releaseType)' = '$(Build.BuildNumber)' - 'jwt-secret' = '$(JWTSecret)' - } | ConvertTo-Json - - - $params = @{ - Uri = 'http://api.raidmax.org:5000/version' - Method = 'POST' - Body = $payload - ContentType = 'application/json' - } - - Invoke-RestMethod @params diff --git a/DeploymentFiles/nuget-pipeline.yml b/DeploymentFiles/nuget-pipeline.yml deleted file mode 100644 index ff7ae71ea..000000000 --- a/DeploymentFiles/nuget-pipeline.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: '$(Date:yyyy.M.d)$(Rev:.r)' - -pr: none - -pool: - vmImage: 'windows-2022' - -variables: - buildPlatform: 'Any CPU' - outputFolder: '$(Build.ArtifactStagingDirectory)\Publish\$(buildConfiguration)' - releaseType: verified - buildConfiguration: Stable - isPreRelease: false - -jobs: - - job: Build_Pack - steps: - - task: PowerShell@2 - displayName: 'Setup Build configuration' - condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/release/pre'), eq(variables['Build.SourceBranch'], 'refs/heads/develop'), eq(variables['Build.SourceBranch'], 'refs/heads/chore/nuget-pipeline')) - inputs: - targetType: 'inline' - script: | - echo '##vso[task.setvariable variable=releaseType]prerelease' - echo '##vso[task.setvariable variable=buildConfiguration]Prerelease' - echo '##vso[task.setvariable variable=isPreRelease]true' - failOnStderr: true - - - task: DotNetCoreCLI@2 - displayName: 'Build Data' - inputs: - command: 'build' - projects: '**/Data.csproj' - arguments: '-c $(buildConfiguration)' - - - task: DotNetCoreCLI@2 - displayName: 'Build SLC' - inputs: - command: 'build' - projects: '**/SharedLibraryCore.csproj' - arguments: '-c $(buildConfiguration) /p:Version=$(Build.BuildNumber)' - - - task: DotNetCoreCLI@2 - displayName: 'Pack SLC' - inputs: - command: 'pack' - packagesToPack: '**/SharedLibraryCore.csproj' - versioningScheme: 'byBuildNumber' - - - task: PublishPipelineArtifact@1 - displayName: 'Publish nuget package artifact' - inputs: - targetPath: 'D:\a\1\a\RaidMax.IW4MAdmin.SharedLibraryCore.$(Build.BuildNumber).nupkg' - artifact: 'SharedLibraryCore.$(Build.BuildNumber).nupkg' - publishLocation: 'pipeline' diff --git a/IW4MAdmin.sln b/IW4MAdmin.sln index 87038b446..cdeaf1c0a 100644 --- a/IW4MAdmin.sln +++ b/IW4MAdmin.sln @@ -6,13 +6,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{26E8 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8C8F3945-0AEF-4949-A1F7-B18E952E50BC}" ProjectSection(SolutionItems) = preProject - DeploymentFiles\deployment-pipeline.yml = DeploymentFiles\deployment-pipeline.yml DeploymentFiles\PostPublish.ps1 = DeploymentFiles\PostPublish.ps1 README.md = README.md version.txt = version.txt DeploymentFiles\UpdateIW4MAdmin.ps1 = DeploymentFiles\UpdateIW4MAdmin.ps1 DeploymentFiles\UpdateIW4MAdmin.sh = DeploymentFiles\UpdateIW4MAdmin.sh - DeploymentFiles\nuget-pipeline.yml = DeploymentFiles\nuget-pipeline.yml EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharedLibraryCore", "SharedLibraryCore\SharedLibraryCore.csproj", "{AA0541A2-8D51-4AD9-B0AC-3D1F5B162481}" @@ -112,6 +110,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Pluto IW5", "Pluto IW5", "{ GameFiles\AntiCheat\IW5\README.MD = GameFiles\AntiCheat\IW5\README.MD EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GithubActions", "GithubActions", "{DCCEED9F-816E-4595-8B74-D76A77FBE0BE}" + ProjectSection(SolutionItems) = preProject + .github\workflows\build_application.yml = .github\workflows\build_application.yml + .github\workflows\shared_library_nuget.yml = .github\workflows\shared_library_nuget.yml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -461,6 +465,7 @@ Global {3EA564BD-3AC6-479B-96B6-CB059DCD0C77} = {AB83BAC0-C539-424A-BF00-78487C10753C} {866F453D-BC89-457F-8B55-485494759B31} = {AB83BAC0-C539-424A-BF00-78487C10753C} {603725A4-BC0B-423B-955B-762C89E1C4C2} = {AB83BAC0-C539-424A-BF00-78487C10753C} + {DCCEED9F-816E-4595-8B74-D76A77FBE0BE} = {8C8F3945-0AEF-4949-A1F7-B18E952E50BC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {84F8F8E0-1F73-41E0-BD8D-BB6676E2EE87} diff --git a/Plugins/AutomessageFeed/AutomessageFeed.csproj b/Plugins/AutomessageFeed/AutomessageFeed.csproj index f2da7417e..73ddb14fb 100644 --- a/Plugins/AutomessageFeed/AutomessageFeed.csproj +++ b/Plugins/AutomessageFeed/AutomessageFeed.csproj @@ -13,8 +13,4 @@ - - - - diff --git a/Plugins/LiveRadar/LiveRadar.csproj b/Plugins/LiveRadar/LiveRadar.csproj index 272db5758..403ebd2db 100644 --- a/Plugins/LiveRadar/LiveRadar.csproj +++ b/Plugins/LiveRadar/LiveRadar.csproj @@ -4,7 +4,7 @@ net8.0 true true - false + false false true 0.1.0.0 @@ -19,8 +19,4 @@ - - - - diff --git a/Plugins/Login/Login.csproj b/Plugins/Login/Login.csproj index d503ff277..5c775b5ed 100644 --- a/Plugins/Login/Login.csproj +++ b/Plugins/Login/Login.csproj @@ -22,8 +22,4 @@ - - - - diff --git a/Plugins/Mute/Mute.csproj b/Plugins/Mute/Mute.csproj index 6a5af3197..a227b7fed 100644 --- a/Plugins/Mute/Mute.csproj +++ b/Plugins/Mute/Mute.csproj @@ -13,8 +13,5 @@ - - - - + diff --git a/Plugins/ProfanityDeterment/ProfanityDeterment.csproj b/Plugins/ProfanityDeterment/ProfanityDeterment.csproj index 41265fcdd..0818d044b 100644 --- a/Plugins/ProfanityDeterment/ProfanityDeterment.csproj +++ b/Plugins/ProfanityDeterment/ProfanityDeterment.csproj @@ -19,8 +19,4 @@ - - - - diff --git a/Plugins/Stats/Stats.csproj b/Plugins/Stats/Stats.csproj index d1db9b143..c8fafb0ab 100644 --- a/Plugins/Stats/Stats.csproj +++ b/Plugins/Stats/Stats.csproj @@ -20,8 +20,4 @@ - - - - diff --git a/Plugins/Welcome/Welcome.csproj b/Plugins/Welcome/Welcome.csproj index 6f55c0071..11c3a0370 100644 --- a/Plugins/Welcome/Welcome.csproj +++ b/Plugins/Welcome/Welcome.csproj @@ -15,10 +15,6 @@ Latest - - - - diff --git a/WebfrontCore/Properties/launchSettings.json b/WebfrontCore/Properties/launchSettings.json deleted file mode 100644 index a35479d6d..000000000 --- a/WebfrontCore/Properties/launchSettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:61369/", - "sslPort": 0 - } - } -} \ No newline at end of file diff --git a/WebfrontCore/Views/Shared/_Layout.cshtml b/WebfrontCore/Views/Shared/_Layout.cshtml index b4c2361cc..82e2cf251 100644 --- a/WebfrontCore/Views/Shared/_Layout.cshtml +++ b/WebfrontCore/Views/Shared/_Layout.cshtml @@ -15,7 +15,7 @@ - + diff --git a/WebfrontCore/WebfrontCore.csproj b/WebfrontCore/WebfrontCore.csproj index ebfc81968..302b51bfc 100644 --- a/WebfrontCore/WebfrontCore.csproj +++ b/WebfrontCore/WebfrontCore.csproj @@ -33,19 +33,15 @@ - - - - + - @@ -78,7 +74,4 @@ - - - diff --git a/WebfrontCore/bundleconfig.json b/WebfrontCore/bundleconfig.json index bbce348fe..5049558e1 100644 --- a/WebfrontCore/bundleconfig.json +++ b/WebfrontCore/bundleconfig.json @@ -3,9 +3,9 @@ "outputFileName": "wwwroot/css/global.min.css", "inputFiles": [ "wwwroot/lib/halfmoon/css/halfmoon-variables.min.css", - "wwwroot/css/global.css", "wwwroot/lib/chart.js/dist/Chart.min.css", - "wwwroot/css/open-iconic.css" + "wwwroot/css/open-iconic-bootstrap-override.css", + "wwwroot/css/main.css" ] }, { diff --git a/WebfrontCore/compilerconfig.json b/WebfrontCore/compilerconfig.json deleted file mode 100644 index 63588138a..000000000 --- a/WebfrontCore/compilerconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "outputFile": "wwwroot/css/global.css", - "inputFile": "wwwroot/css/src/main.scss" - }, - { - "outputFile": "wwwroot/css/src/profile.css", - "inputFile": "wwwroot/css/src/profile.scss" - }, - { - "outputFile": "wwwroot/css/open-iconic.css", - "inputFile": "wwwroot/lib/open-iconic/font/css/open-iconic-bootstrap-override.scss" - } -] diff --git a/WebfrontCore/compilerconfig.json.defaults b/WebfrontCore/compilerconfig.json.defaults deleted file mode 100644 index c75eb7d51..000000000 --- a/WebfrontCore/compilerconfig.json.defaults +++ /dev/null @@ -1,49 +0,0 @@ -{ - "compilers": { - "less": { - "autoPrefix": "", - "cssComb": "none", - "ieCompat": true, - "strictMath": false, - "strictUnits": false, - "relativeUrls": true, - "rootPath": "", - "sourceMapRoot": "", - "sourceMapBasePath": "", - "sourceMap": false - }, - "sass": { - "includePath": "", - "indentType": "space", - "indentWidth": 2, - "outputStyle": "nested", - "Precision": 5, - "relativeUrls": true, - "sourceMapRoot": "", - "sourceMap": false - }, - "stylus": { - "sourceMap": false - }, - "babel": { - "sourceMap": false - }, - "coffeescript": { - "bare": false, - "runtimeMode": "node", - "sourceMap": false - } - }, - "minifiers": { - "css": { - "enabled": true, - "termSemicolons": true, - "gzip": false - }, - "javascript": { - "enabled": true, - "termSemicolons": true, - "gzip": false - } - } -} \ No newline at end of file