build.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. name: Build
  2. on:
  3. push:
  4. paths:
  5. - 'Plain Craft Launcher 2/**'
  6. - '.github/workflows/**'
  7. pull_request:
  8. paths:
  9. - 'Plain Craft Launcher 2/**'
  10. - '.github/workflows/**'
  11. workflow_dispatch:
  12. jobs:
  13. build:
  14. strategy:
  15. matrix:
  16. configuration: [Debug, Release, Snapshot, BETA, ReleaseUpdate]
  17. runs-on: windows-latest
  18. steps:
  19. - name: Checkout
  20. uses: actions/checkout@v4
  21. with:
  22. fetch-depth: 0
  23. - name: Set Describe
  24. shell: bash
  25. run: |
  26. Describe=`git describe --tags --always`
  27. echo "Describe=$Describe" >> $GITHUB_ENV
  28. - name: Setup MSBuild.exe
  29. uses: microsoft/setup-msbuild@v2
  30. with:
  31. msbuild-architecture: x64
  32. - name: Replace
  33. shell: powershell
  34. env:
  35. client_id: ${{ secrets.client_id }}
  36. x-api-key: ${{ secrets.x_api_key }}
  37. run: |
  38. (gc "Plain Craft Launcher 2\Modules\ModSecret.vb") -replace '$client_id', | Out-File "Plain Craft Launcher 2\Modules\ModSecret.vb"
  39. (gc "Plain Craft Launcher 2\Modules\ModSecret.vb") -replace 'Client.Headers("x-api-key") = ""', '"Client.Headers("x-api-key") = ""' | Out-File "Plain Craft Launcher 2\Modules\ModSecret.vb"
  40. (gc "Plain Craft Launcher 2\Modules\ModSecret.vb") -replace '$client_id', | Out-File "Plain Craft Launcher 2\Modules\ModSecret.vb"
  41. - name: Build
  42. run: msbuild "Plain Craft Launcher 2\Plain Craft Launcher 2.vbproj" -p:Configuration=${{ matrix.configuration }}
  43. - name: Upload a Build Artifact
  44. uses: actions/upload-artifact@v4
  45. with:
  46. name: ${{ matrix.configuration }} ${{ env.Describe }}
  47. path: Plain Craft Launcher 2\obj\${{ matrix.configuration }}\Plain Craft Launcher 2.exe