Skip to content

Commit

Permalink
Solution building becomes composite action
Browse files Browse the repository at this point in the history
Moving environment prep & solution building into its own composite action, which makes much more sense then trying to split workflow up between jobs.
  • Loading branch information
gbakeman committed Apr 8, 2023
1 parent a0a116a commit 61862cf
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 75 deletions.
36 changes: 36 additions & 0 deletions .github/actions/build-solution/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Build Solution"
description: "Execute MSBuild with desired settings."
inputs:
build-mode:
description: 'Solution build mode passed to MSBuild.'
required: true

version:
description: 'Version number to refer to this build and its assets, in the form `major.minor.build`.'
required: true

compile-langs:
description: 'Install the Multilingual App Toolkit extension, so that languages are compiled.'
required: true

runs:
using: "composite"
steps:
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Restore Packages
working-directory: WinNUT_V2
shell: pwsh
run: msbuild $env:SLN_DIR -t:restore
- name: Install Multilingual App Toolkit extension
if: inputs.compile-langs == 'true'
uses: microcompiler/install-vsix@db1f973c3d24d1ddc0c38f14d0e1e3a85b2ccb21
with:
packagename: 'dts-publisher.mat2022'
- name: Build solution
shell: pwsh
working-directory: WinNUT_V2
run: >
msbuild WinNUT_V2.sln -nologo
-property:Configuration=${{ inputs.build-mode }}
-property:Version=${{ inputs.version }}
32 changes: 14 additions & 18 deletions .github/workflows/build-debug.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Build the solution to verify a successful build in debug mode.

name: build-debug

on:
Expand All @@ -15,26 +13,24 @@ env:
SHORT_SHA:

jobs:
prepare-environment:
build-debug:
runs-on: windows-latest
steps:
- name: Get short SHA
- name: "Get Short SHA"
id: "get-short-sha"
shell: pwsh
run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 8))" >> $env:GITHUB_ENV

build-solution:
uses: ./.github/workflows/build-solution.yaml
with:
buildMode: 'Debug'
version: '2.2.*'
compileLangs: false

build-debug:
needs: build-solution
# runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build solution in Debug configuration (no multilingual)
uses: ./.github/actions/build-solution
with:
build-mode: "Debug"
version: "2.2.*"
compile-langs: false
- name: Package output
uses: actions/upload-artifact@v3
with:
name: ${{ format('winnut-{0}-{1}', inputs.buildMode, env.SHORT_SHA) }}
name: ${{ format('winnut-client-debug-{0}', env.SHORT_SHA) }}
if-no-files-found: error
path: WinNUT_V2/WinNUT_GUI/bin/Debug
path: WinNUT_V2/WinNUT-Client/bin/Debug
57 changes: 0 additions & 57 deletions .github/workflows/build-solution.yaml

This file was deleted.

0 comments on commit 61862cf

Please sign in to comment.