-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Broke out environment prep and build into its own action - Some additional switches added to the msbuild command for slightly better operation and more verbose logging - Multilingual app toolkit installation added to build action, installed and enabled by default. - Debug build workflow applies to translation file changes as well.
- Loading branch information
Showing
5 changed files
with
113 additions
and
50 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Prepare environment and build | ||
|
||
description: Prepares the environment for building, and builds the solution with the given parameters. | ||
|
||
inputs: | ||
multilingualBuild: | ||
description: "Installs the Multilingual App Toolkit to enable language compiling." | ||
default: true | ||
required: false | ||
type: boolean | ||
|
||
buildConfig: | ||
description: "What configuration MSBuild will build for." | ||
required: false | ||
default: "Debug" | ||
type: string | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup MSBuild | ||
uses: microsoft/setup-msbuild@v2 | ||
|
||
- name: Install Multilingual App Toolkit extension | ||
if: ${{ inputs.multilingualBuild }} | ||
uses: ./.github/actions/test-vsix-installer | ||
with: | ||
packagename: 'dts-publisher.mat2022' | ||
|
||
- name: Build solution | ||
shell: pwsh | ||
run: msbuild -nologo -restore -t:build -p:Configuration=${{ inputs.buildConfig }} WinNUT_V2/WinNUT_V2.sln |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: 'Install a Visual Studio Extension' | ||
description: 'Download the latest extension version and install in Visual Studio' | ||
inputs: | ||
packagename: | ||
description: 'Package names from the Visual Studio Marketplace URL itemName parameter' | ||
required: true | ||
default: '' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- id: alt-dl | ||
shell: pwsh | ||
run: curl -o mat.vsix https://marketplace.visualstudio.com/_apis/public/gallery/publishers/dts-publisher/vsextensions/mat2022/4.2.3/vspackage | ||
- id: vsix | ||
shell: pwsh | ||
run: | | ||
$baseProtocol = "https:" | ||
$baseHostName = "marketplace.visualstudio.com" | ||
$Uri = "$($baseProtocol)//$($baseHostName)/items?itemName=${{ inputs.packagename }}" | ||
$VsixLocation = "$($env:Temp)\$([guid]::NewGuid()).vsix" | ||
$VSInstallDir = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service" | ||
if (-Not $VSInstallDir) { | ||
Write-Error "Visual Studio install directory is missing" | ||
Exit 1 | ||
} | ||
Write-Host "Grabbing VSIX extension at $($Uri)" | ||
$HTML = Invoke-WebRequest -Uri $Uri -UseBasicParsing -SessionVariable session | ||
Write-Host "Attempting to download ${{ inputs.packagename }}..." | ||
$anchor = $HTML.Links | | ||
Where-Object { $_.class -eq 'install-button-container' } | | ||
Select-Object -ExpandProperty href | ||
if (-Not $anchor) { | ||
Write-Error "Could not find download anchor tag on the Visual Studio Extensions page" | ||
Exit 1 | ||
} | ||
Write-Host "Anchor is $($anchor)" | ||
$href = "$($baseProtocol)//$($baseHostName)$($anchor)" | ||
Write-Host "Href is $($href)" | ||
Invoke-WebRequest $href -OutFile $VsixLocation -WebSession $session | ||
if (-Not (Test-Path $VsixLocation)) { | ||
Write-Error "Downloaded VSIX file could not be located" | ||
Exit 1 | ||
} | ||
Write-Host "VSInstallDir is $($VSInstallDir)" | ||
Write-Host "VsixLocation is $($VsixLocation)" | ||
Write-Host "Hash of curl'd file is $((Get-FileHash mat.vsix).Hash)" | ||
Write-Host "Hash of WebReq'd file is $((Get-FileHash $VsixLocation).Hash)" | ||
Write-Host "Installing ${{ inputs.packagename }}..." | ||
$FilePath = Join-Path $env:GITHUB_WORKSPACE "mat.vsix" | ||
Start-Process -Filepath "$($VSInstallDir)\VSIXInstaller" -WorkingDirectory $env:ProgramFiles -ArgumentList "/q $($FilePath)" -Wait -PassThru | ||
Write-Host "Cleanup..." | ||
rm $VsixLocation | ||
Write-Host "Installation of ${{ inputs.packagename }} complete!" |
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
This file was deleted.
Oops, something went wrong.
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