action.yml 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. name: 'Setup GDK (Game Development Kit) for Windows Desktop'
  2. description: 'Download GDK and install into MSBuild'
  3. inputs:
  4. # Keep edition and ref in sync!
  5. edition:
  6. description: 'GDK edition'
  7. default: '240601' # YYMMUU (Year Month Update)
  8. ref:
  9. description: 'Git reference'
  10. default: 'June_2024_Update_1'
  11. folder:
  12. description: 'Folder where to create Directory.Build.props'
  13. required: true
  14. default: '${{ github.workspace }}'
  15. runs:
  16. using: 'composite'
  17. steps:
  18. - uses: actions/setup-python@main
  19. with:
  20. python-version: 3.x
  21. - name: 'Calculate variables'
  22. id: calc
  23. shell: pwsh
  24. run: |
  25. $vs_folder=@(vswhere -latest -property installationPath)
  26. echo "vs-folder=${vs_folder}" >> $Env:GITHUB_OUTPUT
  27. echo "gdk-path=${{ runner.temp }}\GDK-${{ inputs.edition }}" >> $Env:GITHUB_OUTPUT
  28. echo "cache-key=gdk-${{ inputs.ref }}-${{ inputs.edition }}" >> $Env:GITHUB_OUTPUT
  29. - name: 'Restore cached GDK'
  30. id: cache-restore
  31. uses: actions/cache/restore@v4
  32. with:
  33. path: '${{ steps.calc.outputs.gdk-path }}'
  34. key: ${{ steps.calc.outputs.cache-key }}
  35. - name: 'Download GDK'
  36. if: ${{ !steps.cache-restore.outputs.cache-hit }}
  37. shell: pwsh
  38. run: |
  39. python build-scripts/setup-gdk-desktop.py `
  40. --download `
  41. --temp-folder "${{ runner.temp }}" `
  42. --gdk-path="${{ steps.calc.outputs.gdk-path }}" `
  43. --ref-edition "${{ inputs.ref }},${{ inputs.edition }}" `
  44. --vs-folder="${{ steps.calc.outputs.vs-folder }}" `
  45. --no-user-props
  46. - name: 'Extract GDK'
  47. if: ${{ !steps.cache-restore.outputs.cache-hit }}
  48. shell: pwsh
  49. run: |
  50. python build-scripts/setup-gdk-desktop.py `
  51. --extract `
  52. --ref-edition "${{ inputs.ref }},${{ inputs.edition }}" `
  53. --temp-folder "${{ runner.temp }}" `
  54. --gdk-path="${{ steps.calc.outputs.gdk-path }}" `
  55. --vs-folder="${{ steps.calc.outputs.vs-folder }}" `
  56. --no-user-props
  57. - name: 'Cache GDK'
  58. if: ${{ !steps.cache-restore.outputs.cache-hit }}
  59. uses: actions/cache/save@v4
  60. with:
  61. path: '${{ steps.calc.outputs.gdk-path }}'
  62. key: ${{ steps.calc.outputs.cache-key }}
  63. - name: 'Copy MSBuild files into GDK'
  64. shell: pwsh
  65. run: |
  66. python build-scripts/setup-gdk-desktop.py `
  67. --ref-edition "${{ inputs.ref }},${{ inputs.edition }}" `
  68. --gdk-path="${{ steps.calc.outputs.gdk-path }}" `
  69. --vs-folder="${{ steps.calc.outputs.vs-folder }}" `
  70. --copy-msbuild `
  71. --no-user-props
  72. - name: 'Write user props'
  73. shell: pwsh
  74. run: |
  75. python build-scripts/setup-gdk-desktop.py `
  76. --ref-edition "${{ inputs.ref }},${{ inputs.edition }}" `
  77. --temp-folder "${{ runner.temp }}" `
  78. --vs-folder="${{ steps.calc.outputs.vs-folder }}" `
  79. --gdk-path="${{ steps.calc.outputs.gdk-path }}" `
  80. "--props-folder=${{ inputs.folder }}"