Skip to content

Commit d6cf9da

Browse files
committed
Build workflow improvements
- 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.
1 parent 7959f5e commit d6cf9da

File tree

5 files changed

+129
-50
lines changed

5 files changed

+129
-50
lines changed

.github/actions/build/action.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Prepare environment and build
2+
3+
description: Prepares the environment for building, and builds the solution with the given parameters.
4+
5+
inputs:
6+
multilingualBuild:
7+
description: "Installs the Multilingual App Toolkit to enable language compiling."
8+
default: true
9+
required: false
10+
type: boolean
11+
12+
buildConfig:
13+
description: "What configuration MSBuild will build for."
14+
required: false
15+
default: "Debug"
16+
type: string
17+
18+
runs:
19+
using: "composite"
20+
steps:
21+
- name: Setup MSBuild
22+
uses: microsoft/setup-msbuild@v2
23+
24+
- name: Install Multilingual App Toolkit extension
25+
if: ${{ inputs.multilingualBuild }}
26+
uses: ./.github/actions/test-vsix-installer
27+
with:
28+
packagename: 'dts-publisher.mat2022'
29+
30+
- name: Build solution
31+
shell: pwsh
32+
run: msbuild -nologo -restore -t:build -p:Configuration=${{ inputs.buildConfig }} WinNUT_V2/WinNUT_V2.sln
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: 'Install a Visual Studio Extension'
2+
description: 'Download the latest extension version and install in Visual Studio'
3+
inputs:
4+
packagename:
5+
description: 'Package names from the Visual Studio Marketplace URL itemName parameter'
6+
required: true
7+
outputs:
8+
logfile:
9+
description: "Location on runner of VSIXInstaller's log."
10+
runs:
11+
using: "composite"
12+
steps:
13+
- id: vsix
14+
shell: pwsh
15+
run: |
16+
$baseProtocol = "https:"
17+
$baseHostName = "marketplace.visualstudio.com"
18+
19+
$Uri = "$($baseProtocol)//$($baseHostName)/items?itemName=${{ inputs.packagename }}"
20+
$VsixLocation = "$($env:Temp)\$([guid]::NewGuid()).vsix"
21+
22+
$VSInstallDir = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service"
23+
24+
if (-Not $VSInstallDir) {
25+
Write-Error "Visual Studio install directory is missing"
26+
Exit 1
27+
}
28+
Write-Host "Grabbing VSIX extension at $($Uri)"
29+
$HTML = Invoke-WebRequest -Uri $Uri -UseBasicParsing -SessionVariable session
30+
31+
Write-Host "Attempting to download ${{ inputs.packagename }}..."
32+
$anchor = $HTML.Links |
33+
Where-Object { $_.class -eq 'install-button-container' } |
34+
Select-Object -ExpandProperty href
35+
if (-Not $anchor) {
36+
Write-Error "Could not find download anchor tag on the Visual Studio Extensions page"
37+
Exit 1
38+
}
39+
Write-Host "Anchor is $($anchor)"
40+
$href = "$($baseProtocol)//$($baseHostName)$($anchor)"
41+
Write-Host "Href is $($href)"
42+
Invoke-WebRequest $href -OutFile $VsixLocation -WebSession $session
43+
44+
if (-Not (Test-Path $VsixLocation)) {
45+
Write-Error "Downloaded VSIX file could not be located"
46+
Exit 1
47+
}
48+
Write-Host "VSInstallDir is $($VSInstallDir)"
49+
Write-Host "VsixLocation is $($VsixLocation)"
50+
Write-Host "Installing ${{ inputs.packagename }}..."
51+
52+
$proc = Start-Process -Filepath "$($VSInstallDir)\VSIXInstaller" -WorkingDirectory $env:ProgramFiles -ArgumentList "/q /l:vsixinst-out.log $($VsixLocation)" -PassThru
53+
54+
while (-Not ($proc.HasExited)) {
55+
Write-Host -NoNewLine "Process Information:"
56+
Write-Host -NoNewLine $proc
57+
Start-Sleep 1
58+
}
59+
60+
Write-Host "Process exited."
61+
Write-Host "Cleanup..."
62+
rm $VsixLocation
63+
64+
if ($proc.ExitCode -ne 0) {
65+
Write-Host "Error(s) Encountered: $($proc.ExitCode)"
66+
Write-Host Select-String -Path $env:temp\vsixinst-out.log -Pattern "^.*Exception.*$"
67+
}
68+
else {
69+
Write-Host "Installation of ${{ inputs.packagename }} complete!"
70+
}
71+
72+
exit $proc.ExitCode

.github/workflows/build-debug.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ on:
77
paths:
88
- '**.vb'
99
- '**.vbproj'
10+
- "**.xlf"
1011

1112
jobs:
1213
build-debug:
1314
runs-on: windows-latest
1415
steps:
15-
- name: "Get Short SHA"
16-
run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 8))" >> $env:GITHUB_ENV
17-
18-
- name: Setup MSBuild
19-
uses: microsoft/setup-msbuild@v2
20-
2116
- name: Checkout Code
2217
uses: actions/checkout@v4
2318

24-
# msbuild cannot handle .vdproj Installer projects, so only build debug for now.
25-
- name: Build solution
26-
run: msbuild -t:build -restore -p:Configuration=Debug WinNUT_V2/WinNUT_V2.sln
19+
- id: build
20+
name: Run Build
21+
uses: ./.github/actions/build
22+
with:
23+
buildConfig: "Debug"
24+
25+
- name: "Get Short SHA"
26+
run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 8))" >> $env:GITHUB_ENV
2727

2828
- name: Upload Artifact
2929
uses: actions/upload-artifact@v4

.github/workflows/build-translation.yaml

-25
This file was deleted.

WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf

+16-16
Original file line numberDiff line numberDiff line change
@@ -1887,15 +1887,15 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa
18871887
<target state="new">Unavailable</target>
18881888
<note from="MultilingualBuild" annotates="source" priority="2">Indicate that a variable is unavailable</note>
18891889
</trans-unit>
1890-
<trans-unit id="RepeatHS" translate="yes" xml:space="preserve" extype="System.Resources.ResXFileRef, System.Windows.Forms">
1890+
<trans-unit id="RepeatHS" translate="yes" extype="System.Resources.ResXFileRef, System.Windows.Forms" xml:space="preserve">
18911891
<source>..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</source>
18921892
<target state="needs-review-translation">..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</target>
18931893
</trans-unit>
1894-
<trans-unit id="disconnect2" translate="yes" xml:space="preserve" extype="System.Resources.ResXFileRef, System.Windows.Forms">
1894+
<trans-unit id="disconnect2" translate="yes" extype="System.Resources.ResXFileRef, System.Windows.Forms" xml:space="preserve">
18951895
<source>..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</source>
18961896
<target state="needs-review-translation">..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</target>
18971897
</trans-unit>
1898-
<trans-unit id="internetconnection" translate="yes" xml:space="preserve" extype="System.Resources.ResXFileRef, System.Windows.Forms">
1898+
<trans-unit id="internetconnection" translate="yes" extype="System.Resources.ResXFileRef, System.Windows.Forms" xml:space="preserve">
18991899
<source>..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</source>
19001900
<target state="needs-review-translation">..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</target>
19011901
</trans-unit>
@@ -3185,59 +3185,59 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa
31853185
<source></source>
31863186
<target state="new"></target>
31873187
</trans-unit>
3188-
<trans-unit id="Menu_Connect.Size" translate="yes" xml:space="preserve" extype="System.Drawing.Size, System.Drawing">
3188+
<trans-unit id="Menu_Connect.Size" translate="yes" extype="System.Drawing.Size, System.Drawing" xml:space="preserve">
31893189
<source>180, 22</source>
31903190
<target state="needs-review-translation">180, 22</target>
31913191
</trans-unit>
31923192
<trans-unit id="Menu_Connect.Text" translate="yes" xml:space="preserve">
31933193
<source>Connect</source>
31943194
<target state="new">Connect</target>
31953195
</trans-unit>
3196-
<trans-unit id="AG_InV.Text" translate="yes" xml:space="preserve" extype="System.Resources.ResXNullRef, System.Windows.Forms">
3196+
<trans-unit id="AG_InV.Text" translate="yes" extype="System.Resources.ResXNullRef, System.Windows.Forms" xml:space="preserve">
31973197
<source></source>
31983198
<target state="needs-review-translation"></target>
31993199
</trans-unit>
3200-
<trans-unit id="AG_OutV.Text" translate="yes" xml:space="preserve" extype="System.Resources.ResXNullRef, System.Windows.Forms">
3200+
<trans-unit id="AG_OutV.Text" translate="yes" extype="System.Resources.ResXNullRef, System.Windows.Forms" xml:space="preserve">
32013201
<source></source>
32023202
<target state="needs-review-translation"></target>
32033203
</trans-unit>
3204-
<trans-unit id="AG_BattCh.Text" translate="yes" xml:space="preserve" extype="System.Resources.ResXNullRef, System.Windows.Forms">
3204+
<trans-unit id="AG_BattCh.Text" translate="yes" extype="System.Resources.ResXNullRef, System.Windows.Forms" xml:space="preserve">
32053205
<source></source>
32063206
<target state="needs-review-translation"></target>
32073207
</trans-unit>
3208-
<trans-unit id="AG_Load.Text" translate="yes" xml:space="preserve" extype="System.Resources.ResXNullRef, System.Windows.Forms">
3208+
<trans-unit id="AG_Load.Text" translate="yes" extype="System.Resources.ResXNullRef, System.Windows.Forms" xml:space="preserve">
32093209
<source></source>
32103210
<target state="needs-review-translation"></target>
32113211
</trans-unit>
3212-
<trans-unit id="AG_BattV.Text" translate="yes" xml:space="preserve" extype="System.Resources.ResXNullRef, System.Windows.Forms">
3212+
<trans-unit id="AG_BattV.Text" translate="yes" extype="System.Resources.ResXNullRef, System.Windows.Forms" xml:space="preserve">
32133213
<source></source>
32143214
<target state="needs-review-translation"></target>
32153215
</trans-unit>
3216-
<trans-unit id="AG_InF.Text" translate="yes" xml:space="preserve" extype="System.Resources.ResXNullRef, System.Windows.Forms">
3216+
<trans-unit id="AG_InF.Text" translate="yes" extype="System.Resources.ResXNullRef, System.Windows.Forms" xml:space="preserve">
32173217
<source></source>
32183218
<target state="needs-review-translation"></target>
32193219
</trans-unit>
3220-
<trans-unit id="ToolStripSeparator1.Size" translate="yes" xml:space="preserve" extype="System.Drawing.Size, System.Drawing">
3220+
<trans-unit id="ToolStripSeparator1.Size" translate="yes" extype="System.Drawing.Size, System.Drawing" xml:space="preserve">
32213221
<source>177, 6</source>
32223222
<target state="needs-review-translation">177, 6</target>
32233223
</trans-unit>
3224-
<trans-unit id="Menu_Persist.Size" translate="yes" xml:space="preserve" extype="System.Drawing.Size, System.Drawing">
3224+
<trans-unit id="Menu_Persist.Size" translate="yes" extype="System.Drawing.Size, System.Drawing" xml:space="preserve">
32253225
<source>180, 22</source>
32263226
<target state="needs-review-translation">180, 22</target>
32273227
</trans-unit>
32283228
<trans-unit id="Menu_Persist.Text" translate="yes" xml:space="preserve">
32293229
<source>Persist</source>
32303230
<target state="new">Persist</target>
32313231
</trans-unit>
3232-
<trans-unit id="Menu_Disconnect.Enabled" translate="yes" xml:space="preserve" extype="System.Boolean, mscorlib">
3232+
<trans-unit id="Menu_Disconnect.Enabled" translate="yes" extype="System.Boolean, mscorlib" xml:space="preserve">
32333233
<source>False</source>
32343234
<target state="needs-review-translation">False</target>
32353235
</trans-unit>
3236-
<trans-unit id="$this.ImeMode" translate="yes" xml:space="preserve" extype="System.Windows.Forms.ImeMode, System.Windows.Forms">
3236+
<trans-unit id="$this.ImeMode" translate="yes" extype="System.Windows.Forms.ImeMode, System.Windows.Forms" xml:space="preserve">
32373237
<source>NoControl</source>
32383238
<target state="needs-review-translation">NoControl</target>
32393239
</trans-unit>
3240-
<trans-unit id="Menu_UPS_Var.Enabled" translate="yes" xml:space="preserve" extype="System.Boolean, mscorlib">
3240+
<trans-unit id="Menu_UPS_Var.Enabled" translate="yes" extype="System.Boolean, mscorlib" xml:space="preserve">
32413241
<source>False</source>
32423242
<target state="needs-review-translation">False</target>
32433243
</trans-unit>
@@ -4171,7 +4171,7 @@ Remaining Time : {WinNUT.Lbl_VRTime.Text}</source>
41714171
</trans-unit>
41724172
<trans-unit id="$this.ImeMode" translate="yes" extype="System.Windows.Forms.ImeMode, System.Windows.Forms" xml:space="preserve">
41734173
<source>NoControl</source>
4174-
<target state="needs-review-translation">NoControl</target>
4174+
<target state="translated">NoControl3</target>
41754175
</trans-unit>
41764176
</group>
41774177
</body>

0 commit comments

Comments
 (0)