Skip to content

Commit 5da95a0

Browse files
author
Michael Koster
committed
merged main
2 parents 4b36e8d + 2daa53b commit 5da95a0

File tree

165 files changed

+2021
-2668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+2021
-2668
lines changed

.github/workflows/admin-cleanup.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
del_runs:
4848
name: Delete Runs
4949
runs-on: ubuntu-latest
50+
permissions:
51+
actions: write
52+
contents: read
5053
steps:
5154
- name: Delete CI workflow runs
5255
uses: Mattraks/delete-workflow-runs@v2

.github/workflows/codeql.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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+
name: "CodeQL Advanced"
8+
9+
on:
10+
push:
11+
branches: [ "main" ]
12+
pull_request:
13+
branches: [ "main" ]
14+
schedule:
15+
- cron: '27 8 * * 3'
16+
17+
jobs:
18+
analyze:
19+
name: Analyze (${{ matrix.language }})
20+
runs-on: ${{ (matrix.language == 'csharp' && 'windows-latest') || 'ubuntu-latest' }}
21+
permissions:
22+
# required for all workflows
23+
security-events: write
24+
25+
# required to fetch internal or private CodeQL packs
26+
packages: read
27+
28+
# only required for workflows in private repositories
29+
actions: read
30+
contents: read
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
include:
36+
- language: actions
37+
build-mode: none
38+
- language: csharp
39+
build-mode: manual
40+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
41+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
42+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
43+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
44+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
45+
steps:
46+
- name: Checkout repository
47+
uses: actions/checkout@v4
48+
49+
# Add any setup steps before running the `github/codeql-action/init` action.
50+
# This includes steps like installing compilers or runtimes. This is typically only required for manual builds.
51+
- name: Setup MSBuild
52+
if: matrix.build-mode == 'manual'
53+
uses: microsoft/setup-msbuild@v2
54+
with:
55+
vs-version: '[17.2,17.15)'
56+
msbuild-architecture: x64
57+
58+
- name: Initialize CodeQL
59+
uses: github/codeql-action/init@v4
60+
with:
61+
languages: ${{ matrix.language }}
62+
build-mode: ${{ matrix.build-mode }}
63+
64+
- name: Run manual build steps
65+
if: matrix.build-mode == 'manual'
66+
shell: pwsh
67+
run: |
68+
$ExtensionAssemblyInfoFile = "$env:GITHUB_WORKSPACE\src\Extension\GlobalAssemblyInfo.cs"
69+
$ExtensionManifestFile = "$env:GITHUB_WORKSPACE\src\Extension\RemoteDebuggerLauncher\source.extension.vsixmanifest"
70+
$ExtensionOutputPath = "$env:GITHUB_WORKSPACE\src\Extension\RemoteDebuggerLauncher\bin\Release"
71+
$ExtensionToolsPath = "$env:GITHUB_WORKSPACE\src\Extension\RemoteDebuggerLauncher\ToolsRemote"
72+
$CheckSumProjectPath = "$env:GITHUB_WORKSPACE\src\RemoteTools\CheckSum\exe\CheckSumExe.csproj"
73+
$RemoteToolsOutputPath = "$env:GITHUB_WORKSPACE\src\RemoteTools\bin"
74+
$ScriptPath = "$env:GITHUB_WORKSPACE\eng\scripts"
75+
76+
# Fixed version for CodeQL builds
77+
$versionPrefix = "0.0.0"
78+
$versionBuild = "0"
79+
$versionRevision = "0"
80+
81+
Write-Host 'Apply assembly version 0.0.0'
82+
& "$ScriptPath\AssemblyInfoFileSetVersion.ps1" -SourceFilePath $ExtensionAssemblyInfoFile `
83+
-VersionPrefix $versionPrefix -VersionBuild $versionBuild -VersionRevision $versionRevision
84+
85+
Write-Host 'Apply VSIX version 0.0.0'
86+
& "$ScriptPath\VsixManifestFileSetVersion.ps1" -SourceFilePath $ExtensionManifestFile -VersionPrefix $versionPrefix
87+
88+
Write-Host 'Publish Remote Tools (dotnet publish)'
89+
dotnet publish $CheckSumProjectPath -c Release --framework net8.0 --runtime linux-x64 -o "$RemoteToolsOutputPath\linux-x64"
90+
dotnet publish $CheckSumProjectPath -c Release --framework net8.0 --runtime linux-arm64 -o "$RemoteToolsOutputPath\linux-arm64"
91+
dotnet publish $CheckSumProjectPath -c Release --framework net8.0 --runtime linux-arm -o "$RemoteToolsOutputPath\linux-arm"
92+
& "$ScriptPath\WriteRemoteToolsVersionJson.ps1" -SourceDirectory $ExtensionToolsPath -Version $versionPrefix
93+
94+
Write-Host 'NuGet restore for extension solution'
95+
msbuild "RemoteDebuggerLauncherExtension.sln" /t:Restore /p:Configuration=Release
96+
97+
Write-Host 'Rebuild extension solution'
98+
msbuild "RemoteDebuggerLauncherExtension.sln" /t:Rebuild /p:Configuration=Release
99+
100+
Write-Host 'Build all sample solutions with dotnet build'
101+
$sampleSolutions = Get-ChildItem -Path "$env:GITHUB_WORKSPACE\samples" -Recurse -Filter "*.sln" | Where-Object { $_.Name -notlike "*.sln.GhostDoc*" }
102+
foreach ($sln in $sampleSolutions) {
103+
Write-Host "Restoring and building sample solution: $($sln.FullName)"
104+
dotnet restore "$($sln.FullName)"
105+
dotnet build "$($sln.FullName)" -c Release --no-restore
106+
}
107+
108+
- name: Perform CodeQL Analysis
109+
uses: github/codeql-action/analyze@v4
110+
with:
111+
category: "/language:${{matrix.language}}"

.github/workflows/project-ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@ on:
55
- 'feature/**'
66
- 'bugfix/**'
77

8+
permissions:
9+
contents: read
10+
811
concurrency:
912
group: ${{ github.workflow }}-${{ github.ref }}
1013
cancel-in-progress: true
1114

1215
jobs:
1316
build:
1417
name: CI Build
18+
permissions:
19+
contents: read
20+
id-token: write
1521
uses: ./.github/workflows/shared-build.yml
1622
with:
17-
store-artifacts: false
23+
store-artifacts: false
24+
environment: CI

.github/workflows/project-release.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,20 @@ concurrency:
1414
jobs:
1515
build:
1616
name: Release Build
17+
permissions:
18+
contents: read
19+
id-token: write
1720
uses: ./.github/workflows/shared-build.yml
1821
with:
1922
store-artifacts: true
2023
sign-vsix: true
24+
environment: Release
25+
azure-timestamp-url: ${{ vars.AZURE_TIMESTAMP_URL }}
2126
secrets:
22-
SIGNING_CERT_PFX: ${{ secrets.SIGNING_CERT_PFX }}
23-
SIGNING_CERT_PASSWORD: ${{ secrets.SIGNING_CERT_PASSWORD }}
24-
SIGNING_CERT_THUMBPRINT: ${{ secrets.SIGNING_CERT_THUMBPRINT }}
27+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
28+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
29+
AZURE_KEYVAULT_URL: ${{ secrets.AZURE_KEYVAULT_URL }}
30+
AZURE_KEYVAULT_CERT_NAME: ${{ secrets.AZURE_KEYVAULT_CERT_NAME }}
2531

2632
github-release:
2733
name: GitHub Release
@@ -59,11 +65,12 @@ jobs:
5965
name: VS Marketplace Release
6066
runs-on: windows-2022
6167
needs: build
68+
permissions: {}
6269
if: ${{ github.ref_type == 'tag' }}
6370

6471
env:
6572
MarketplaceOverviewFile: ${{ github.workspace }}/src/ReleaseNotes.md
6673

6774
steps:
6875
- name: TODO
69-
run: echo TODO
76+
run: echo TODO

.github/workflows/shared-build.yml

Lines changed: 53 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Shared Build
22

3+
permissions:
4+
contents: read
5+
id-token: write
6+
37
on:
48
workflow_call:
59
inputs:
@@ -23,15 +27,27 @@ on:
2327
type: string
2428
required: false
2529
default: 'RemoteDebuggerLauncherExtension.sln'
30+
environment:
31+
description: 'The GitHub Environment to use'
32+
type: string
33+
required: true
34+
azure-timestamp-url:
35+
description: 'The Timestamp URL for code signing'
36+
type: string
37+
required: false
38+
default: ''
2639
secrets:
27-
SIGNING_CERT_PFX:
28-
description: The Base64 encoded PFX file
40+
AZURE_CLIENT_ID:
41+
description: 'The Azure Client ID for authentication'
42+
required: false
43+
AZURE_TENANT_ID:
44+
description: 'The Azure Tenant ID for authentication'
2945
required: false
30-
SIGNING_CERT_PASSWORD:
31-
description: The password for the PFX file
46+
AZURE_KEYVAULT_URL:
47+
description: 'The Azure Key Vault URL for code signing'
3248
required: false
33-
SIGNING_CERT_THUMBPRINT:
34-
description: The cert footprint
49+
AZURE_KEYVAULT_CERT_NAME:
50+
description: 'The Azure Key Vault Certificate Name for code signing'
3551
required: false
3652

3753
jobs:
@@ -54,20 +70,26 @@ jobs:
5470
with:
5571
fetch-depth: 0
5672

57-
# setup MSBUILD and VS
73+
# setup MSBUILD and Visual Studio
5874
- name: Add MSBUILD to PATH
5975
id: msbuild
6076
uses: microsoft/setup-msbuild@v2
6177
with:
62-
vs-version: '[17.2,17.15)'
78+
vs-version: '[17.2,18)'
6379
msbuild-architecture: x64
6480

81+
# Install .NET Sign Tool from NuGet
82+
- name: 'Setup: Install .NET Sign Tool'
83+
if: ${{ inputs.store-artifacts && inputs.sign-vsix }}
84+
run: dotnet tool install --global --prerelease sign
85+
shell: pwsh
86+
6587
# Build Solution: determine and apply the version for the assemblies and VSIX package
6688
- name: 'Build Solution: Determine Version'
6789
id: git-version
6890
uses: ./eng/actions/git-version
6991

70-
# apply dev versions on pushes to any other branches
92+
# apply dev versions on pushes to any other branches
7193
- name: 'Build Solution: Apply assembly version DEV'
7294
if: ${{ github.ref_type == 'branch' && github.ref != 'refs/heads/main' }}
7395
run: ${{ env.ScriptPath }}\AssemblyInfoFileSetVersion.ps1 -SourceFilePath ${{ env.ExtensionAssemblyInfoFile }}
@@ -77,7 +99,7 @@ jobs:
7799
-VersionBuild ${{ steps.git-version.outputs.versionBuild }}
78100
shell: pwsh
79101

80-
# apply prod versions on pushes to the main branch or a tag gets created
102+
# apply prod versions on pushes to the main branch or a tag gets created
81103
- name: 'Build Solution: Apply assembly version PROD'
82104
if: ${{ (github.ref_type == 'branch' && github.ref == 'refs/heads/main') || github.ref_type == 'tag' }}
83105
run: ${{ env.ScriptPath }}\AssemblyInfoFileSetVersion.ps1 -SourceFilePath ${{ env.ExtensionAssemblyInfoFile }}
@@ -98,37 +120,38 @@ jobs:
98120
${{ env.ScriptPath }}\WriteRemoteToolsVersionJson.ps1 -SourceDirectory ${{ env.ExtensionToolsPath }} -Version ${{ steps.git-version.outputs.versionPrefix }}
99121
shell: pwsh
100122

101-
102123
# Build Solution: restore NuGet Packages
103124
- name: 'Build Solution: NuGet restore'
104125
id: nuget-restore
105126
run: msbuild ${{ inputs.solution-path }} /t:Restore /p:Configuration=${{ inputs.configuration }}
106127
shell: pwsh
107128

108-
# Build Solution: creates PFX file from BASE64 secret if signing is enabled
109-
- name: 'Build Solution: prepare VSIX signing'
110-
if: ${{ inputs.store-artifacts && inputs.sign-vsix }}
111-
run: |
112-
$encodedBytes = "${{ secrets.SIGNING_CERT_PFX }}"
113-
[convert]::FromBase64String($encodedBytes) | Set-Content -Path ${{ runner.temp }}\cert.pfx -Encoding Byte
114-
shell: powershell
115-
116-
# Build Solution: Rebuild, and signs VSIX if cert file is present
117-
- name: 'Build Solution: Rebuild and sign'
129+
# Build Solution: Rebuild
130+
- name: 'Build Solution: Rebuild'
118131
id: build
119132
run: msbuild ${{ inputs.solution-path }} /t:Rebuild /p:Configuration=${{ inputs.configuration }}
120133
shell: pwsh
121-
env:
122-
SIGNING_CERT_FILE: ${{ runner.temp }}\cert.pfx
123-
SIGNING_CERT_PASSWORD: ${{ secrets.SIGNING_CERT_PASSWORD }}
124-
SIGNING_CERT_THUMBPRINT: ${{ secrets.SIGNING_CERT_THUMBPRINT }}
125-
SIGNING_TIMESTAMP_SERVER: 'http://timestamp.sectigo.com'
126134

127-
- name: 'Build Solution: VSIX signing cleanup'
128-
if: ${{ inputs.store-artifacts && inputs.sign-vsix }}
129-
run: |
130-
Remove-Item -Path ${{ runner.temp }}\cert.pfx -ErrorAction Continue
135+
# Login to Azure using a ServicePrincipal configured to authenticate against a GitHub Action
136+
- name: 'Build: Azure CLI login'
137+
if: ${{ inputs.store-artifacts && inputs.sign-vsix }}
138+
uses: azure/login@v2
139+
with:
140+
allow-no-subscriptions: true
141+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
142+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
143+
144+
- name: 'Build: Sign VSIX'
145+
if: ${{ inputs.store-artifacts && inputs.sign-vsix }}
131146
shell: pwsh
147+
run: >
148+
sign code azure-key-vault
149+
*.vsix
150+
--base-directory ${{ env.ExtensionOutputPath }}
151+
--azure-credential-type "azure-cli"
152+
--azure-key-vault-url "${{ secrets.AZURE_KEYVAULT_URL }}"
153+
--azure-key-vault-certificate "${{ secrets.AZURE_KEYVAULT_CERT_NAME }}"
154+
--timestamp-url "${{ inputs.azure-timestamp-url }}"
132155
133156
- name: 'Store Artifacts: VSIX'
134157
uses: actions/upload-artifact@v4

docs/ArtWork/Logo.svg

Lines changed: 5 additions & 13 deletions
Loading

samples/net6/Samples-Combined.sln

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)