|
| 1 | +name: Check-Build |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build-publish: |
| 7 | + runs-on: windows-latest |
| 8 | + steps: |
| 9 | + - uses: actions/checkout@v4 |
| 10 | + |
| 11 | + - name: Setup GitHub CLI |
| 12 | + uses: cli/cli@v2 |
| 13 | + |
| 14 | + - name: Download and extract plugins |
| 15 | + shell: pwsh |
| 16 | + run: | |
| 17 | + $plugins = @( |
| 18 | + "plugin_Kinect360NiTE", |
| 19 | + "plugin_OpenVR" |
| 20 | + ) |
| 21 | +
|
| 22 | + New-Item -ItemType Directory -Force -Path artifacts | Out-Null |
| 23 | + New-Item -ItemType Directory -Force -Path Plugins | Out-Null |
| 24 | +
|
| 25 | + foreach ($plugin in $plugins) { |
| 26 | + Write-Host "Downloading $plugin ..." |
| 27 | + gh release download --repo "KinectToVR/$plugin" --pattern "*.zip" --dir artifacts |
| 28 | +
|
| 29 | + Get-ChildItem artifacts -Filter *.zip | ForEach-Object { |
| 30 | + $dest = "Plugins/$plugin" |
| 31 | + New-Item -ItemType Directory -Force -Path $dest | Out-Null |
| 32 | + Expand-Archive -Path $_.FullName -DestinationPath $dest -Force |
| 33 | + Remove-Item $_.FullName |
| 34 | + } |
| 35 | + } |
| 36 | + env: |
| 37 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 38 | + |
| 39 | + - name: Set up .NET |
| 40 | + uses: actions/setup-dotnet@v3 |
| 41 | + with: |
| 42 | + dotnet-version: "10.0.x" |
| 43 | + |
| 44 | + - name: Restore and build (publish) - Linux |
| 45 | + run: | |
| 46 | + dotnet publish Amethyst.Desktop ` |
| 47 | + /p:Configuration=Release /p:TargetFramework=net8.0 /p:PublishProfile=FolderProfile ` |
| 48 | + /p:RuntimeIdentifier=linux-x64 /p:SelfContained=true /p:PublishDir=bin/Release/linux |
| 49 | +
|
| 50 | + Copy-Item -Path "Plugins" -Destination "Amethyst.Desktop/bin/Release/linux/Plugins" -Recurse |
| 51 | + |
| 52 | + cd Amethyst.Desktop/bin/Release/linux/ |
| 53 | + 7z a AME2-$(Get-Date -Format 'yyyyMMdd')-LINUX.zip * |
| 54 | +
|
| 55 | + - name: Restore and build (publish) - Windows |
| 56 | + run: | |
| 57 | + dotnet publish Amethyst.Desktop ` |
| 58 | + /p:Configuration=Release /p:TargetFramework=net8.0 /p:PublishProfile=FolderProfile ` |
| 59 | + /p:RuntimeIdentifier=win-x64 /p:SelfContained=true /p:PublishDir=bin/Release/windows |
| 60 | +
|
| 61 | + Copy-Item -Path "Plugins" -Destination "Amethyst.Desktop/bin/Release/windows/Plugins" -Recurse |
| 62 | + |
| 63 | + cd Amethyst.Desktop/bin/Release/windows/ |
| 64 | + 7z a AME2-$(Get-Date -Format 'yyyyMMdd')-WINDOWS.zip * |
| 65 | +
|
| 66 | + - name: Upload artifacts |
| 67 | + uses: "marvinpinto/action-automatic-releases@latest" |
| 68 | + with: |
| 69 | + repo_token: "${{ secrets.GITHUB_TOKEN }}" |
| 70 | + automatic_release_tag: "ame2-latest" |
| 71 | + prerelease: true |
| 72 | + title: "AME2 Build Artifact" |
| 73 | + files: | |
| 74 | + ./Amethyst.Desktop/bin/Release/linux/AME2-*-LINUX.zip |
| 75 | + ./Amethyst.Desktop/bin/Release/windows/AME2-*-WINDOWS.zip |
0 commit comments