Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github actions for builds and releases #174

Merged
merged 2 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Release
on:
release:
types: [created]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: '1'

jobs:
release:
name: Release
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-dotnet@v2
with:
# https://dotnet.microsoft.com/en-us/download/dotnet
dotnet-version: '6.0.x'
- name: Collect metadata
id: METADATA
shell: pwsh
run: |
$commit = git rev-parse HEAD
$commit_short = $commit.SubString(0, 7)

echo "commit=$commit" >> $env:GITHUB_OUTPUT
echo "commit_short=$commit_short" >> $env:GITHUB_OUTPUT
echo "build_id=$commit_short-${{ github.run_id }}" >> $env:GITHUB_OUTPUT
- name: Build LiveSPICE
shell: pwsh
run: |
cd LiveSPICE
dotnet publish -c Release --framework net50-windows /p:DebugType=None /p:UseSharedCompilation=false /p:UseRazorBuildServer=false
- name: Build LiveSPICEVst
shell: pwsh
run: |
cd LiveSPICEVst
dotnet publish -c Release --framework net6.0-windows /p:DebugType=None /p:UseSharedCompilation=false /p:UseRazorBuildServer=false
- name: Package LiveSPICE Setup version
shell: pwsh
run: iscc LiveSPICESetup.iss
- name: Package LiveSPICE Portable version
shell: pwsh
run: |
$workdir = Get-Location

cd $workdir\LiveSPICE
Get-ChildItem $workdir\Circuit\Components\ -Filter *.xml | Copy-Item -Destination bin\Release\net50-windows\Components\ -Force -PassThru
cd bin\Release

ren net50-windows LiveSPICE
Compress-Archive -Path LiveSPICE -DestinationPath $workdir\LiveSPICE-${{ github.ref_name }}.zip

cd $workdir\LiveSPICEVst
New-Item -Name "LiveSPICEVst" -ItemType "directory"
New-Item -Name "LiveSPICEVst\Components" -ItemType "directory"

Copy-Item bin\Release\net6.0-windows\LiveSPICEVstBridge.vst3 -Destination LiveSPICEVst\ -Force -PassThru
Get-ChildItem bin\Release\net6.0-windows\ -Filter *.dll | Copy-Item -Destination LiveSPICEVst\ -Force -PassThru
Get-ChildItem bin\Release\net6.0-windows\ -Filter *.json | Copy-Item -Destination LiveSPICEVst\ -Force -PassThru
Get-ChildItem $workdir\Circuit\Components\ -Filter *.xml | Copy-Item -Destination LiveSPICEVst\Components\ -Force -PassThru

Compress-Archive -Path LiveSPICEVst -DestinationPath $workdir\LiveSPICEVst-${{ github.ref_name }}.zip
- name: Publish LiveSPICE artifacts
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
LiveSPICESetup.exe
LiveSPICE-${{ github.ref_name }}.zip
LiveSPICEVst-${{ github.ref_name }}.zip
74 changes: 74 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Snapshot
on:
workflow_dispatch: {}
push:
branches:
- master
env:
DOTNET_CLI_TELEMETRY_OPTOUT: '1'

jobs:
snapshot:
name: Snapshot
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-dotnet@v2
with:
# https://dotnet.microsoft.com/en-us/download/dotnet
dotnet-version: '6.0.x'
- name: Collect metadata
id: METADATA
shell: pwsh
run: |
$commit = git rev-parse HEAD
$commit_short = $commit.SubString(0, 7)

echo "commit=$commit" >> $env:GITHUB_OUTPUT
echo "commit_short=$commit_short" >> $env:GITHUB_OUTPUT
echo "build_id=$commit_short-${{ github.run_id }}" >> $env:GITHUB_OUTPUT

- name: Snapshot LiveSPICE
shell: pwsh
run: |
$workdir = Get-Location

cd LiveSPICE
dotnet publish -c Release --framework net50-windows /p:DebugType=None /p:UseSharedCompilation=false /p:UseRazorBuildServer=false

Get-ChildItem $workdir\Circuit\Components\ -Filter *.xml | Copy-Item -Destination bin\Release\net50-windows\Components\ -Force -PassThru
cd bin\Release

ren net50-windows LiveSPICE
Compress-Archive -Path LiveSPICE -DestinationPath $workdir\LiveSPICE.zip
- name: Publish LiveSPICE snapshot
uses: actions/upload-artifact@v3
with:
path: LiveSPICE.zip
name: LiveSPICE-${{ steps.METADATA.outputs.build_id }}.zip

- name: Snapshot LiveSPICEVst
shell: pwsh
run: |
$workdir = Get-Location

cd LiveSPICEVst
dotnet publish -c Release --framework net6.0-windows /p:DebugType=None /p:UseSharedCompilation=false /p:UseRazorBuildServer=false

New-Item -Name "LiveSPICEVst" -ItemType "directory"
New-Item -Name "LiveSPICEVst\Components" -ItemType "directory"

Copy-Item bin\Release\net6.0-windows\LiveSPICEVstBridge.vst3 -Destination LiveSPICEVst\ -Force -PassThru
Get-ChildItem bin\Release\net6.0-windows\ -Filter *.dll | Copy-Item -Destination LiveSPICEVst\ -Force -PassThru
Get-ChildItem bin\Release\net6.0-windows\ -Filter *.json | Copy-Item -Destination LiveSPICEVst\ -Force -PassThru
Get-ChildItem $workdir\Circuit\Components\ -Filter *.xml | Copy-Item -Destination LiveSPICEVst\Components\ -Force -PassThru

Compress-Archive -Path LiveSPICEVst -DestinationPath $workdir\LiveSPICEVst.zip
- name: Publish LiveSPICEVst snapshot
uses: actions/upload-artifact@v3
with:
path: LiveSPICEVst.zip
name: LiveSPICEVst-${{ steps.METADATA.outputs.build_id }}.zip
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test
on:
- push
- pull_request
- workflow_dispatch
env:
DOTNET_CLI_TELEMETRY_OPTOUT: '1'

jobs:
test:
name: Test
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-dotnet@v2
with:
# https://dotnet.microsoft.com/en-us/download/dotnet
dotnet-version: '6.0.x'
- name: Test LiveSPICE build
shell: pwsh
working-directory: LiveSPICE
run: dotnet publish -c Release --framework net50-windows /p:DebugType=None /p:UseSharedCompilation=false /p:UseRazorBuildServer=false
- name: Test LiveSPICEVst build
shell: pwsh
working-directory: LiveSPICEVst
run: dotnet publish -c Release --framework net6.0-windows /p:DebugType=None /p:UseSharedCompilation=false /p:UseRazorBuildServer=false
6 changes: 3 additions & 3 deletions LiveSPICESetup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Source: "Circuit\Components\*.xml"; DestDir: "{app}\Components"
Source: "Circuit\Components\Readme.txt"; DestDir: "{userdocs}\LiveSPICE\Components"
Source: "Tests\Examples\*.schx"; DestDir: "{userdocs}\LiveSPICE\Examples"

Source: "LiveSPICEVst\bin\Release\net5.0-windows\LiveSPICEVstBridge.vst3"; DestDir: "C:\Program Files\Common Files\VST3\LiveSPICE"; Flags: ignoreversion; Components: vst
Source: "LiveSPICEVst\bin\Release\net5.0-windows\*.dll"; DestDir: "C:\Program Files\Common Files\VST3\LiveSPICE"; Flags: ignoreversion; Components: vst
Source: "LiveSPICEVst\bin\Release\net5.0-windows\*.json"; DestDir: "C:\Program Files\Common Files\VST3\LiveSPICE"; Flags: ignoreversion; Components: vst
Source: "LiveSPICEVst\bin\Release\net6.0-windows\LiveSPICEVstBridge.vst3"; DestDir: "C:\Program Files\Common Files\VST3\LiveSPICE"; Flags: ignoreversion; Components: vst
Source: "LiveSPICEVst\bin\Release\net6.0-windows\*.dll"; DestDir: "C:\Program Files\Common Files\VST3\LiveSPICE"; Flags: ignoreversion; Components: vst
Source: "LiveSPICEVst\bin\Release\net6.0-windows\*.json"; DestDir: "C:\Program Files\Common Files\VST3\LiveSPICE"; Flags: ignoreversion; Components: vst

[Run]
Filename: "{app}\LiveSPICE.exe"; Description: "Run LiveSPICE."; Flags: postinstall nowait
Expand Down