Skip to content

Commit 1574484

Browse files
authored
GitHub Actions - CodeQL (#246)
* 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
1 parent 8934cae commit 1574484

1 file changed

Lines changed: 107 additions & 0 deletions

File tree

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ primary ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ primary ]
20+
schedule:
21+
- cron: '39 5 * * 3'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: windows-latest
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
language: [ 'csharp', 'javascript' ]
32+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
33+
# Learn more:
34+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
35+
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v2
39+
40+
# Initializes the CodeQL tools for scanning.
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@v1
43+
with:
44+
languages: ${{ matrix.language }}
45+
# If you wish to specify custom queries, you can do so here or in a config file.
46+
# By default, queries listed here will override any specified in a config file.
47+
# Prefix the list here with "+" to use these queries and those in the config file.
48+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
49+
50+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
51+
# If this step fails, then you should remove it and run the build manually (see below)
52+
#- name: Autobuild
53+
# uses: github/codeql-action/autobuild@v1
54+
55+
# ℹ️ Command-line programs to run using the OS shell.
56+
# 📚 https://git.io/JvXDl
57+
58+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
59+
# and modify them (or add more) to build your code if your project
60+
# uses a compiled language
61+
62+
- run: |
63+
# Checks-out repository under $GITHUB_WORKSPACE, so job can access it
64+
- uses: actions/checkout@v2
65+
with:
66+
ref: ${{ github.event.inputs.branch }}
67+
68+
# Add MSBuild to environment path
69+
- name: Add msbuild to PATH
70+
uses: microsoft/setup-msbuild@v1.0.2
71+
72+
# copy dependencies over
73+
- name: Copy Dependencies folder from the repo to Build for MP signing and show them
74+
run: |
75+
Copy-Item -Path ManagementPack\2016\dependencies -Destination "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VSAC\" -Recurse
76+
Get-ChildItem "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VSAC\"
77+
78+
# Build the Settings UI dll
79+
- name: Compile SMLetsExchangeConnectorSettingsUI.dll
80+
run: msbuild ManagementPack/2016/SMLetsExchangeConnectorSettingsUI/SMLetsExchangeConnectorSettingsUI.csproj
81+
82+
#change the MPB version
83+
- name: Change the next MPB build version
84+
run: |
85+
[xml]$build = Get-Content ManagementPack\2016\SMLets.Exchange.Connector\SMLets.Exchange.Connector.mpproj
86+
$build.Project.PropertyGroup[0].Version = "${{ github.event.inputs.version }}"
87+
$build.Project.PropertyGroup[1].Copyright = "AdhocAdam, " + (Get-Date).Year + "."
88+
$build.Save("ManagementPack\2016\SMLets.Exchange.Connector\SMLets.Exchange.Connector.mpproj")
89+
90+
# Convert Management Pack Fragments to single XML, seal it to create the MP, bind the DLL to it, and thus create the MPB
91+
- name: Sign the XML to create the MP. Then combine the MP and DLL to create the MPB
92+
run: msbuild ManagementPack/2016/SMLets.Exchange.Connector.sln
93+
94+
#change the Resources.DLL version
95+
- name: Change the SMLets.Exchange.Connector.Resources.dll File Assembly version
96+
run: |
97+
$newVersion = "${{ github.event.inputs.version }}"
98+
$originalAssembly = Get-Content -path ManagementPack\2016\SMLets.Exchange.Connector.Resources\Properties\AssemblyInfo.cs
99+
$assemblyFileVersion = $originalAssembly[$originalAssembly.Length - 1]
100+
$originalAssembly.Replace($assemblyFileVersion, '[assembly: AssemblyFileVersion("' + $newVersion + '")]') | Out-File ManagementPack\2016\SMLets.Exchange.Connector.Resources\Properties\AssemblyInfo.cs
101+
102+
# Create the SMLets.Exchange.Connector.Resources.dll for those using the connector with the SCSM workflow engine
103+
- name: Compile the SMLets.Exchange.Connector.Resources.dll
104+
run: msbuild ManagementPack\2016\SMLets.Exchange.Connector.Resources\SMLets.Exchange.Connector.Resources.csproj
105+
106+
- name: Perform CodeQL Analysis
107+
uses: github/codeql-action/analyze@v1

0 commit comments

Comments
 (0)