Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build process, use GitHub workflows #127

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# These are supported funding model platforms

github:
- raandree
- nyanhp
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
push:
branches:
- master
- develop

jobs:
build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v1
- name: Install Prerequisites
run: ./build/vsts-prerequisites.ps1
shell: pwsh
- name: Build
run: ./build/vsts-build.ps1 -SkipPublish -LocalRepo
shell: pwsh
- name: Validate
run: ./build/vsts-validate.ps1
shell: pwsh
- name: Publish
run: ./build/vsts-build.ps1 -ApiKey $env:APIKEY -Preview:$${{ github.ref == 'develop' }}
shell: pwsh
env:
APIKEY: ${{ secrets.NUGETAPIKEY }}
18 changes: 18 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on: [pull_request]

jobs:
validate:

runs-on: windows-latest

steps:
- uses: actions/checkout@v1
- name: Install Prerequisites
run: ./build/vsts-prerequisites.ps1
shell: pwsh
- name: Build
run: ./build/vsts-build.ps1 -SkipPublish -LocalRepo
shell: pwsh
- name: Validate
run: ./build/vsts-validate.ps1
shell: pwsh
24 changes: 12 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Custom
BuildOutput
publish
TestResults

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
Expand All @@ -17,16 +17,16 @@ about_AutomatedLab.Common.help.txt
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
[Xx]64/
[Xx]86/
[Bb]uild/
bld/
[Bb]in/
[Oo]bj/
Library/[Dd]ebug/
Library/[Dd]ebugPublic/
Library/[Rr]elease/
Library/[Rr]eleases/
Library/[Xx]64/
Library/[Xx]86/
Library/[Bb]uild/
Library/bld/
Library/[Bb]in/
Library/[Oo]bj/

# Visual Studio 2015 cache/options directory
.vs/
Expand Down
31 changes: 0 additions & 31 deletions AutomatedLab.Common/.build/build.ps1

This file was deleted.

32 changes: 17 additions & 15 deletions AutomatedLab.Common/AutomatedLab.Common.psd1
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
@{
@{
RootModule = 'AutomatedLab.Common.psm1'

ModuleVersion = '2.1.0'
ModuleVersion = '2.4.0'

GUID = '554685d3-5c61-4080-afd6-1dd3d4d7a261'

Author = 'Raimund Andree, Per Pedersen, Jan-Hendrik Peters'
Expand All @@ -18,25 +19,26 @@

CLRVersion = '4.0'

CompatiblePSEditions = @('Desktop','Core')
CompatiblePSEditions = @('Desktop', 'Core')

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @(
'Add-AccountPrivilege',
'Add-CATemplateStandardPermission',
'Add-Certificate2',
'Add-FunctionToPSSession',
'Add-StringIncrement',
'Add-VariableToPSSession',
'Add-TfsAgentUserCapability',
'ConvertTo-BinaryIP',
'ConvertTo-DecimalIP',
'ConvertTo-DottedDecimalIP',
'Add-VariableToPSSession',
'ConvertTo-BinaryIp',
'ConvertTo-DecimalIp',
'ConvertTo-DottedDecimalIp',
'ConvertTo-Mask',
'ConvertTo-MaskLength',
'Enable-AutoEnrollment',
'Find-CertificateAuthority',
'Get-BroadcastAddress',
'Get-CATemplate',
'Get-CaTemplate',
'Get-Certificate2',
'Get-ConsoleText',
'Get-DotNetFrameworkVersion',
Expand Down Expand Up @@ -71,7 +73,7 @@
'Get-Type',
'Install-SoftwarePackage',
'Invoke-Ternary',
'New-CATemplate',
'New-CaTemplate',
'New-PerformanceDataCollectorSet',
'New-RunspacePool',
'New-TfsAgentQueue',
Expand All @@ -86,31 +88,31 @@
'Remove-PerformanceDataCollectorSet',
'Remove-RunspacePool',
'Remove-TfsAgentUserCapability',
'Request-Certificate',
'Remove-TfsFeed',
'Send-ModuleToPSSession',
'Request-Certificate',
'Send-ModuleToPsSession',
'Set-TfsAgentUserCapability',
'Set-TfsProject',
'Set-TfsFeedPermission',
'Set-TfsProject',
'Split-Array',
'Start-PerformanceDataCollectorSet',
'Start-RunspaceJob',
'Stop-PerformanceDataCollectorSet',
'Sync-Parameter',
'Test-CATemplate',
'Test-CaTemplate',
'Test-HashtableKeys',
'Test-IsAdministrator',
'Test-Port',
'Wait-RunspaceJob'
)

RequiredModules = @('newtonsoft.json', 'PSFileTransfer')
RequiredModules = @('PSFileTransfer')

CmdletsToExport = @()

VariablesToExport = @()

AliasesToExport = '??'
AliasesToExport = '??', 'Set-TfsFeedPermissions'

PrivateData = @{

Expand Down
49 changes: 7 additions & 42 deletions AutomatedLab.Common/AutomatedLab.Common.psm1
Original file line number Diff line number Diff line change
@@ -1,46 +1,11 @@
# Get public and private function definition files.
$modulebase = $PSScriptRoot
# Types first
$typeExists = try { [AutomatedLab.Common.Win32Exception] }catch { }
if (-not $typeExists)
{
try
{
if ($PSEdition -eq 'Core')
{
Add-Type -Path $modulebase/lib/core/AutomatedLab.Common.dll -ErrorAction Stop
}
else
{
Add-Type -Path $modulebase/lib/full/AutomatedLab.Common.dll -ErrorAction Stop
}
}
catch
{
Write-Warning -Message "Unable to add AutomatedLab.Common.dll - GPO and PKI functionality might be impaired.`r`nException was: $($_.Exception.Message), $($_.Exception.LoaderExceptions)"
}
foreach ($file in Get-ChildItem -Path "$PSScriptRoot/internal/functions" -Filter *.ps1 -Recurse) {
. $file.FullName
}

try
{
[ServerCertificateValidationCallback]::Ignore()
foreach ($file in Get-ChildItem -Path "$PSScriptRoot/functions" -Filter *.ps1 -Recurse) {
. $file.FullName
}
catch { }

$importFolders = Get-ChildItem $modulebase -File -Recurse -ErrorAction SilentlyContinue | Group-Object { $_.Directory.Name } -AsHashTable -AsString

# Dot source the files
foreach ($import in @($importFolders.Public + $importFolders.Private))
{
if ($null -eq $import) { continue }
Try
{
. $import.FullName
}
Catch
{
Write-Error -Message "Failed to import function $($import.FullName): $_"
}
}

Export-ModuleMember -Function $importFolders.Public.Basename
foreach ($file in Get-ChildItem -Path "$PSScriptRoot/internal/scripts" -Filter *.ps1 -Recurse) {
. $file.FullName
}
63 changes: 0 additions & 63 deletions AutomatedLab.Common/Common/Public/Add-AccountPrivilege.ps1

This file was deleted.

Loading