Skip to content

Commit d86252a

Browse files
committed
add publish yak workflow
1 parent 005e268 commit d86252a

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

.github/workflows/publish_yak.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: publish_yak
2+
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
13+
14+
jobs:
15+
16+
publish_test_yak:
17+
runs-on: windows-latest
18+
19+
steps:
20+
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+
31+
- name: Checkout repo
32+
uses: actions/checkout@v4
33+
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install -r requirements-dev.txt
38+
39+
- name: Create CPython Grasshopper user objects
40+
run: |
41+
invoke build-cpython-ghuser-components
42+
43+
- name: Create IronPython Grasshopper user objects
44+
run: |
45+
choco install ironpython --version=2.7.8.1
46+
invoke clean
47+
invoke build-ghuser-components
48+
49+
- name: Create Rhino7 Yak package
50+
shell: pwsh
51+
run: |
52+
invoke yakerize -m $Env:YAK_TEMPLATE\manifest.yml -l $Env:YAK_TEMPLATE\icon.png -g $Env:USER_OBJECTS -t rh7
53+
env:
54+
USER_OBJECTS: src\compas_fab\ghpython\components\ghuser
55+
YAK_TEMPLATE: src\compas_fab\ghpython\yak_template
56+
57+
- name: Publish to Yak server (Rhino 7)
58+
shell: pwsh
59+
run: |
60+
$test_flag = if ($Env:TEST_FLAG) { $Env:TEST_FLAG } else { "" }
61+
$file = Get-ChildItem -Path dist\yak_package\*rh7*.yak -File | Select-Object -ExpandProperty Name
62+
$command = "invoke publish-yak -y dist\yak_package\$file $test_flag".Trim()
63+
Invoke-Expression $command
64+
env:
65+
YAK_TOKEN: ${{ secrets.YAK_DF_TOKEN }}
66+
67+
- name: Create Rhino8 Yak package
68+
shell: pwsh
69+
run: |
70+
invoke yakerize -m $Env:YAK_TEMPLATE\manifest.yml -l $Env:YAK_TEMPLATE\icon.png -g $Env:USER_OBJECTS -t rh8
71+
env:
72+
USER_OBJECTS: src\compas_fab\ghpython\components_cpython\ghuser
73+
YAK_TEMPLATE: src\compas_fab\ghpython\yak_template
74+
75+
- name: Publish to Yak server (Rhino 8)
76+
shell: pwsh
77+
run: |
78+
$test_flag = if ($Env:TEST_FLAG) { $Env:TEST_FLAG } else { "" }
79+
$file = Get-ChildItem -Path dist\yak_package\*rh8*.yak -File | Select-Object -ExpandProperty Name
80+
$command = "invoke publish-yak -y dist\yak_package\$file $test_flag".Trim()
81+
Invoke-Expression $command
82+
env:
83+
YAK_TOKEN: ${{ secrets.YAK_DF_TOKEN }}

0 commit comments

Comments
 (0)