-
Notifications
You must be signed in to change notification settings - Fork 6
/
action.yml
44 lines (42 loc) · 1.33 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: 'Grasshopper componentizer'
description: 'Create GHUser components from Python source code'
inputs:
source:
description: 'Source directory where code for all components is stored'
required: true
target:
description: 'Target directory for ghuser files'
required: true
prefix:
description: 'Add this prefix to the name of each generated component'
required: false
interpreter:
description: 'Python interpreter to use: ironpython, or cpython'
required: false
default: 'ironpython'
runs:
using: 'composite'
steps:
- name: Install Grasshopper
run: nuget install Grasshopper -OutputDirectory ./lib -source https://api.nuget.org/v3/index.json
shell: pwsh
- name: Launch componentizer
run: |
if ("${{ inputs.interpreter }}" -eq "cpython") {
$command="python"
$componentizer="${{ github.action_path }}/componentize_cpy.py"
} else {
$command="ipy"
$componentizer="${{ github.action_path }}/componentize_ipy.py"
}
$params=$componentizer, "${{ inputs.source }}", "${{ inputs.target }}", "--ghio", "./lib"
$prefix="${{ inputs.prefix }}"
if( $prefix )
{
$params=$params + "--prefix", "$prefix"
}
& $command $params
shell: pwsh
branding:
icon: 'box'
color: 'orange'