Skip to content

Dev Branch - Build

Dev Branch - Build #33

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Dev Branch - Build
# Controls when the action will run
on:
workflow_dispatch:
inputs:
version:
description: 'Do not include the leading V. This will be the next version for the Release, MPB, and DLL'
required: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Job 1, Build - Build the Management Pack on Windows Server with Visual Studio
build:
runs-on: windows-2019
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out repository under $GITHUB_WORKSPACE, so job can access it
- uses: actions/checkout@v3.3.0
with:
ref: dev
# Add MSBuild to environment path
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1.3
# copy dependencies over
- name: Copy Dependencies folder from the repo to Build for MP signing and show them
run: |
Copy-Item -Path ManagementPack\2016\dependencies -Destination "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VSAC\" -Recurse
Get-ChildItem "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VSAC\"
# Build the Settings UI dll
- name: Compile SMLetsExchangeConnectorSettingsUI.dll
run: msbuild ManagementPack/2016/SMLetsExchangeConnectorSettingsUI/SMLetsExchangeConnectorSettingsUI.csproj
#change the MPB version
- name: Change the next MPB build version
run: |
[xml]$build = Get-Content ManagementPack\2016\SMLets.Exchange.Connector\SMLets.Exchange.Connector.mpproj
$build.Project.PropertyGroup[0].Version = "${{ github.event.inputs.version }}"
$build.Project.PropertyGroup[1].Copyright = "AdhocAdam, " + (Get-Date).Year + "."
$build.Save("ManagementPack\2016\SMLets.Exchange.Connector\SMLets.Exchange.Connector.mpproj")
# Convert Management Pack Fragments to single XML, seal it to create the MP, bind the DLL to it, and thus create the MPB
- name: Sign the XML to create the MP. Then combine the MP and DLL to create the MPB
run: msbuild ManagementPack/2016/SMLets.Exchange.Connector.sln
#change the Resources.DLL version
- name: Change the SMLets.Exchange.Connector.Resources.dll File Assembly version
run: |
$newVersion = "${{ github.event.inputs.version }}"
$originalAssembly = Get-Content -path ManagementPack\2016\SMLets.Exchange.Connector.Resources\Properties\AssemblyInfo.cs
$assemblyFileVersion = $originalAssembly[$originalAssembly.Length - 1]
$originalAssembly.Replace($assemblyFileVersion, '[assembly: AssemblyFileVersion("' + $newVersion + '")]') | Out-File ManagementPack\2016\SMLets.Exchange.Connector.Resources\Properties\AssemblyInfo.cs
# Create the SMLets.Exchange.Connector.Resources.dll for those using the connector with the SCSM workflow engine
- name: Compile the SMLets.Exchange.Connector.Resources.dll
run: msbuild ManagementPack\2016\SMLets.Exchange.Connector.Resources\SMLets.Exchange.Connector.Resources.csproj
# create a temp directory to build the SMLets Exchange Connector folder structure
- name: Create a local directory C:\smletsexchangeconnector
run: |
New-Item -Path "C:\smletsexchangeconnector" -ItemType Directory
New-Item -Path "C:\smletsexchangeconnector\ManagementPack" -ItemType Directory
New-Item -Path "C:\smletsexchangeconnector\ManagementPack\2016" -ItemType Directory
#copy files to the temp directory to prepare the artifact upload
- name: Copy relevant files to C:\smletsexchangeconnector
run: |
Copy-Item -Path "BouncyCastle.Crypto.dll" -Destination "C:\smletsexchangeconnector\"
Copy-Item -Path "CONTRIBUTING.md" -Destination "C:\smletsexchangeconnector\"
Copy-Item -Path "LICENSE" -Destination "C:\smletsexchangeconnector\"
Copy-Item -Path "MimeKit.dll" -Destination "C:\smletsexchangeconnector\"
Copy-Item -Path "pii_regex.txt" -Destination "C:\smletsexchangeconnector\"
Copy-Item -Path "smletsExchangeConnector.ps1" -Destination "C:\smletsexchangeconnector\"
Copy-Item -Path "smletsExchangeConnector_customEvents.ps1" -Destination "C:\smletsexchangeconnector\"
Copy-Item -Path "CiresonPortalTasks" -Destination "C:\smletsexchangeconnector" -Recurse
Copy-Item -Path "HTMLEmailTemplates" -Destination "C:\smletsexchangeconnector" -Recurse
Copy-Item -Path "ManagementPack\2016\SMLets.Exchange.Connector.Resources\bin\Debug\SMLets.Exchange.Connector.Resources.dll" -Destination "C:\smletsexchangeconnector\ManagementPack\2016\"
Copy-Item -Path "ManagementPack\2016\SMLets.Exchange.Connector\bin\Debug\SMLets.Exchange.Connector.mpb" -Destination "C:\smletsexchangeconnector\ManagementPack\2016\"
# publish the build artifact up to GitHub
- name: publish the artifact (folder) back to GitHub
uses: actions/upload-artifact@master
with:
name: SMletsExchangeConnector
path: C:\smletsexchangeconnector\