Skip to content

Commit c98912c

Browse files
authored
Merge pull request #1431 from compas-dev/publish_yak
Publish yak
2 parents a4bcda9 + fc88ea5 commit c98912c

File tree

2 files changed

+39
-12
lines changed

2 files changed

+39
-12
lines changed

.github/workflows/publish_yak.yml

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
name: 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

514
jobs:
615

@@ -9,9 +18,24 @@ jobs:
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 }}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Changed
1313

14+
* Fixed publish to YAK via CI workflow.
15+
* Added selector for `test` and `prod` to CI workflow.
16+
1417
### Removed
1518

1619

0 commit comments

Comments
 (0)