action.yaml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. name: 'Set up and build plugin'
  2. description: 'Builds the plugin for specified architecture and build config'
  3. inputs:
  4. target:
  5. description: 'Target architecture for dependencies'
  6. required: true
  7. config:
  8. description: 'Build configuration'
  9. required: false
  10. default: 'RelWithDebInfo'
  11. codesign:
  12. description: 'Enable codesigning (macOS only)'
  13. required: false
  14. default: 'false'
  15. codesignIdent:
  16. description: 'Developer ID for application codesigning (macOS only)'
  17. required: false
  18. default: '-'
  19. workingDirectory:
  20. description: 'Working directory for packaging'
  21. required: false
  22. default: ${{ github.workspace }}
  23. runs:
  24. using: composite
  25. steps:
  26. - name: Run macOS Build
  27. if: runner.os == 'macOS'
  28. shell: zsh --no-rcs --errexit --pipefail {0}
  29. working-directory: ${{ inputs.workingDirectory }}
  30. env:
  31. CODESIGN_IDENT: ${{ inputs.codesignIdent }}
  32. CODESIGN_TEAM: ${{ inputs.codesignTeam }}
  33. run: |
  34. : Run macOS Build
  35. local -a build_args=(--config ${{ inputs.config }})
  36. if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
  37. if [[ '${{ inputs.codesign }}' == 'true' ]] build_args+=(--codesign)
  38. .github/scripts/build-macos ${build_args}
  39. - name: Install Dependencies 🛍️
  40. if: runner.os == 'Linux'
  41. shell: bash
  42. run: |
  43. : Install Dependencies 🛍️
  44. echo ::group::Install Dependencies
  45. eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
  46. echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
  47. brew install --quiet zsh
  48. echo ::endgroup::
  49. - name: Run Ubuntu Build
  50. if: runner.os == 'Linux'
  51. shell: zsh --no-rcs --errexit --pipefail {0}
  52. working-directory: ${{ inputs.workingDirectory }}
  53. run: |
  54. : Run Ubuntu Build
  55. local -a build_args=(
  56. --target linux-${{ inputs.target }}
  57. --config ${{ inputs.config }}
  58. )
  59. if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
  60. .github/scripts/build-linux ${build_args}
  61. - name: Run Windows Build
  62. if: runner.os == 'Windows'
  63. shell: pwsh
  64. run: |
  65. # Run Windows Build
  66. if ( $Env:RUNNER_DEBUG -ne $null ) {
  67. Set-PSDebug -Trace 1
  68. }
  69. $BuildArgs = @{
  70. Target = '${{ inputs.target }}'
  71. Configuration = '${{ inputs.config }}'
  72. }
  73. .github/scripts/Build-Windows.ps1 @BuildArgs
  74. - name: Create Summary 📊
  75. if: contains(fromJSON('["Linux", "macOS"]'),runner.os)
  76. shell: zsh --no-rcs --errexit --pipefail {0}
  77. env:
  78. CCACHE_CONFIGPATH: ${{ inputs.workingDirectory }}/.ccache.conf
  79. run: |
  80. : Create Summary 📊
  81. local -a ccache_data
  82. if (( ${+RUNNER_DEBUG} )) {
  83. setopt XTRACE
  84. ccache_data=("${(fA)$(ccache -s -vv)}")
  85. } else {
  86. ccache_data=("${(fA)$(ccache -s)}")
  87. }
  88. print '### ${{ runner.os }} Ccache Stats (${{ inputs.target }})' >> $GITHUB_STEP_SUMMARY
  89. print '```' >> $GITHUB_STEP_SUMMARY
  90. for line (${ccache_data}) {
  91. print ${line} >> $GITHUB_STEP_SUMMARY
  92. }
  93. print '```' >> $GITHUB_STEP_SUMMARY