build.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. name: Build
  15. runs-on: windows-latest
  16. env:
  17. configuration: Debug
  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. run: |
  34. (gc "Plain Craft Launcher 2\Modules\ModSecret.vb") -replace 'Public Const OAuthClientId As String = ""', 'Public Const OAuthClientId As String = "${{ secrets.CLIENT_ID }}"' | Out-File "Plain Craft Launcher 2\Modules\ModSecret.vb"
  35. (gc "Plain Craft Launcher 2\Modules\ModSecret.vb") -replace 'Client.Headers\("x-api-key"\) = ""', 'Client.Headers("x-api-key") = "${{ secrets.CURSEFORGE_API_KEY }}"' | Out-File "Plain Craft Launcher 2\Modules\ModSecret.vb"
  36. (gc "Plain Craft Launcher 2\Modules\ModSecret.vb") -replace 'Request.Headers\("x-api-key"\) = ""', 'Request.Headers("x-api-key") = "${{ secrets.CURSEFORGE_API_KEY }}"' | Out-File "Plain Craft Launcher 2\Modules\ModSecret.vb"
  37. - name: Build
  38. run: msbuild "Plain Craft Launcher 2\Plain Craft Launcher 2.vbproj" -p:Configuration=${{ env.configuration }}
  39. - name: Upload a Build Artifact
  40. uses: actions/upload-artifact@v4
  41. with:
  42. name: ${{ env.configuration }} ${{ env.describe }}
  43. path: ${{ GITHUB.WORKSPACE }}\Plain Craft Launcher 2\obj\Debug\Plain Craft Launcher 2.exe