Update build for releases #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Installer | |
on: | |
push: | |
branches: [ "2024", "2023" ] | |
release: | |
types: [created] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
configuration: [Release] | |
runs-on: windows-latest # For a list of available runner types, refer to | |
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# Install the .NET Core workload | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: setup-msbuild | |
uses: microsoft/[email protected] | |
- name: Set VS.net environment | |
run: cmd.exe /C CALL "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat" | |
- name: Build VSTO | |
run: msbuild ${{github.workspace}}\Motion-Profile-Mapper\Motion-Profile-Mapper.sln -t:restore,build -p:RestorePackagesConfig=true /p:Platform="Any CPU" /p:Configuration=${{ matrix.configuration }} /nologo /nr:false /p:VisualStudioVersion="19.0" | |
- name: Setup VS Dev Environment | |
uses: seanmiddleditch/gha-setup-vsdevenv@v4 | |
- name: DisableOutOfProc Fix | |
run: | | |
function Invoke-DisableOutOfProcBuild { | |
param (); | |
$visualStudioWherePath = ('{0}/Microsoft Visual Studio/Installer/vswhere.exe' -f ${Env:ProgramFiles(x86)}); | |
$visualStudioInstallationPath = & $visualStudioWherePath -latest -products 'Microsoft.VisualStudio.Product.Enterprise' -property 'installationPath'; | |
$currentWorkingDirectory = ('{0}/Common7/IDE/CommonExtensions/Microsoft/VSI/DisableOutOfProcBuild' -f $visualStudioInstallationPath); | |
Set-Location -Path $currentWorkingDirectory; | |
$disableOutOfProcBuildPath = ('{0}/DisableOutOfProcBuild.exe' -f $currentWorkingDirectory); | |
& $disableOutOfProcBuildPath; | |
return; | |
} | |
Invoke-DisableOutOfProcBuild | |
- name: Build installer | |
run: cd ${{github.workspace}}\Motion-Profile-Mapper\ && devenv.com ${{github.workspace}}\Motion-Profile-Mapper\Motion-Profile-Mapper-Installer\Motion-Profile-Mapper-Installer.vdproj /build "${{ matrix.configuration }}|Any CPU" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: Motion-Profiler-Installer.msi | |
path: ${{github.workspace}}\Motion-Profile-Mapper\Motion-Profile-Mapper-Installer\${{ matrix.configuration }}\Motion-Profiler-Installer.msi | |
release: | |
needs: [build] | |
runs-on: ubuntu-22.04 | |
steps: | |
# Download literally every single artifact. This also downloads client and docs, | |
# but the filtering below won't pick these up (I hope) | |
- uses: actions/download-artifact@v4 | |
# Push to dev release | |
- uses: pyTooling/Actions/releaser@r0 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: 'Dev' | |
rm: true | |
files: | | |
**/*.msi | |
if: github.event_name == 'push' | |
# Upload all jars and xz archives | |
- uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
**/*.msi | |
if: startsWith(github.ref, 'refs/tags/v') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |