Merge pull request #173 from eesast/dev #16
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: deploy | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup .NET Core | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 8.0.x | |
| # FIXME: .github/preProcess/AvaloniaEnvConfig.csx not yet ported from THUAI8 | |
| # - name: Setup dotnet-script | |
| # run: dotnet tool install --global dotnet-script | |
| # - name: Pre-Process | |
| # run: dotnet script .github/preProcess/AvaloniaEnvConfig.csx | |
| - name: Install Workloads | |
| run: dotnet workload install maui-windows | |
| - name: Create Folders | |
| run: | | |
| mkdir D:\a\installer | |
| mkdir D:\a\publish | |
| - name: Copy THUAI9 | |
| run: Copy-Item -recurse D:\a\THUAI9\THUAI9\ D:\a\mirror\ | |
| - name: Remove directories not needed | |
| run: | | |
| Remove-Item -recurse -force D:\a\mirror\.git | |
| Remove-Item -recurse D:\a\mirror\.github | |
| Remove-Item -recurse D:\a\mirror\installer | |
| Remove-Item -recurse D:\a\mirror\interface | |
| Remove-Item -recurse D:\a\mirror\logic | |
| Remove-Item -recurse D:\a\mirror\resource | |
| Remove-Item -recurse D:\a\mirror\LICENSE | |
| Remove-Item -recurse D:\a\mirror\.clang-format | |
| Remove-Item -recurse D:\a\mirror\.editorconfig | |
| Remove-Item -recurse D:\a\mirror\.gitattributes | |
| Remove-Item -recurse D:\a\mirror\.gitignore | |
| Remove-Item -recurse D:\a\mirror\renovate.json | |
| Remove-Item -recurse D:\a\mirror\CODE_OF_CONDUCT.md | |
| Remove-Item -recurse D:\a\mirror\CONTRIBUTING.md | |
| Remove-Item -recurse D:\a\mirror\README.md | |
| Remove-Item -recurse D:\a\mirror\SECURITY.md | |
| - name: Build Server | |
| run: | | |
| mkdir D:\a\mirror\logic | |
| dotnet build "./logic/Server/Server.csproj" -o "D:\a\mirror\logic\Server" -p:WindowsAppSDKSelfContained=true -c Release | |
| - name: Build installer | |
| run: dotnet publish "./installer/installer.csproj" -o "D:\a\publish" -f net8.0-windows10.0.19041.0 -c Release -p:RuntimeIdentifierOverride=win10-x64 -p:WindowsPackageType=None -p:WindowsAppSDKSelfContained=true | |
| - name: Build debug_interface | |
| run: dotnet publish interface/AvaloniaUI/THUAI9_Avalonia.csproj -r win-x64 -c Release -o "D:\a\mirror\logic\Client" | |
| - name: Create tar.gz archive | |
| run: | | |
| cd D:\a | |
| tar -czf THUAI9.tar.gz -C mirror . | |
| - name: package tar.gz | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: THUAI9.tar.gz | |
| path: D:\a\THUAI9.tar.gz | |
| - name: package installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: installer | |
| path: D:\a\publish\ | |
| env: | |
| INSTALLER_COS_SECRET_ID: ${{ secrets.INSTALLER_COS_SECRET_ID }} | |
| INSTALLER_COS_SECRET_KEY: ${{ secrets.INSTALLER_COS_SECRET_KEY }} |