Skip to content
26 changes: 25 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

name: Build Plugin

on:
Expand Down Expand Up @@ -27,9 +28,32 @@ jobs:

- name: Install .NET Framework 4.5.2 Developer Pack
run: choco install netfx-4.5.2-devpack -y

- name: Install Group Policy Management
shell: powershell
run: Install-WindowsFeature -Name GPMC -IncludeManagementTools

- name: Prepare Windows build dependencies
shell: powershell
run: |
New-Item -ItemType Directory -Force -Path "$env:GITHUB_WORKSPACE\build-deps"

$groupPolicy = Get-ChildItem "C:\Windows" -Recurse -ErrorAction SilentlyContinue `
-Filter "Microsoft.GroupPolicy.Management.dll" |
Select-Object -First 1

$bitLocker = Get-ChildItem "C:\Windows\System32\WindowsPowerShell\v1.0\Modules\BitLocker" `
-Recurse -ErrorAction Stop `
-Filter "Microsoft.BitLocker.Structures.dll" |
Select-Object -First 1

Copy-Item $bitLocker.FullName "$env:GITHUB_WORKSPACE\build-deps\Microsoft.BitLocker.Structures.dll"
Copy-item $groupPolicy.FullName "$env:GITHUB_WORKSPACE\build-deps\Microsoft.GroupPolicy.Management.dll"
Get-ChildItem "$env:GITHUB_WORKSPACE\build-deps"


- name: Build solution
run: msbuild AutomateBitlockerPlugin\AutomateBitlockerPlugin.csproj /p:Configuration=Release
run: msbuild AutomateBitlockerPlugin\AutomateBitlockerPlugin.csproj /p:Configuration=Release /p:ReferencePath="${{ github.workspace }}\build-deps"

- name: Upload compiled plugin
uses: actions/upload-artifact@v4
Expand Down
22 changes: 11 additions & 11 deletions AutomateBitlockerPlugin/AutomateBitlockerPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@
<Reference Include="Interfaces">
<HintPath>..\References\Interfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.BitLocker.Structures">
<HintPath>..\..\..\..\..\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules\BitLocker\Microsoft.BitLocker.Structures.dll</HintPath>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.GroupPolicy.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.GroupPolicy.ServerAdminTools.GpmgmtLib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<Reference Include="Microsoft.BitLocker.Structures">
<HintPath>..\build-deps\Microsoft.BitLocker.Structures.dll</HintPath>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.GroupPolicy.Management">
<HintPath>..\build-deps\Microsoft.GroupPolicy.Management.dll</HintPath>
<Private>True</Private>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.GroupPolicy.ServerAdminTools.GpmgmtLib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<EmbedInteropTypes>False</EmbedInteropTypes>
<HintPath>..\References\Microsoft.GroupPolicy.ServerAdminTools.GpmgmtLib.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -220,4 +220,4 @@
<Error Condition="!Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets'))" />
</Target>
<Import Project="..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets')" />
</Project>
</Project>
Loading