Skip to content

Commit

Permalink
Deploy to Yak job added
Browse files Browse the repository at this point in the history
  • Loading branch information
leceta committed Aug 7, 2024
1 parent 0607969 commit 16afa1a
Showing 1 changed file with 70 additions and 3 deletions.
73 changes: 70 additions & 3 deletions .github/workflows/grasshopper_plugin.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: Grasshopper Plugin Build
name: "Grasshopper Plugin Build & Deploy to Yak"

on:
push:
branches:
- main
tags:
- '*'

jobs:
build:
runs-on: [ windows-2019 ]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout Repo
uses: actions/checkout@v3
Expand All @@ -21,7 +22,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: Tapir Grasshopper Plugin
path: grasshopper-plugin/bin/tapir_gh.ghpy
path: grasshopper-plugin/bin/tapir_gh.ghpy
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: ncipollo/release-action@v1
Expand All @@ -30,3 +31,69 @@ jobs:
draft: true
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}

deploy:
runs-on: windows-latest
environment: tapir
needs: build
if: startsWith(github.ref, 'refs/tags/')

steps:
- name: checkout
uses: actions/checkout@v3.2.0

- name: setup yak
uses: paramdigma/setup-yak@1.0.0
with:
token: ${{secrets.YAK_TOKEN}}

- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: Tapir Grasshopper Plugin
path: grasshopper-plugin/bin

- name: Copy Image to Destination
run: |
Copy-Item -Path "../../branding/logo/png/tapir_logo_black_512.png" -Destination "./tapir_logo_black_512.png"
working-directory: grasshopper-plugin\bin
shell: pwsh

- name: Create Yak manifest
run: |
yak spec
Add-Content manifest.yml "icon: tapir_logo_black_512.png"
(Get-Content -Path "./manifest.yml") -replace '<version>', '${{ github.ref_name }}' | Set-Content -Path "./manifest.yml"
(Get-Content -Path "./manifest.yml") -replace '<name>', 'Tapir' | Set-Content -Path "./manifest.yml"
(Get-Content -Path "./manifest.yml") -replace '<author>', 'Tapir Community' | Set-Content -Path "./manifest.yml"
(Get-Content -Path "./manifest.yml") -replace '<description>', 'A toolset for Archicad automatization.' | Set-Content -Path "./manifest.yml"
(Get-Content -Path "./manifest.yml") -replace '<url>', '"https://www.archicad-api.com/"' | Set-Content -Path "./manifest.yml"
working-directory: grasshopper-plugin\bin

- name: Print YAML File Content
run: |
Get-Content -Path "grasshopper-plugin/bin/manifest.yml" -Raw
shell: pwsh

- name: Build YAK package
run: yak build
working-directory: grasshopper-plugin\bin

- name: Find yak file
run: |
Get-ChildItem -Path .
$yakFile = Get-ChildItem -Path . *.yak -Recurse | Select-Object -First 1
if ($yakFile -eq $null) {
Write-Error "No .yak file found."
exit 1
}
$env:YAK_FILE = $yakFile.FullName
echo "YAK_FILE=$env:YAK_FILE" >> $env:GITHUB_ENV
working-directory: grasshopper-plugin\bin

- name: deploy to yak server
run: |
yak push $env:YAK_FILE
#yak push --source https://test.yak.rhino3d.com $env:YAK_FILE
env:
YAK_TOKEN: ${{ secrets.YAK_TOKEN }}

0 comments on commit 16afa1a

Please sign in to comment.