-
Notifications
You must be signed in to change notification settings - Fork 23
52 lines (45 loc) · 1.56 KB
/
publish_yak.yml
File metadata and controls
52 lines (45 loc) · 1.56 KB
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
45
46
47
48
49
50
51
52
name: publish_yak
on:
workflow_dispatch:
inputs:
environment:
description: "Choose deployment environment"
required: true
type: choice
options:
- test
- prod
jobs:
publish_yak:
runs-on: windows-latest
steps:
- name: Set test flag based on input
shell: pwsh
run: |
if ("${{ github.event.inputs.environment }}" -eq "test") {
echo "TEST_FLAG=--test-server" | Out-File -FilePath $env:GITHUB_ENV -Append
} else {
echo "TEST_FLAG=" | Out-File -FilePath $env:GITHUB_ENV -Append
}
- name: Checkout repo
uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Create Rhino 8 Yak package
shell: pwsh
run: |
invoke yakerize -m $Env:YAK_TEMPLATE\manifest.yml -l $Env:YAK_TEMPLATE\icon.png -g $Env:USER_OBJECTS -t rh8
env:
USER_OBJECTS: src\compas_slicer_ghpython\gh_components
YAK_TEMPLATE: src\compas_slicer_ghpython\yak_template
- name: Publish to Yak server (Rhino 8)
shell: pwsh
run: |
$test_flag = if ($Env:TEST_FLAG) { $Env:TEST_FLAG } else { "" }
$file = Get-ChildItem -Path dist\yak_package\*rh8*.yak -File | Select-Object -ExpandProperty Name
$command = "invoke publish-yak -y dist\yak_package\$file $test_flag".Trim()
Invoke-Expression $command
env:
YAK_TOKEN: ${{ secrets.YAK_TOKEN }}