action.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. name: 'CIPD install'
  2. description: 'Installs the specified CIPD package'
  3. inputs:
  4. cipd-root-prefix-path:
  5. description: 'Path to prepend to installation directory'
  6. default: ''
  7. dependency:
  8. description: 'Name of dependency to install'
  9. deps-file:
  10. description: 'Location of DEPS file that defines the dependency'
  11. installation-dir:
  12. description: 'Location to install dependency'
  13. target-platform:
  14. description: 'Target platform, should be linux, win, macos'
  15. package:
  16. description: 'Package to install'
  17. runs:
  18. using: "composite"
  19. steps:
  20. - name: Delete wrong ${{ inputs.dependency }}
  21. shell: bash
  22. run : |
  23. rm -rf ${{ inputs.cipd-root-prefix-path }}${{ inputs.installation-dir }}
  24. - name: Create ensure file for ${{ inputs.dependency }}
  25. shell: bash
  26. run: |
  27. echo '${{ inputs.package }}' `e d gclient getdep --deps-file=${{ inputs.deps-file }} -r '${{ inputs.installation-dir }}:${{ inputs.package }}'` > ${{ inputs.dependency }}_ensure_file
  28. cat ${{ inputs.dependency }}_ensure_file
  29. - name: CIPD installation of ${{ inputs.dependency }} (macOS)
  30. if: ${{ inputs.target-platform == 'macos' }}
  31. shell: bash
  32. run: |
  33. echo "ensuring ${{ inputs.dependency }} on macOS"
  34. e d cipd ensure --root ${{ inputs.cipd-root-prefix-path }}${{ inputs.installation-dir }} -ensure-file ${{ inputs.dependency }}_ensure_file
  35. - name: CIPD installation of ${{ inputs.dependency }} (Windows)
  36. if: ${{ inputs.target-platform == 'win' }}
  37. shell: powershell
  38. run: |
  39. echo "ensuring ${{ inputs.dependency }} on Windows"
  40. e d cipd ensure --root ${{ inputs.cipd-root-prefix-path }}${{ inputs.installation-dir }} -ensure-file ${{ inputs.dependency }}_ensure_file