Skip to content

Commit c75eef3

Browse files
committed
Creating debug build workflow
Reducing the build-solution workflow responsibilities and creating a new workflow strictly for debug builds. - build-solution is no longer manually callable and must be called from another workflow - Install the MAT extension so that language resources are compiled, when the compileLangs workflow parameter is true. - modifying the job name to be more descriptive.
1 parent 9f083d6 commit c75eef3

File tree

2 files changed

+56
-37
lines changed

2 files changed

+56
-37
lines changed

.github/workflows/build-debug.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Build the solution to verify a successful build in debug mode.
2+
3+
name: build-debug
4+
5+
on:
6+
workflow_dispatch:
7+
8+
pull_request:
9+
branches: [ Dev-2.2 ] # Debug builds for PRs that target the dev branch.
10+
paths:
11+
- '**.vb'
12+
- '**.vbproj'
13+
14+
env:
15+
SHORT_SHA:
16+
17+
jobs:
18+
prepare-environment:
19+
runs-on: windows-latest
20+
steps:
21+
- name: Get short SHA
22+
run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 8))" >> $env:GITHUB_ENV
23+
24+
build-solution:
25+
uses: ./.github/workflows/build-solution.yaml
26+
with:
27+
buildMode: 'Debug'
28+
version: '2.2.*'
29+
compileLangs: false
30+
31+
build-debug:
32+
needs: build-solution
33+
# runs-on: windows-latest
34+
steps:
35+
- name: Package output
36+
uses: actions/upload-artifact@v3
37+
with:
38+
name: ${{ format('winnut-{0}-{1}', inputs.buildMode, env.SHORT_SHA) }}
39+
if-no-files-found: error
40+
path: WinNUT_V2/WinNUT_GUI/bin/Debug

.github/workflows/build-solution.yaml

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
1+
# Core building functionality, intended to be called from more specific workflows.
12
name: build-solution
23

3-
# defaults:
4-
# run:
5-
# working-directory: WinNUT_V2
6-
74
on:
8-
workflow_dispatch:
9-
inputs:
10-
buildMode:
11-
description: 'Solution build mode passed to MSBuild.'
12-
required: true
13-
type: string
14-
15-
version:
16-
description: 'Version number to refer to this build and its assets, in the form `major.minor.build`.'
17-
required: true
18-
type: string
195
workflow_call:
206
inputs:
217
buildMode:
@@ -28,33 +14,35 @@ on:
2814
required: true
2915
type: string
3016

31-
# pull_request:
32-
# branches: [ main, Dev-2.2 ] # Build for dev primarily, probably don't need main...?
33-
# paths:
34-
# - '**.vb'
35-
# - '**.vbproj'
17+
compileLangs:
18+
description: 'Install the Multilingual App Toolkit extension, so that languages are compiled.'
19+
required: true
20+
type: boolean
3621

3722
env:
3823
DOTNET_VERSION: '4.8'
39-
SLN_FILE: WinNUT_V2.sln
4024
SLN_DIR: WinNUT_V2
4125

4226
jobs:
4327
build:
44-
name: build-${{ matrix.os }}
28+
name: build-[${{ inputs.buildMode }}]v${{ inputs.version }}
4529
runs-on: ${{ matrix.os }}
4630
strategy:
4731
matrix:
4832
os: [windows-latest]
49-
steps:
50-
# Build output goes in this runner's temp directory
51-
- name: Get output directory
52-
run: echo "OUTPUT=${{ runner.temp }}\build-output" >> $env:GITHUB_ENV
5333

34+
steps:
5435
# Make MSBuild available from $PATH.
5536
- name: setup-msbuild
5637
uses: microsoft/setup-msbuild@v1
5738

39+
# Install the MAT extension for multilingual compilation if requested.
40+
- name: Install Multilingual App Toolkit extension
41+
if: ${{ inputs.compileLangs }}
42+
uses: microcompiler/install-vsix@db1f973c3d24d1ddc0c38f14d0e1e3a85b2ccb21
43+
with:
44+
packagename: 'dts-publisher.mat2022'
45+
5846
- name: Checkout Code
5947
uses: actions/checkout@v3
6048

@@ -64,15 +52,6 @@ jobs:
6452
# msbuild cannot handle .vdproj Installer projects, so only build debug for now.
6553
- name: Build solution
6654
run: >
67-
msbuild $env:SLN_DIR\$env:SLN_FILE -nologo
55+
msbuild $env:SLN_DIR\WinNUT_V2.sln -nologo
6856
-property:Configuration=${{ inputs.buildMode }}
69-
-property:OutDir=${{ env.OUTPUT }}
70-
-property:Version=${{ inputs.version }}
71-
72-
- name: Upload Artifact
73-
uses: actions/upload-artifact@v3
74-
with:
75-
name: ${{ format('winnut-client-{0}-{1}', inputs.buildMode, inputs.version) }}
76-
if-no-files-found: error
77-
path: ${{ env.OUTPUT }}
78-
57+
-property:Version=${{ inputs.version }}

0 commit comments

Comments
 (0)