action.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. name: 'Package plugin'
  2. description: 'Packages the plugin for specified architecture and build config.'
  3. inputs:
  4. target:
  5. description: 'Build target for dependencies'
  6. required: true
  7. config:
  8. description: 'Build configuration'
  9. required: false
  10. default: 'Release'
  11. codesign:
  12. description: 'Enable codesigning (macOS only)'
  13. required: false
  14. default: 'false'
  15. notarize:
  16. description: 'Enable notarization (macOS only)'
  17. required: false
  18. default: 'false'
  19. codesignIdent:
  20. description: 'Developer ID for application codesigning (macOS only)'
  21. required: false
  22. default: '-'
  23. installerIdent:
  24. description: 'Developer ID for installer package codesigning (macOS only)'
  25. required: false
  26. default: ''
  27. codesignUser:
  28. description: 'Apple ID username for notarization (macOS only)'
  29. required: false
  30. default: ''
  31. codesignPass:
  32. description: 'Apple ID password for notarization (macOS only)'
  33. required: false
  34. default: ''
  35. createInstaller:
  36. description: 'Create InnoSetup installer (Windows only)'
  37. required: false
  38. default: 'false'
  39. workingDirectory:
  40. description: 'Working directory for packaging'
  41. required: false
  42. default: ${{ github.workspace }}
  43. runs:
  44. using: 'composite'
  45. steps:
  46. - name: Run macOS packaging
  47. if: ${{ runner.os == 'macOS' }}
  48. shell: zsh {0}
  49. env:
  50. CODESIGN_IDENT: ${{ inputs.codesignIdent }}
  51. CODESIGN_IDENT_INSTALLER: ${{ inputs.installerIdent }}
  52. CODESIGN_IDENT_USER: ${{ inputs.codesignUser }}
  53. CODESIGN_IDENT_PASS: ${{ inputs.codesignPass }}
  54. run: |
  55. package_args=(
  56. -c ${{ inputs.config }}
  57. -t macos-${{ inputs.target }}
  58. )
  59. if [[ '${{ inputs.codesign }}' == 'true' ]] package_args+=(-s)
  60. if [[ '${{ inputs.notarize }}' == 'true' ]] package_args+=(-n)
  61. if (( ${+CI} && ${+RUNNER_DEBUG} )) build_args+=(--debug)
  62. ${{ inputs.workingDirectory }}/.github/scripts/package-macos.zsh ${package_args}
  63. - name: Run Linux packaging
  64. if: ${{ runner.os == 'Linux' }}
  65. shell: bash
  66. run: |
  67. package_args=(
  68. -c ${{ inputs.config }}
  69. -t linux-${{ inputs.target }}
  70. )
  71. if [[ -n "${CI}" && -n "${RUNNER_DEBUG}" ]]; then
  72. build_args+=(--debug)
  73. fi
  74. ${{ inputs.workingDirectory }}/.github/scripts/package-linux.sh "${package_args[@]}"
  75. - name: Run Windows packaging
  76. if: ${{ runner.os == 'Windows' }}
  77. shell: pwsh
  78. run: |
  79. $PackageArgs = @{
  80. Target = '${{ inputs.target }}'
  81. Configuration = '${{ inputs.config }}'
  82. }
  83. if ( '${{ inputs.createInstaller }}' -eq 'true' ) {
  84. $PackageArgs += @{BuildInstaller = $true}
  85. }
  86. if ( ( Test-Path env:CI ) -and ( Test-Path env:RUNNER_DEBUG ) ) {
  87. $BuildArgs += @{
  88. Debug = $true
  89. }
  90. }
  91. ${{ inputs.workingDirectory }}/.github/scripts/Package-Windows.ps1 @PackageArgs