action.yaml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache
  32. CODESIGN_IDENT: ${{ inputs.codesignIdent }}
  33. CODESIGN_TEAM: ${{ inputs.codesignTeam }}
  34. run: |
  35. : Run macOS Build
  36. local -a build_args=(--config ${{ inputs.config }})
  37. if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
  38. if [[ '${{ inputs.codesign }}' == 'true' ]] build_args+=(--codesign)
  39. .github/scripts/build-macos ${build_args}
  40. - name: Install Dependencies 🛍️
  41. if: runner.os == 'Linux'
  42. shell: bash
  43. run: |
  44. : Install Dependencies 🛍️
  45. echo ::group::Install Dependencies
  46. eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
  47. echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
  48. brew install --quiet zsh
  49. echo ::endgroup::
  50. - name: Run Ubuntu Build
  51. if: runner.os == 'Linux'
  52. shell: zsh --no-rcs --errexit --pipefail {0}
  53. working-directory: ${{ inputs.workingDirectory }}
  54. env:
  55. CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache
  56. run: |
  57. : Run Ubuntu Build
  58. local -a build_args=(
  59. --target ubuntu-${{ inputs.target }}
  60. --config ${{ inputs.config }}
  61. )
  62. if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
  63. .github/scripts/build-ubuntu ${build_args}
  64. - name: Run Windows Build
  65. if: runner.os == 'Windows'
  66. shell: pwsh
  67. run: |
  68. # Run Windows Build
  69. if ( $Env:RUNNER_DEBUG -ne $null ) {
  70. Set-PSDebug -Trace 1
  71. }
  72. $BuildArgs = @{
  73. Target = '${{ inputs.target }}'
  74. Configuration = '${{ inputs.config }}'
  75. }
  76. .github/scripts/Build-Windows.ps1 @BuildArgs
  77. - name: Create Summary 📊
  78. if: contains(fromJSON('["Linux", "macOS"]'),runner.os)
  79. shell: zsh --no-rcs --errexit --pipefail {0}
  80. env:
  81. CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache
  82. run: |
  83. : Create Summary 📊
  84. local -a ccache_data
  85. if (( ${+RUNNER_DEBUG} )) {
  86. setopt XTRACE
  87. ccache_data=("${(fA)$(ccache -s -vv)}")
  88. } else {
  89. ccache_data=("${(fA)$(ccache -s)}")
  90. }
  91. print '### ${{ runner.os }} Ccache Stats (${{ inputs.target }})' >> $GITHUB_STEP_SUMMARY
  92. print '```' >> $GITHUB_STEP_SUMMARY
  93. for line (${ccache_data}) {
  94. print ${line} >> $GITHUB_STEP_SUMMARY
  95. }
  96. print '```' >> $GITHUB_STEP_SUMMARY