11name : publish_yak
22
3- on : workflow_dispatch
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ environment :
7+ description : " Choose deployment environment"
8+ required : true
9+ type : choice
10+ options :
11+ - test
12+ - prod
413
514jobs :
615
918
1019 steps :
1120
21+ - name : Set test flag based on input
22+ shell : pwsh
23+ run : |
24+ if ("${{ github.event.inputs.environment }}" -eq "test") {
25+ echo "TEST_FLAG=--test-server" | Out-File -FilePath $env:GITHUB_ENV -Append
26+ }
27+ else {
28+ echo "TEST_FLAG=" | Out-File -FilePath $env:GITHUB_ENV -Append
29+ }
30+
1231 - name : Checkout repo
1332 uses : actions/checkout@v4
1433
34+ - name : Install dependencies
35+ run : |
36+ python -m pip install --upgrade pip
37+ pip install .[dev]
38+
1539 - name : Create CPython Grasshopper user objects
1640 run : |
1741 invoke build-cpython-ghuser-components
@@ -25,31 +49,31 @@ jobs:
2549 - name : Create Rhino7 Yak package
2650 shell : pwsh
2751 run : |
28- invoke yakerize -m $YAK_TEMPLATE\manifest.yml -l $YAK_TEMPLATE\icon.png -g $USER_OBJECTS -t rh7
52+ invoke yakerize -m $Env: YAK_TEMPLATE\manifest.yml -l $Env: YAK_TEMPLATE\icon.png -g $Env: USER_OBJECTS -t rh7
2953 env :
3054 USER_OBJECTS : src\compas_ghpython\components\ghuser
3155 YAK_TEMPLATE : src\compas_ghpython\yak_template
3256
33- - name : Create Rhino8 Yak package
57+ - name : Publish to Yak server (Rhino 7)
3458 shell : pwsh
3559 run : |
36- invoke yakerize -m $YAK_TEMPLATE\manifest.yml -l $YAK_TEMPLATE\icon.png -g $USER_OBJECTS -t rh8
60+ $file = Get-ChildItem -Path dist\yak_package\*rh7*.yak -File | Select-Object -ExpandProperty Name
61+ invoke publish-yak $Env:TEST_FLAG -y dist\yak_package\$file
3762 env :
38- USER_OBJECTS : src\compas_ghpython\components_cpython\ghuser
39- YAK_TEMPLATE : src\compas_ghpython\yak_template
63+ YAK_TOKEN : ${{ secrets.YAK_DF_TOKEN }}
4064
41- - name : Publish to Yak test server (Rhino 7)
65+ - name : Create Rhino8 Yak package
4266 shell : pwsh
4367 run : |
44- $file = Get-ChildItem -Path dist\yak_package\*rh7*.yak -File | Select-Object -ExpandProperty Name
45- invoke publish-yak --test-server -y $file
68+ invoke yakerize -m $Env:YAK_TEMPLATE\manifest.yml -l $Env:YAK_TEMPLATE\icon.png -g $Env:USER_OBJECTS -t rh8
4669 env :
47- YAK_TOKEN : ${{ secrets.YAK_DF_TOKEN }}
70+ USER_OBJECTS : src\compas_ghpython\components_cpython\ghuser
71+ YAK_TEMPLATE : src\compas_ghpython\yak_template
4872
49- - name : Publish to Yak test server (Rhino 8)
73+ - name : Publish to Yak server (Rhino 8)
5074 shell : pwsh
5175 run : |
5276 $file = Get-ChildItem -Path dist\yak_package\*rh8*.yak -File | Select-Object -ExpandProperty Name
53- invoke publish-yak --test-server -y $file
77+ invoke publish-yak $Env:TEST_FLAG -y dist\yak_package\ $file
5478 env :
5579 YAK_TOKEN : ${{ secrets.YAK_DF_TOKEN }}
0 commit comments