Skip to content

publish_yak

publish_yak #2

Workflow file for this run

name: publish_yak
on:
workflow_dispatch:
inputs:
environment:
description: "Choose deployment environment"
required: true
type: choice
options:
- test
- prod
jobs:
publish_test_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 -e .[dev]
- name: Create CPython Grasshopper user objects
run: |
invoke build-cpython-ghuser-components
- name: Create Rhino8 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_eve\ghpython\components\ghuser
YAK_TEMPLATE: src\compas_eve\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_DF_TOKEN }}