Skip to content

Commit

Permalink
Updated workflowtemplate.
Browse files Browse the repository at this point in the history
  • Loading branch information
deluxe2 committed May 20, 2023
1 parent 5f964e8 commit 76a7f30
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 deletions.
3 changes: 1 addition & 2 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ paths:
"author": "Arne Lüdtke (DMXControl)",
"license": "MIT",
"icon-url": "https://raw.githubusercontent.com/DMXControl/3Dconnexion-dmxc3-plugin/master/3DxIcon.png",
"details": "https://DMXControl.github.io/DMXCPluginLibrary/plugins/3dconnexion.json"
}]}
"details": "https://DMXControl.github.io/DMXCPluginLibrary/plugins/3dconnexion.json" }]}
/plugins/{pluginname}.json:
get:
Expand Down
45 changes: 18 additions & 27 deletions workflowtemplate.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Build DMXControl Plugin

env:
Expand All @@ -12,7 +11,7 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup MSBuild
uses: microsoft/[email protected]
Expand All @@ -25,18 +24,17 @@ jobs:

- name: Download and extract DMXCDependencies
run: |
If(Test-Path -Path dmxcplug.json) {
$dmxcplug = (Get-Content "dmxcplug.json" | ConvertFrom-Json)
Invoke-RestMethod -Uri "https://www.dmxcontrol.de/files/DMXControl_3/plugin-lib/dmxc-plugin-lib-$($dmxcplug.version).zip" -OutFile "deps.zip"
Expand-Archive "deps.zip" "bin/Release"
Expand-Archive "deps.zip" "temp"
}
foreach ($folder in Get-ChildItem -Directory) {
If(Test-Path -Path $folder/dmxcplug.json) {
$dmxcplug = (Get-Content "${folder}/dmxcplug.json" | ConvertFrom-Json)
Invoke-RestMethod -Uri "https://www.dmxcontrol.de/files/DMXControl_3/plugin-lib/dmxc-plugin-lib-$($dmxcplug.version).zip" -OutFile "deps.zip"
Expand-Archive "deps.zip" "${folder}/bin/Release"
Expand-Archive "deps.zip" "${folder}/temp"
foreach ($folder in (Get-ChildItem -Filter dmxcplug.json -Recurse -Depth 1).DirectoryName) {
$dmxcplugver = (Get-Content "${folder}/dmxcplug.json" | ConvertFrom-Json).version
$dmxctypes = (Get-Content "${folder}/dmxcplug.json" | ConvertFrom-Json).type
$dmxczip = "deps-${dmxcplugver}.zip"
If(-Not (Test-Path -Path "${dmxczip}")) {
Invoke-RestMethod -Uri "https://www.dmxcontrol.de/files/DMXControl_3/plugin-lib/dmxc-plugin-lib-${dmxcplugver}.zip" -OutFile "${dmxczip}"
}
Expand-Archive "${dmxczip}" "${folder}/temp"
New-Item -ItemType Directory -Force -Path "${folder}/bin/Release"
foreach ($type in $dmxctypes){
Copy-Item -Path "${folder}/temp/${type}/*" -Destination "${folder}/bin/Release"
}
}
Expand All @@ -51,23 +49,16 @@ jobs:
- name: Copy Artifacts
run: |
If(Test-Path -Path dmxcplug.json) {
$dmxcplug = (Get-Content "dmxcplug.json" | ConvertFrom-Json)
$filter = Get-ChildItem "temp/" -Name
foreach($type in $dmxcplug.type) { New-Item -ItemType "directory" -Path "dist/${type}/${{env.PluginName}}" }
foreach($type in $dmxcplug.type) { Get-ChildItem "bin/Release" -Name | where {$filter -NotContains $_} | %{ Copy-Item -Path "bin/Release/${_}" -Destination "dist/${type}/${{env.PluginName}}/${_}"} }
}
foreach ($folder in Get-ChildItem -Directory) {
If(Test-Path -Path $folder/dmxcplug.json) {
$dmxcplug = (Get-Content "${folder}/dmxcplug.json" | ConvertFrom-Json)
$filter = Get-ChildItem "${folder}/temp/" -Name
foreach($type in $dmxcplug.type) { New-Item -ItemType "directory" -Path "dist/${type}/${{env.PluginName}}" }
foreach($type in $dmxcplug.type) { Get-ChildItem "${folder}/bin/Release" -Name | where {$filter -NotContains $_} | %{ Copy-Item -Path "${folder}/bin/Release/${_}" -Destination "dist/${type}/${{env.PluginName}}/${_}"} }
foreach ($folder in (Get-ChildItem -Filter dmxcplug.json -Recurse -Depth 1).DirectoryName) {
foreach($type in (Get-Content "${folder}/dmxcplug.json" | ConvertFrom-Json).type) {
$filter = Get-ChildItem "${folder}/temp/${type}" -Name
New-Item -ItemType "directory" -Path "dist/${type}/${{env.PluginName}}"
Get-ChildItem "${folder}/bin/Release" -Name | where {$filter -NotContains $_} | %{ Copy-Item -Path "${folder}/bin/Release/${_}" -Destination "dist/${type}/${{env.PluginName}}/${_}"}
}
}
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
uses: actions/upload-artifact@v3
with:
name: DllBundle
path: "dist"
Expand Down

0 comments on commit 76a7f30

Please sign in to comment.