Merge pull request #3156 from ACaiCat/patch-1 #2248
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI(OTAPI3) | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.0.x | |
| - name: Run tests | |
| run: dotnet test | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| arch: ["win-x64", "osx-x64", "linux-x64", "linux-arm64", "linux-arm"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.0.x | |
| - name: Install msgfmt | |
| run: sudo apt-get install -y gettext | |
| - name: Produce installer | |
| run: | | |
| cd TShockInstaller | |
| dotnet publish -r ${{ matrix.arch }} -f net9.0 -c Release -p:PublishSingleFile=true --self-contained | |
| - name: Produce build | |
| run: | | |
| cd TShockLauncher | |
| dotnet publish -r ${{ matrix.arch }} -f net9.0 -c Release -p:PublishSingleFile=true --no-self-contained | |
| - name: Chmod scripts | |
| if: ${{ matrix.arch != 'win-x64' }} | |
| run: | | |
| chmod +x TShockLauncher/bin/Release/net9.0/${{ matrix.arch }}/publish/TShock.Server | |
| - name: Copy installer | |
| run: | | |
| cp TShockInstaller/bin/Release/net9.0/${{ matrix.arch }}/publish/* TShockLauncher/bin/Release/net9.0/${{ matrix.arch }}/publish/ | |
| # preserve file perms: https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files | |
| - name: Tarball artifact (non-Windows) | |
| if: ${{ matrix.arch != 'win-x64' }} | |
| run: | | |
| cd TShockLauncher/bin/Release/net9.0/${{ matrix.arch }}/publish/ | |
| tar -cvf ../../../../../../TShock-Beta-${{ matrix.arch }}-Release.tar * | |
| - name: Upload artifact (non-Windows) | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ matrix.arch != 'win-x64' }} | |
| with: | |
| name: TShock-Beta-${{ matrix.arch }}-Release | |
| path: TShock-Beta-${{ matrix.arch }}-Release.tar | |
| - name: Upload artifact (Windows) | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ matrix.arch == 'win-x64' }} | |
| with: | |
| name: TShock-Beta-${{ matrix.arch }}-Release | |
| path: TShockLauncher/bin/Release/net9.0/${{ matrix.arch }}/publish/ |