Skip to content

Commit 0999340

Browse files
authored
GitHub Actions - Dedicated Build Actions (#248)
* GitHub Actions: Build and Release (#236) * build and release GitHub Action that compiles the connector's C# management pack and other dependencies. Then creates a draft release with the attached zip. Takes three inputs - branch name, version, and if the Release to be drafted should be marked as release/pre-release * github dependencies new dependencies required for GitHub Action to compile the sln natively on GitHub * github dependencies VSAE schemas required for building through GitHub Actions * Revert "GitHub Actions: Build and Release (#236)" (#237) This reverts commit b861a46. * GitHub Actions: Build and Release (#238) * build and release GitHub Action that compiles the connector's C# management pack and other dependencies. Then creates a draft release with the attached zip. Takes three inputs - branch name, version, and if the Release to be drafted should be marked as release/pre-release * github dependencies new dependencies required for GitHub Action to compile the sln natively on GitHub * github dependencies VSAE schemas required for building through GitHub Actions * build and release (directory change) GitHub Action that compiles the connector's C# management pack and other dependencies. Then creates a draft release with the attached zip. Takes three inputs - branch name, version, and if the Release to be drafted should be marked as release/pre-release * moving directories placed in /workflows * GitHub Actions: Build and Release (#240) * build and release GitHub Action that compiles the connector's C# management pack and other dependencies. Then creates a draft release with the attached zip. Takes three inputs - branch name, version, and if the Release to be drafted should be marked as release/pre-release * github dependencies new dependencies required for GitHub Action to compile the sln natively on GitHub * github dependencies VSAE schemas required for building through GitHub Actions * build and release (directory change) GitHub Action that compiles the connector's C# management pack and other dependencies. Then creates a draft release with the attached zip. Takes three inputs - branch name, version, and if the Release to be drafted should be marked as release/pre-release * moving directories placed in /workflows * updating SLN for GitHub Fixing: The project "SMLets.Exchange.Connector" is not selected for building in solution configuration "Debug|Any CPU". * GitHub Actions - CodeQL (#242) initial commit/testing CodeQL * Revert "GitHub Actions - CodeQL (#242)" (#244) This reverts commit 6f14f86. * CodeQL workflow (#245) GitHub Action to perform code scanning with CodeQL * GitHub Actions - Branch Build Actions (#247) * build and release GitHub Action that compiles the connector's C# management pack and other dependencies. Then creates a draft release with the attached zip. Takes three inputs - branch name, version, and if the Release to be drafted should be marked as release/pre-release * github dependencies new dependencies required for GitHub Action to compile the sln natively on GitHub * github dependencies VSAE schemas required for building through GitHub Actions * build and release (directory change) GitHub Action that compiles the connector's C# management pack and other dependencies. Then creates a draft release with the attached zip. Takes three inputs - branch name, version, and if the Release to be drafted should be marked as release/pre-release * moving directories placed in /workflows * updating SLN for GitHub Fixing: The project "SMLets.Exchange.Connector" is not selected for building in solution configuration "Debug|Any CPU". * individual branch builds creating dedicated workflows for both primary/dev branches builds
1 parent 1574484 commit 0999340

2 files changed

Lines changed: 184 additions & 0 deletions

File tree

.github/workflows/BuildDev.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# This is a basic workflow to help you get started with Actions
2+
name: Dev Branch - Build
3+
4+
# Controls when the action will run
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'Do not include the leading V. This will be the next version for the Release, MPB, and DLL'
10+
required: true
11+
12+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
13+
jobs:
14+
# Job 1, Build - Build the Management Pack on Windows Server with Visual Studio
15+
build:
16+
runs-on: windows-latest
17+
18+
# Steps represent a sequence of tasks that will be executed as part of the job
19+
steps:
20+
# Checks-out repository under $GITHUB_WORKSPACE, so job can access it
21+
- uses: actions/checkout@v2
22+
with:
23+
ref: dev
24+
25+
# Add MSBuild to environment path
26+
- name: Add msbuild to PATH
27+
uses: microsoft/setup-msbuild@v1.0.2
28+
29+
# copy dependencies over
30+
- name: Copy Dependencies folder from the repo to Build for MP signing and show them
31+
run: |
32+
Copy-Item -Path ManagementPack\2016\dependencies -Destination "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VSAC\" -Recurse
33+
Get-ChildItem "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VSAC\"
34+
35+
# Build the Settings UI dll
36+
- name: Compile SMLetsExchangeConnectorSettingsUI.dll
37+
run: msbuild ManagementPack/2016/SMLetsExchangeConnectorSettingsUI/SMLetsExchangeConnectorSettingsUI.csproj
38+
39+
#change the MPB version
40+
- name: Change the next MPB build version
41+
run: |
42+
[xml]$build = Get-Content ManagementPack\2016\SMLets.Exchange.Connector\SMLets.Exchange.Connector.mpproj
43+
$build.Project.PropertyGroup[0].Version = "${{ github.event.inputs.version }}"
44+
$build.Project.PropertyGroup[1].Copyright = "AdhocAdam, " + (Get-Date).Year + "."
45+
$build.Save("ManagementPack\2016\SMLets.Exchange.Connector\SMLets.Exchange.Connector.mpproj")
46+
47+
# Convert Management Pack Fragments to single XML, seal it to create the MP, bind the DLL to it, and thus create the MPB
48+
- name: Sign the XML to create the MP. Then combine the MP and DLL to create the MPB
49+
run: msbuild ManagementPack/2016/SMLets.Exchange.Connector.sln
50+
51+
#change the Resources.DLL version
52+
- name: Change the SMLets.Exchange.Connector.Resources.dll File Assembly version
53+
run: |
54+
$newVersion = "${{ github.event.inputs.version }}"
55+
$originalAssembly = Get-Content -path ManagementPack\2016\SMLets.Exchange.Connector.Resources\Properties\AssemblyInfo.cs
56+
$assemblyFileVersion = $originalAssembly[$originalAssembly.Length - 1]
57+
$originalAssembly.Replace($assemblyFileVersion, '[assembly: AssemblyFileVersion("' + $newVersion + '")]') | Out-File ManagementPack\2016\SMLets.Exchange.Connector.Resources\Properties\AssemblyInfo.cs
58+
59+
# Create the SMLets.Exchange.Connector.Resources.dll for those using the connector with the SCSM workflow engine
60+
- name: Compile the SMLets.Exchange.Connector.Resources.dll
61+
run: msbuild ManagementPack\2016\SMLets.Exchange.Connector.Resources\SMLets.Exchange.Connector.Resources.csproj
62+
63+
# create a temp directory to build the SMLets Exchange Connector folder structure
64+
- name: Create a local directory C:\smletsexchangeconnector
65+
run: |
66+
New-Item -Path "C:\smletsexchangeconnector" -ItemType Directory
67+
New-Item -Path "C:\smletsexchangeconnector\ManagementPack" -ItemType Directory
68+
New-Item -Path "C:\smletsexchangeconnector\ManagementPack\2016" -ItemType Directory
69+
70+
#copy files to the temp directory to prepare the artifact upload
71+
- name: Copy relevant files to C:\smletsexchangeconnector
72+
run: |
73+
Copy-Item -Path "BouncyCastle.Crypto.dll" -Destination "C:\smletsexchangeconnector\"
74+
Copy-Item -Path "CONTRIBUTING.md" -Destination "C:\smletsexchangeconnector\"
75+
Copy-Item -Path "LICENSE" -Destination "C:\smletsexchangeconnector\"
76+
Copy-Item -Path "MimeKit.dll" -Destination "C:\smletsexchangeconnector\"
77+
Copy-Item -Path "pii_regex.txt" -Destination "C:\smletsexchangeconnector\"
78+
Copy-Item -Path "smletsExchangeConnector.ps1" -Destination "C:\smletsexchangeconnector\"
79+
Copy-Item -Path "smletsExchangeConnector_customEvents.ps1" -Destination "C:\smletsexchangeconnector\"
80+
81+
Copy-Item -Path "CiresonPortalTasks" -Destination "C:\smletsexchangeconnector" -Recurse
82+
Copy-Item -Path "HTMLEmailTemplates" -Destination "C:\smletsexchangeconnector" -Recurse
83+
84+
Copy-Item -Path "ManagementPack\2016\SMLets.Exchange.Connector.Resources\bin\Debug\SMLets.Exchange.Connector.Resources.dll" -Destination "C:\smletsexchangeconnector\ManagementPack\2016\"
85+
Copy-Item -Path "ManagementPack\2016\SMLets.Exchange.Connector\bin\Debug\SMLets.Exchange.Connector.mpb" -Destination "C:\smletsexchangeconnector\ManagementPack\2016\"
86+
87+
# publish the build artifact up to GitHub
88+
- name: publish the artifact (folder) back to GitHub
89+
uses: actions/upload-artifact@master
90+
with:
91+
name: SMletsExchangeConnector
92+
path: C:\smletsexchangeconnector\

.github/workflows/BuildPrimary.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# This is a basic workflow to help you get started with Actions
2+
name: Primary Branch - Build
3+
4+
# Controls when the action will run
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'Do not include the leading V. This will be the next version for the Release, MPB, and DLL'
10+
required: true
11+
12+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
13+
jobs:
14+
# Job 1, Build - Build the Management Pack on Windows Server with Visual Studio
15+
build:
16+
runs-on: windows-latest
17+
18+
# Steps represent a sequence of tasks that will be executed as part of the job
19+
steps:
20+
# Checks-out repository under $GITHUB_WORKSPACE, so job can access it
21+
- uses: actions/checkout@v2
22+
with:
23+
ref: primary
24+
25+
# Add MSBuild to environment path
26+
- name: Add msbuild to PATH
27+
uses: microsoft/setup-msbuild@v1.0.2
28+
29+
# copy dependencies over
30+
- name: Copy Dependencies folder from the repo to Build for MP signing and show them
31+
run: |
32+
Copy-Item -Path ManagementPack\2016\dependencies -Destination "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VSAC\" -Recurse
33+
Get-ChildItem "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VSAC\"
34+
35+
# Build the Settings UI dll
36+
- name: Compile SMLetsExchangeConnectorSettingsUI.dll
37+
run: msbuild ManagementPack/2016/SMLetsExchangeConnectorSettingsUI/SMLetsExchangeConnectorSettingsUI.csproj
38+
39+
#change the MPB version
40+
- name: Change the next MPB build version
41+
run: |
42+
[xml]$build = Get-Content ManagementPack\2016\SMLets.Exchange.Connector\SMLets.Exchange.Connector.mpproj
43+
$build.Project.PropertyGroup[0].Version = "${{ github.event.inputs.version }}"
44+
$build.Project.PropertyGroup[1].Copyright = "AdhocAdam, " + (Get-Date).Year + "."
45+
$build.Save("ManagementPack\2016\SMLets.Exchange.Connector\SMLets.Exchange.Connector.mpproj")
46+
47+
# Convert Management Pack Fragments to single XML, seal it to create the MP, bind the DLL to it, and thus create the MPB
48+
- name: Sign the XML to create the MP. Then combine the MP and DLL to create the MPB
49+
run: msbuild ManagementPack/2016/SMLets.Exchange.Connector.sln
50+
51+
#change the Resources.DLL version
52+
- name: Change the SMLets.Exchange.Connector.Resources.dll File Assembly version
53+
run: |
54+
$newVersion = "${{ github.event.inputs.version }}"
55+
$originalAssembly = Get-Content -path ManagementPack\2016\SMLets.Exchange.Connector.Resources\Properties\AssemblyInfo.cs
56+
$assemblyFileVersion = $originalAssembly[$originalAssembly.Length - 1]
57+
$originalAssembly.Replace($assemblyFileVersion, '[assembly: AssemblyFileVersion("' + $newVersion + '")]') | Out-File ManagementPack\2016\SMLets.Exchange.Connector.Resources\Properties\AssemblyInfo.cs
58+
59+
# Create the SMLets.Exchange.Connector.Resources.dll for those using the connector with the SCSM workflow engine
60+
- name: Compile the SMLets.Exchange.Connector.Resources.dll
61+
run: msbuild ManagementPack\2016\SMLets.Exchange.Connector.Resources\SMLets.Exchange.Connector.Resources.csproj
62+
63+
# create a temp directory to build the SMLets Exchange Connector folder structure
64+
- name: Create a local directory C:\smletsexchangeconnector
65+
run: |
66+
New-Item -Path "C:\smletsexchangeconnector" -ItemType Directory
67+
New-Item -Path "C:\smletsexchangeconnector\ManagementPack" -ItemType Directory
68+
New-Item -Path "C:\smletsexchangeconnector\ManagementPack\2016" -ItemType Directory
69+
70+
#copy files to the temp directory to prepare the artifact upload
71+
- name: Copy relevant files to C:\smletsexchangeconnector
72+
run: |
73+
Copy-Item -Path "BouncyCastle.Crypto.dll" -Destination "C:\smletsexchangeconnector\"
74+
Copy-Item -Path "CONTRIBUTING.md" -Destination "C:\smletsexchangeconnector\"
75+
Copy-Item -Path "LICENSE" -Destination "C:\smletsexchangeconnector\"
76+
Copy-Item -Path "MimeKit.dll" -Destination "C:\smletsexchangeconnector\"
77+
Copy-Item -Path "pii_regex.txt" -Destination "C:\smletsexchangeconnector\"
78+
Copy-Item -Path "smletsExchangeConnector.ps1" -Destination "C:\smletsexchangeconnector\"
79+
Copy-Item -Path "smletsExchangeConnector_customEvents.ps1" -Destination "C:\smletsexchangeconnector\"
80+
81+
Copy-Item -Path "CiresonPortalTasks" -Destination "C:\smletsexchangeconnector" -Recurse
82+
Copy-Item -Path "HTMLEmailTemplates" -Destination "C:\smletsexchangeconnector" -Recurse
83+
84+
Copy-Item -Path "ManagementPack\2016\SMLets.Exchange.Connector.Resources\bin\Debug\SMLets.Exchange.Connector.Resources.dll" -Destination "C:\smletsexchangeconnector\ManagementPack\2016\"
85+
Copy-Item -Path "ManagementPack\2016\SMLets.Exchange.Connector\bin\Debug\SMLets.Exchange.Connector.mpb" -Destination "C:\smletsexchangeconnector\ManagementPack\2016\"
86+
87+
# publish the build artifact up to GitHub
88+
- name: publish the artifact (folder) back to GitHub
89+
uses: actions/upload-artifact@master
90+
with:
91+
name: SMletsExchangeConnector
92+
path: C:\smletsexchangeconnector\

0 commit comments

Comments
 (0)