diff --git a/.github/workflows/dotnet_build.yml b/.github/workflows/dotnet_build.yml new file mode 100644 index 0000000..c3e90d0 --- /dev/null +++ b/.github/workflows/dotnet_build.yml @@ -0,0 +1,63 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: Build + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build_linux: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.204 + - name: Restore dependencies + run: dotnet restore + - name: Publish + run: dotnet publish -c Release -p:PublishProfile=./SCHALE.GameServer/Properties/PublishProfiles/linux_x64.pubxml + - name: rm files + run: | + rm -rf ./SCHALE.GameServer/bin/Release/net8.0/linux-x64/publish/SCHALE.GameServer.pdb + rm -rf ./SCHALE.GameServer/bin/Release/net8.0/linux-x64/publish/SCHALE.Common.pdb + rm -rf ./SCHALE.GameServer/bin/Release/net8.0/linux-x64/publish/appsettings.Docker.json + rm -rf ./SCHALE.GameServer/bin/Release/net8.0/linux-x64/publish/appsettings.Development.json + - name: Upload output + uses: actions/upload-artifact@v2 + with: + name: "Build_Linux" + path: ./SCHALE.GameServer/bin/Release/net8.0/linux-x64/publish + + build_win: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.204 + - name: Restore dependencies + run: dotnet restore + - name: Publish + run: dotnet publish -c Release -p:PublishProfile=./SCHALE.GameServer/Properties/PublishProfiles/win_x64.pubxml + - name: rm files + run: | + del ./SCHALE.GameServer/bin/Release/net8.0/win-x64/publish/SCHALE.GameServer.pdb + del ./SCHALE.GameServer/bin/Release/net8.0/win-x64/publish/SCHALE.Common.pdb + del ./SCHALE.GameServer/bin/Release/net8.0/win-x64/publish/appsettings.Docker.json + del ./SCHALE.GameServer/bin/Release/net8.0/win-x64/publish/appsettings.Development.json + - name: Upload output + uses: actions/upload-artifact@v2 + with: + name: "Build_Windows" + path: ./SCHALE.GameServer/bin/Release/net8.0/win-x64/publish diff --git a/.gitignore b/.gitignore index c974c4f..ce88608 100644 --- a/.gitignore +++ b/.gitignore @@ -184,7 +184,7 @@ publish/ *.azurePubxml # Note: Comment the next line if you want to checkin your web deploy settings, # but database connection strings (with potential passwords) will be unencrypted -*.pubxml +# *.pubxml *.publishproj # Microsoft Azure Web App publish settings. Comment the next line if you want to diff --git a/SCHALE.GameServer/Properties/PublishProfiles/linux_x64.pubxml b/SCHALE.GameServer/Properties/PublishProfiles/linux_x64.pubxml new file mode 100644 index 0000000..c482282 --- /dev/null +++ b/SCHALE.GameServer/Properties/PublishProfiles/linux_x64.pubxml @@ -0,0 +1,24 @@ + + + + + false + false + true + Release + Any CPU + FileSystem + bin\Release\net8.0\publish\linux_x64 + FileSystem + <_TargetId>Folder + + net8.0 + linux-x64 + true + fa808fe1-3f81-4afc-9fbe-8662b9781ef8 + true + false + + \ No newline at end of file diff --git a/SCHALE.GameServer/Properties/PublishProfiles/win_x64.pubxml b/SCHALE.GameServer/Properties/PublishProfiles/win_x64.pubxml new file mode 100644 index 0000000..2aaf63a --- /dev/null +++ b/SCHALE.GameServer/Properties/PublishProfiles/win_x64.pubxml @@ -0,0 +1,23 @@ + + + + + false + false + true + Release + Any CPU + FileSystem + bin\Release\net8.0\publish\win_x64 + FileSystem + <_TargetId>Folder + + net8.0 + win-x64 + true + fa808fe1-3f81-4afc-9fbe-8662b9781ef8 + true + + \ No newline at end of file