|
| 1 | +name: deploy |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: [main] |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + runs-on: windows-latest |
| 8 | + steps: |
| 9 | + - uses: actions/checkout@v6 |
| 10 | + - name: Setup .NET Core |
| 11 | + uses: actions/setup-dotnet@v5 |
| 12 | + with: |
| 13 | + dotnet-version: 8.0.x |
| 14 | + # FIXME: .github/preProcess/AvaloniaEnvConfig.csx not yet ported from THUAI8 |
| 15 | + # - name: Setup dotnet-script |
| 16 | + # run: dotnet tool install --global dotnet-script |
| 17 | + # - name: Pre-Process |
| 18 | + # run: dotnet script .github/preProcess/AvaloniaEnvConfig.csx |
| 19 | + - name: Install Workloads |
| 20 | + run: dotnet workload install maui-windows |
| 21 | + - name: Create Folders |
| 22 | + run: | |
| 23 | + mkdir D:\a\installer |
| 24 | + mkdir D:\a\publish |
| 25 | + - name: Copy THUAI9 |
| 26 | + run: Copy-Item -recurse D:\a\THUAI9\THUAI9\ D:\a\mirror\ |
| 27 | + - name: Remove directories not needed |
| 28 | + run: | |
| 29 | + Remove-Item -recurse -force D:\a\mirror\.git |
| 30 | + Remove-Item -recurse D:\a\mirror\.github |
| 31 | + Remove-Item -recurse D:\a\mirror\installer |
| 32 | + Remove-Item -recurse D:\a\mirror\interface |
| 33 | + Remove-Item -recurse D:\a\mirror\logic |
| 34 | + Remove-Item -recurse D:\a\mirror\resource |
| 35 | + Remove-Item -recurse D:\a\mirror\LICENSE |
| 36 | + Remove-Item -recurse D:\a\mirror\.clang-format |
| 37 | + Remove-Item -recurse D:\a\mirror\.editorconfig |
| 38 | + Remove-Item -recurse D:\a\mirror\.gitattributes |
| 39 | + Remove-Item -recurse D:\a\mirror\.gitignore |
| 40 | + Remove-Item -recurse D:\a\mirror\renovate.json |
| 41 | + Remove-Item -recurse D:\a\mirror\CODE_OF_CONDUCT.md |
| 42 | + Remove-Item -recurse D:\a\mirror\CONTRIBUTING.md |
| 43 | + Remove-Item -recurse D:\a\mirror\README.md |
| 44 | + Remove-Item -recurse D:\a\mirror\SECURITY.md |
| 45 | + - name: Build Server |
| 46 | + run: | |
| 47 | + mkdir D:\a\mirror\logic |
| 48 | + dotnet build "./logic/Server/Server.csproj" -o "D:\a\mirror\logic\Server" -p:WindowsAppSDKSelfContained=true -c Release |
| 49 | + - name: Build installer |
| 50 | + 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 |
| 51 | + - name: Build debug_interface |
| 52 | + run: dotnet publish interface/AvaloniaUI/THUAI9_Avalonia.csproj -r win-x64 -c Release -o "D:\a\mirror\logic\Client" |
| 53 | + - name: Create tar.gz archive |
| 54 | + run: | |
| 55 | + cd D:\a |
| 56 | + tar -czf THUAI9.tar.gz -C mirror . |
| 57 | + - name: package tar.gz |
| 58 | + uses: actions/upload-artifact@v4 |
| 59 | + with: |
| 60 | + name: THUAI9.tar.gz |
| 61 | + path: D:\a\THUAI9.tar.gz |
| 62 | + - name: package installer |
| 63 | + uses: actions/upload-artifact@v4 |
| 64 | + with: |
| 65 | + name: installer |
| 66 | + path: D:\a\publish\ |
| 67 | + env: |
| 68 | + INSTALLER_COS_SECRET_ID: ${{ secrets.INSTALLER_COS_SECRET_ID }} |
| 69 | + INSTALLER_COS_SECRET_KEY: ${{ secrets.INSTALLER_COS_SECRET_KEY }} |
0 commit comments