Skip to content

Commit d0c8687

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 d0c8687

File tree

5 files changed

+113
-50
lines changed

5 files changed

+113
-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,59 @@
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+
default: ''
8+
runs:
9+
using: "composite"
10+
steps:
11+
- id: alt-dl
12+
shell: pwsh
13+
run: curl -o mat.vsix https://marketplace.visualstudio.com/_apis/public/gallery/publishers/dts-publisher/vsextensions/mat2022/4.2.3/vspackage
14+
- id: vsix
15+
shell: pwsh
16+
run: |
17+
$baseProtocol = "https:"
18+
$baseHostName = "marketplace.visualstudio.com"
19+
20+
$Uri = "$($baseProtocol)//$($baseHostName)/items?itemName=${{ inputs.packagename }}"
21+
$VsixLocation = "$($env:Temp)\$([guid]::NewGuid()).vsix"
22+
23+
$VSInstallDir = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service"
24+
25+
if (-Not $VSInstallDir) {
26+
Write-Error "Visual Studio install directory is missing"
27+
Exit 1
28+
}
29+
Write-Host "Grabbing VSIX extension at $($Uri)"
30+
$HTML = Invoke-WebRequest -Uri $Uri -UseBasicParsing -SessionVariable session
31+
32+
Write-Host "Attempting to download ${{ inputs.packagename }}..."
33+
$anchor = $HTML.Links |
34+
Where-Object { $_.class -eq 'install-button-container' } |
35+
Select-Object -ExpandProperty href
36+
if (-Not $anchor) {
37+
Write-Error "Could not find download anchor tag on the Visual Studio Extensions page"
38+
Exit 1
39+
}
40+
Write-Host "Anchor is $($anchor)"
41+
$href = "$($baseProtocol)//$($baseHostName)$($anchor)"
42+
Write-Host "Href is $($href)"
43+
Invoke-WebRequest $href -OutFile $VsixLocation -WebSession $session
44+
45+
if (-Not (Test-Path $VsixLocation)) {
46+
Write-Error "Downloaded VSIX file could not be located"
47+
Exit 1
48+
}
49+
Write-Host "VSInstallDir is $($VSInstallDir)"
50+
Write-Host "VsixLocation is $($VsixLocation)"
51+
Write-Host "Hash of curl'd file is $((Get-FileHash mat.vsix).Hash)"
52+
Write-Host "Hash of WebReq'd file is $((Get-FileHash $VsixLocation).Hash)"
53+
Write-Host "Installing ${{ inputs.packagename }}..."
54+
$FilePath = Join-Path $env:GITHUB_WORKSPACE "mat.vsix"
55+
Start-Process -Filepath "$($VSInstallDir)\VSIXInstaller" -WorkingDirectory $env:ProgramFiles -ArgumentList "/q $($FilePath)" -Wait -PassThru
56+
Write-Host "Cleanup..."
57+
rm $VsixLocation
58+
59+
Write-Host "Installation of ${{ inputs.packagename }} complete!"

.github/workflows/build-debug.yaml

+6-9
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,20 @@ 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+
uses: ./.github/actions/build
21+
22+
- name: "Get Short SHA"
23+
run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 8))" >> $env:GITHUB_ENV
2724

2825
- name: Upload Artifact
2926
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)