Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
370 commits
Select commit Hold shift + click to select a range
85303ee
formatting + Throttle Limit
jworkmanjc Oct 21, 2024
e689728
Tests generate cert
jworkmanjc Oct 21, 2024
a0d38bb
Merge pull request #612 from TheJumpCloud/CUT-4309_parallelCertDeploy…
jworkmanjc Oct 22, 2024
5fd9813
username from parameter
jworkmanjc Dec 6, 2024
218dddc
test on 2.0.0 branch
jworkmanjc Dec 6, 2024
5a6df66
use environment to test
jworkmanjc Dec 6, 2024
6b772bc
env key
jworkmanjc Dec 6, 2024
5359665
revert env
jworkmanjc Dec 6, 2024
619dc3b
update user cert generation tests
jworkmanjc Dec 6, 2024
6802d65
hyphen and localUsername tests
jworkmanjc Dec 6, 2024
6b02e33
test the command body
jworkmanjc Dec 6, 2024
60ec543
get usernames if calling -UserCerts as a list
jworkmanjc Dec 6, 2024
ae85678
do not test null strings
jworkmanjc Dec 6, 2024
6bc3c0b
debug username match
jworkmanjc Dec 6, 2024
10ef5c7
windows match tests
jworkmanjc Dec 6, 2024
5b52a89
update user manually for association tests
jworkmanjc Dec 6, 2024
d75420b
update test for duplicate commands already existing
jworkmanjc Dec 10, 2024
1bf03eb
tests
jworkmanjc Dec 10, 2024
dba3911
update global variables by users (including new users)
jworkmanjc Dec 10, 2024
d4da7c1
start command on the ID
jworkmanjc Dec 10, 2024
58f2f0b
manual association
jworkmanjc Dec 10, 2024
f8c71bc
fix for EmailSAN replacement certs
jworkmanjc Dec 10, 2024
43061ba
remove todo
jworkmanjc Dec 10, 2024
c8a4beb
CUT-4505 resolve EmailSAN Replacement
jworkmanjc Dec 10, 2024
c1235a2
Merge pull request #627 from TheJumpCloud/CUT-4504_usernameHyphen
jworkmanjc Dec 11, 2024
7172eec
get reports with the sdk functions
jworkmanjc Dec 13, 2024
80ee5a0
hide debug write-hosts
jworkmanjc Dec 13, 2024
a88ed34
Merge pull request #632 from TheJumpCloud/CUT-4519_getReportsWithSDKF…
jworkmanjc Dec 13, 2024
1a8eab5
UTC Time
jworkmanjc Jan 6, 2025
9622d33
ISO 8601 timestamps
jworkmanjc Jan 6, 2025
72b06fb
Merge pull request #636 from TheJumpCloud/CUT-4551_Radius_UTC_Time
jworkmanjc Jan 6, 2025
05e6d59
fix for one user in usergroup
gweinjc Jan 8, 2025
2ea6ef6
Test single user addition
gweinjc Jan 8, 2025
d8cbb2d
fix param
gweinjc Jan 14, 2025
fd9606f
syntax error in test
gweinjc Jan 14, 2025
05a5856
foreach
gweinjc Jan 14, 2025
2286eef
create a certificate if it's been removed even if it's not associated
jworkmanjc Jan 15, 2025
114fb6e
Merge pull request #638 from TheJumpCloud/CUT-3740_RadiusSingleUserFix
jworkmanjc Jan 15, 2025
7d2ec46
exit bug + validate ca password entry
kmaranionjc Jan 15, 2025
32ef4ee
changelog + messaging
kmaranionjc Jan 15, 2025
d75f472
hide write-host
kmaranionjc Jan 15, 2025
3f99528
fix
kmaranionjc Jan 15, 2025
6f45e72
Merge pull request #639 from TheJumpCloud/CUT-4091-VerifyPasswordForC…
kmaranionjc Jan 16, 2025
e43e027
root cert menu
kmaranionjc Jan 29, 2025
3435b1f
cleanup cli
kmaranionjc Jan 29, 2025
0ff032b
fix test prompts
kmaranionjc Jan 29, 2025
12a35bd
test
kmaranionjc Jan 29, 2025
0839d9a
Cert backups folder
kmaranionjc Jan 29, 2025
6fd540e
test
kmaranionjc Jan 29, 2025
a07d8e1
cert backups
kmaranionjc Jan 29, 2025
5df50db
remove-item
kmaranionjc Jan 29, 2025
16882be
messaging
kmaranionjc Jan 29, 2025
a353fe2
menu
kmaranionjc Jan 30, 2025
21e4b49
spacing on menu options
jworkmanjc Jan 30, 2025
8ad13e0
changelog
kmaranionjc Jan 30, 2025
41e2210
Merge branch 'CUT-4092-Automate-Replace-Expiring-Cert' of ssh://githu…
kmaranionjc Jan 30, 2025
d1b90fb
wiki for cert renewal
kmaranionjc Jan 30, 2025
1468035
Merge pull request #644 from TheJumpCloud/CUT-4092-Automate-Replace-E…
kmaranionjc Jan 30, 2025
d47871e
Tests for radius membership
jworkmanjc Jan 31, 2025
7f645ed
user variable to test
jworkmanjc Jan 31, 2025
14e2629
remove duplicate code
jworkmanjc Jan 31, 2025
f14296e
only return certs for the selected cert type and filter by users in t…
jworkmanjc Jan 31, 2025
e0cbc81
fix for returning users with an index of 0
jworkmanjc Jan 31, 2025
3dc7f3f
validate user cert tests
jworkmanjc Jan 31, 2025
b5c8bfa
Merge pull request #647 from TheJumpCloud/CUT-4093_testRadiusMembership
jworkmanjc Feb 4, 2025
5352ca6
Create Get-JCRCertReport.ps1
gweinjc Feb 18, 2025
a3a52ea
Update Get-JCRCertReport.ps1
gweinjc Feb 21, 2025
14a5d91
arraylist
gweinjc Feb 25, 2025
76f300c
update .psd1
gweinjc Feb 25, 2025
8f55d00
test path and remove useless loop
gweinjc Feb 25, 2025
61d9ff9
fix path validation
gweinjc Feb 25, 2025
5f77d2d
Create Get-JCRCertReport.Tests.ps1
gweinjc Feb 25, 2025
22114b4
add tag
gweinjc Feb 26, 2025
5a77e6e
Merge pull request #655 from TheJumpCloud/CUT-4602_multiGroupRadiusRe…
gweinjc Feb 26, 2025
75c56b6
multi group radius added
jworkmanjc Feb 28, 2025
94c8081
spacing in readme
jworkmanjc Feb 28, 2025
b991b6d
update tests to validate commandNames in users.json
jworkmanjc Mar 20, 2025
cb251cd
get the correct command name
jworkmanjc Mar 20, 2025
207f1ee
userID not username to get userdata
jworkmanjc Mar 20, 2025
b4c9efb
Merge pull request #661 from TheJumpCloud/CUT-4540_commandNameBug
jworkmanjc Mar 20, 2025
239c29b
Create New-JCRadiusConfig.ps1
gweinjc Mar 24, 2025
672224c
Rename module
jworkmanjc Mar 26, 2025
25b6c4c
hide radius files
jworkmanjc Mar 26, 2025
fe0ff97
hire reports
jworkmanjc Mar 26, 2025
677d499
first pass on update module function
jworkmanjc Mar 26, 2025
f8d97c0
move Start-RadiusDeployment
jworkmanjc Mar 26, 2025
1dcd26e
create public functions
jworkmanjc Mar 26, 2025
94ab979
new default config file
gweinjc Mar 27, 2025
7752089
rename to JCRConfigFile
gweinjc Mar 27, 2025
76bbe65
rename to JCRConfigFile
gweinjc Mar 27, 2025
ffe2c36
first pass at update tests
jworkmanjc Mar 27, 2025
90a1b18
Merge branch 'CUT-4639_UpdateModuleFunctionsConfig' of ssh://github.c…
jworkmanjc Mar 27, 2025
e7d4875
re-organize files
gweinjc Mar 28, 2025
ddb9938
delete unneeded file
gweinjc Mar 28, 2025
644a6b6
fix path
gweinjc Mar 28, 2025
a6fb4f5
nest config variables in globalvar
gweinjc Mar 28, 2025
97639cd
lastUpdate not writable
gweinjc Mar 28, 2025
df37a3a
Create Set-JCRConfigFile.ps1
gweinjc Mar 28, 2025
0c0b550
set global jcconfig variable
gweinjc Mar 28, 2025
7376ea8
remove unneeded semicolon
gweinjc Mar 28, 2025
91a402f
incorrect function name
gweinjc Mar 28, 2025
faae909
flatten return object
gweinjc Mar 28, 2025
b2a6fb0
remove key name lookups
gweinjc Mar 28, 2025
aeb5522
add required property
gweinjc Mar 31, 2025
14edb15
fix return object with -raw param
gweinjc Mar 31, 2025
3392f8d
add placeholder property
gweinjc Mar 31, 2025
e903348
Create Confirm-JCRConfigFile.ps1
gweinjc Mar 31, 2025
9a7883a
update path
jworkmanjc Mar 31, 2025
93e22dc
ignore config.json
jworkmanjc Mar 31, 2025
c139d72
config changes
jworkmanjc Mar 31, 2025
faacc23
update function names
jworkmanjc Mar 31, 2025
c8c58b9
write last update needed when we set this in the module
jworkmanjc Mar 31, 2025
5fc1253
Set-JCRSettingsFile -> Set-JCRConfigFile
jworkmanjc Mar 31, 2025
e18fe6e
update config
jworkmanjc Apr 2, 2025
c37f219
update Build-HelpFiles files from main branch
jworkmanjc Apr 2, 2025
a89469c
temp module validation tests
jworkmanjc Apr 2, 2025
1aebc70
global JCRConfig settings
jworkmanjc Apr 7, 2025
3f693f8
psd1 date
jworkmanjc Jun 2, 2025
38abfcc
check changelog
jworkmanjc Jun 2, 2025
45c1854
check workflow
jworkmanjc Jun 2, 2025
bf41676
global settings/ variables in config.json
jworkmanjc Jun 2, 2025
1d7b11d
Module version Tests
jworkmanjc Jun 2, 2025
20f0966
cache path
jworkmanjc Jun 2, 2025
7010b52
private functions load before setupRadiusOrg
jworkmanjc Jun 2, 2025
b856be6
import module
jworkmanjc Jun 2, 2025
e5771a7
settingsFille -> ConfigFile
jworkmanjc Jun 2, 2025
ea03d58
setup org with variables
jworkmanjc Jun 2, 2025
2120281
generate cert variables
jworkmanjc Jun 2, 2025
e1037df
variables from config
jworkmanjc Jun 2, 2025
4abbd2c
paths with new variables
jworkmanjc Jun 2, 2025
eea883d
lastUpdate
jworkmanjc Jun 2, 2025
1a48349
global vars changes
jworkmanjc Jun 2, 2025
6edb382
user cert paths
jworkmanjc Jun 4, 2025
ab363ce
pester variables
jworkmanjc Jun 4, 2025
9bfd77d
test update in get-CertInfo
jworkmanjc Jun 4, 2025
feb60cd
Revert "test update in get-CertInfo"
jworkmanjc Jun 4, 2025
0ea11b6
get global vars on import
jworkmanjc Jun 4, 2025
565c869
module validation with API key
jworkmanjc Jun 4, 2025
904ba88
set env
jworkmanjc Jun 4, 2025
675ef66
multiple param sets
jworkmanjc Jun 4, 2025
432fb61
module load order
jworkmanjc Jun 4, 2025
a124a7a
setup Org
jworkmanjc Jun 4, 2025
8647e75
order
jworkmanjc Jun 4, 2025
24b925d
functions load order
jworkmanjc Jun 4, 2025
8577a67
session import
jworkmanjc Jun 4, 2025
0535e49
user cert location log
jworkmanjc Jun 4, 2025
0df9bb8
resolve path
jworkmanjc Jun 4, 2025
8d90794
resolve path
jworkmanjc Jun 4, 2025
9b98560
update filter
jworkmanjc Jun 4, 2025
5e0eb5a
cert info debugging
jworkmanjc Jun 4, 2025
49cee6c
debug with radius directory
jworkmanjc Jun 4, 2025
70207b8
cert info warning
jworkmanjc Jun 4, 2025
be15b8e
additional debug
jworkmanjc Jun 4, 2025
3e81dfe
no need to setup org for module validation
jworkmanjc Jun 4, 2025
9f6c644
Revert "multiple param sets"
jworkmanjc Jun 4, 2025
d85237b
resolve path
jworkmanjc Jun 4, 2025
370a4d2
update radius module tests
jworkmanjc Jun 4, 2025
a175860
test path and show
jworkmanjc Jun 4, 2025
c3b63e2
don't re-direct output and resolve path
jworkmanjc Jun 4, 2025
b8b8541
case sensitive extension file
jworkmanjc Jun 4, 2025
c67d8e9
case insensitive extension path
jworkmanjc Jun 4, 2025
02225b5
Case sensitive
jworkmanjc Jun 4, 2025
822b451
case insensitive cert info
jworkmanjc Jun 4, 2025
c4bc212
create dirs on import
jworkmanjc Jun 5, 2025
b55040f
Revert "create dirs on import"
jworkmanjc Jun 5, 2025
082b59f
Revert "case insensitive cert info"
jworkmanjc Jun 5, 2025
87fe2af
no need to import private functions here
jworkmanjc Jun 5, 2025
2310cd4
for parallel threads import the private functions
jworkmanjc Jun 5, 2025
970c60e
set script root explicitly
jworkmanjc Jun 5, 2025
1b32911
no need to resolve path
jworkmanjc Jun 5, 2025
2557d62
set global config
jworkmanjc Jun 6, 2025
4db66eb
set global vars
jworkmanjc Jun 6, 2025
e93e222
user agent
jworkmanjc Jun 6, 2025
e30e4dc
debug logging
jworkmanjc Jun 9, 2025
0fda727
subject headers differences in ubuntu/macOS
jworkmanjc Jun 9, 2025
df2a316
set the user cert validity in the user cert tests
jworkmanjc Jun 9, 2025
019c4ed
update module tests
jworkmanjc Jun 10, 2025
80cb87c
required modules
jworkmanjc Jun 10, 2025
fab8955
update install tests
jworkmanjc Jun 10, 2025
fac9090
debugging
jworkmanjc Jun 11, 2025
a56ab4c
ubuntu debugging
jworkmanjc Jun 11, 2025
52485ca
fullname
jworkmanjc Jun 11, 2025
cd78d17
update module tests
jworkmanjc Jun 11, 2025
e1a38d4
update module tests
jworkmanjc Jun 11, 2025
460b308
module update tests
jworkmanjc Jun 11, 2025
bef5abf
JCRScriptRoot + extensions tests
jworkmanjc Jun 12, 2025
2e7d1a3
clean up write-hosts
jworkmanjc Jun 13, 2025
9f9785a
validate user and cert dir
jworkmanjc Jun 13, 2025
4b01266
validate radius dir outside module path
jworkmanjc Jun 13, 2025
a41d2c7
create radius directory if it does not exist
jworkmanjc Jun 13, 2025
a573dc8
write-hosts
jworkmanjc Jun 13, 2025
8a2a473
module name for Build-HelpFiles
jworkmanjc Jun 16, 2025
d78ba23
deploy first pass
jworkmanjc Jun 16, 2025
02e8e71
consolidate JCRConfig Subject Headers
jworkmanjc Jun 16, 2025
070f7bf
remove config.ps1 and update refs
jworkmanjc Jun 16, 2025
cf1df0f
update module version tests
jworkmanjc Jun 16, 2025
53a96ea
update setup org
jworkmanjc Jun 16, 2025
61d55b4
set the contents of the config to the value from before
jworkmanjc Jun 16, 2025
7bdac78
update tests with hashtable values
jworkmanjc Jun 17, 2025
485e2e8
$param and confirm with a forced config file
jworkmanjc Jun 17, 2025
571f8ba
confirm tests
jworkmanjc Jun 17, 2025
bd6bb66
reset config
jworkmanjc Jun 17, 2025
26032fa
update module tests
jworkmanjc Jun 17, 2025
2cb244c
exclude config.json, update the config with update module
jworkmanjc Jun 18, 2025
1f2a70d
remove module if lingering
jworkmanjc Jun 18, 2025
6f1a2c6
remove extensions file changes in .gitignore
jworkmanjc Jun 20, 2025
dcf7329
extensions file generation + confirm JCR tests
jworkmanjc Jun 20, 2025
6c9f7d1
JCRConfig rename
jworkmanjc Jun 20, 2025
922c00f
docs
jworkmanjc Jun 20, 2025
3fa443f
update emailSan extensions
jworkmanjc Jun 20, 2025
3174d9a
openSSL validation
jworkmanjc Jun 23, 2025
4d65784
JCRConfig in readme.md
jworkmanjc Jun 23, 2025
2ce1b5c
openssl location
jworkmanjc Jun 23, 2025
8ce48f9
remove items from multiGroupRadius automation script
jworkmanjc Jun 23, 2025
4b61e75
update set-JCRConfig to hide true/false from validating radius directory
jworkmanjc Jun 23, 2025
8a17353
warn if openssl is null + 2.1.0 version
jworkmanjc Jun 23, 2025
4fd1565
Merge pull request #667 from TheJumpCloud/CUT-4639_UpdateModuleFuncti…
jworkmanjc Jun 23, 2025
5883d03
Merge branch 'master' into Radius_2.1.0
jworkmanjc Jul 3, 2025
792be15
tests run on branch 'master'
jworkmanjc Jul 3, 2025
2c06bdf
Merge branch 'Radius_2.1.0' of ssh://github.com/TheJumpCloud/support …
jworkmanjc Jul 3, 2025
fcc5c8e
release workflow Dependencies
jworkmanjc Jul 3, 2025
da885d2
radius module release workflow init commit
jworkmanjc Jul 3, 2025
96b389b
test radius release
jworkmanjc Jul 3, 2025
30293bc
test release workflow
jworkmanjc Jul 3, 2025
ac24ae4
test release workflow
jworkmanjc Jul 3, 2025
16941ce
test release workflow
jworkmanjc Jul 3, 2025
c464b9b
Update License
jworkmanjc Jul 3, 2025
36925aa
update output path + nuspec/nupkg location
jworkmanjc Jul 3, 2025
dd6daca
paths to test release workflow
jworkmanjc Jul 3, 2025
1ecdef9
Include Boilerplate Extensions in nuspec
jworkmanjc Jul 3, 2025
399f244
changelog updates
jworkmanjc Jul 3, 2025
b006c70
update module validation for radius
jworkmanjc Jul 3, 2025
73c476f
test build and pack
jworkmanjc Jul 3, 2025
26ce5d6
test for extensions
jworkmanjc Jul 3, 2025
9975fac
radius tag
jworkmanjc Jul 3, 2025
b133df0
escape paths
jworkmanjc Jul 3, 2025
eaad04f
artifact upload
jworkmanjc Jul 3, 2025
1e5e82a
upload path
jworkmanjc Jul 3, 2025
8da0b15
get artifact by path
jworkmanjc Jul 3, 2025
1c8e2bd
artifact download path
jworkmanjc Jul 3, 2025
16ffd12
set code markers
jworkmanjc Jul 7, 2025
f043b59
indent
jworkmanjc Jul 7, 2025
6bd28ad
readmes
jworkmanjc Jul 8, 2025
12afe18
release on PR Closed to "Master Branch"
jworkmanjc Jul 8, 2025
08ad2f7
test CI on PR to "Master Branch"
jworkmanjc Jul 8, 2025
1decc64
gate approval with manual step
jworkmanjc Jul 8, 2025
6932c8a
readme suggestions
jworkmanjc Jul 8, 2025
3b3fd3d
multi_group_radius cleanup
jworkmanjc Jul 8, 2025
b9b9ea5
docs
jworkmanjc Jul 8, 2025
118ee60
radius docs + module update
jworkmanjc Jul 8, 2025
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
156 changes: 156 additions & 0 deletions .github/workflows/radius-module-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: Radius Module CI

on:
pull_request:
# Sequence of patterns matched against refs/heads
branches:
- "master"
paths:
- "scripts/automation/Radius/**"
types: [opened, synchronize, reopened, labeled, unlabeled]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
Filter-Branch:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'Radius Module')
steps:
- run: echo "Building JumpCloud Radius Module Event 'JumpCloudModule_'"
Check-PR-Labels:
needs: ["Filter-Branch"]
runs-on: ubuntu-latest
outputs:
RELEASE_TYPE: ${{ steps.validate.outputs.RELEASE_TYPE }}
steps:
- name: Validate-PR-Version-Labels
id: validate
shell: pwsh
run: |
$PR_LABEL_LIST=$(curl -s "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels" | jq -r '.[].name')
if ("PowerShell Radius Module" -in $PR_LABEL_LIST) {
write-host "Starting Build for PowerShell Radius Module Release"
}
# validate type from label list:
$types = @('major', 'minor', 'patch', 'manual')
$typeCount = 0
foreach ($item in $PR_LABEL_LIST) {
if ($item -in $types) {
write-host "$item"
$typeCount += 1
$RELEASE_TYPE = $item
}
}

if ($typeCount -eq 1) {
echo "RELEASE_TYPE=$RELEASE_TYPE" >> $env:GITHUB_OUTPUT
} else {
throw "Multiple or invalid release types were found on PR"
exit 1
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Validate-Env-Variables:
needs: ["Filter-Branch", "Check-PR-Labels"]
runs-on: ubuntu-latest
steps:
- env:
RELEASE_TYPE: ${{ needs.Check-PR-Labels.outputs.RELEASE_TYPE }}
shell: pwsh
run: |
# validate release type variables
$env:RELEASE_TYPE | Should -BeIn @('major','minor','patch','manual')
Setup-Build-Dependencies:
needs: ["Filter-Branch", "Check-PR-Labels", "Validate-Env-Variables"]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Setup PowerShell Module Cache
id: cacher
uses: actions/cache@v4
with:
path: "~/.local/share/powershell/Modules/"
key: PS-Radius-Dependencies
- name: Install dependencies
if: steps.cacher.outputs.cache-hit != 'true'
shell: pwsh
env:
PESTER_APIKEY: ${{ secrets.PESTER_APIKEY }}
PESTER_ORGID: ${{ secrets.PESTER_ORGID }}
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted

If (!(Get-PackageProvider -Name:('NuGet') -ListAvailable -ErrorAction:('SilentlyContinue'))) {
Write-Host ('[status]Installing package provider NuGet');
Install-PackageProvider -Name:('NuGet') -Scope:('CurrentUser') -Force
}

$PSDependencies = @{
'PowerShellGet' = @{Repository = 'PSGallery'; RequiredVersion = '3.0.12-beta' }
'PSScriptAnalyzer' = @{Repository = 'PSGallery'; RequiredVersion = '1.19.1' }
'PlatyPS' = @{Repository = 'PSGallery'; RequiredVersion = '0.14.2' }
'JumpCloud' = @{Repository = 'PSGallery'; RequiredVersion = 'latest'}
'JumpCloud.SDK.V1' = @{Repository = 'PSGallery'; RequiredVersion = 'latest'}
'JumpCloud.SDK.V2' = @{Repository = 'PSGallery'; RequiredVersion = 'latest'}
'JumpCloud.SDK.DirectoryInsights' = @{Repository = 'PSGallery'; RequiredVersion = 'latest'}
}

foreach ($RequiredModule in $PSDependencies.Keys) {
If ([System.String]::IsNullOrEmpty((Get-InstalledModule | Where-Object { $_.Name -eq $RequiredModule }))) {
Write-Host("[status]Installing module: '$RequiredModule'; version: $($PSDependencies[$RequiredModule].RequiredVersion) from $($PSDependencies[$RequiredModule].Repository)")
if ($($PSDependencies[$RequiredModule].RequiredVersion) -eq "latest"){
Install-Module -Name $RequiredModule -Repository:($($PSDependencies[$RequiredModule].Repository)) -AllowPrerelease -Force
} else {
Install-Module -Name $RequiredModule -Repository:($($PSDependencies[$RequiredModule].Repository)) -RequiredVersion:($($PSDependencies[$RequiredModule].RequiredVersion)) -AllowPrerelease -Force
}
}
}

Validate-Module:
needs: ["Setup-Build-Dependencies", "Check-PR-Labels"]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
scripts
- uses: actions/cache@v4
with:
path: "~/.local/share/powershell/Modules/"
key: PS-Radius-Dependencies
- env:
RELEASE_TYPE: ${{ needs.Check-PR-Labels.outputs.RELEASE_TYPE }}
shell: pwsh
run: |
. "./scripts/automation/Radius/Tests/Invoke-Pester.ps1" -ModuleValidation
Test-Module:
needs: ["Setup-Build-Dependencies", "Check-PR-Labels", "Validate-Module"]
runs-on: ubuntu-latest
# environment: Test Radius CI
timeout-minutes: 75
strategy:
fail-fast: false
name: Run Pester Tests and Upload Results
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
scripts
- uses: actions/cache@v4
with:
path: "~/.local/share/powershell/Modules/"
key: PS-Radius-Dependencies
- name: Test PWSH Radius Module
shell: pwsh
env:
PESTER_APIKEY: ${{ secrets.PESTER_APIKEY }}
PESTER_ORGID: ${{ secrets.PESTER_ORGID }}
run: |
$items = get-childItem -path "./scripts/automation/Radius/"
foreach ($item in $items){
write-host "$($item.FullName)"
}
# Invoke Pester
. "./scripts/automation/Radius/Tests/Invoke-Pester.ps1" -JumpCloudApiKey "$env:PESTER_APIKEY" -ExcludeTagList "ModuleValidation"
203 changes: 203 additions & 0 deletions .github/workflows/radius-release-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
name: Release and Publish Radius Module
on:
pull_request:
types:
- closed
branches:
- "master"
paths:
- "scripts/automation/Radius/**"

jobs:
Check-If-Merged:
if: github.event.pull_request.merged == false
runs-on: ubuntu-latest
steps:
- name: Check if Merged
run: echo {GITHUB_HEAD_REF} merged into master

Filter-Branch:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'Radius Module')
steps:
- run: echo "Building Radius Module Event 'RadiusModule_'"

Check-PR-Labels:
needs: [Filter-Branch, Check-If-Merged]
runs-on: ubuntu-latest
steps:
- name: Validate-PR-Version-Labels
id: validate
shell: pwsh
run: |
$PR_LABEL_LIST=$(curl -s "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels" | jq -r '.[].name')
if ("Radius Module" -in $PR_LABEL_LIST) {
Write-Host "Starting Build for Radius Module Release"
} else {
Write-Host "Missing Radius Module Label, not continuing Release workflow"
exit 1
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Setup-Build-Dependencies:
needs: ["Filter-Branch", "Check-PR-Labels"]
runs-on: windows-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Setup Radius Module Cache
id: cacher
uses: actions/cache@v4
with:
path: 'C:\Users\runneradmin\Documents\PowerShell\Modules\'
key: PS-Dependencies
- name: Install dependencies
if: steps.cacher.outputs.cache-hit != 'true'
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
If (!(Get-PackageProvider -Name:('NuGet') -ListAvailable -ErrorAction:('SilentlyContinue'))) {
Write-Host ('[status]Installing package provider NuGet');
Install-PackageProvider -Name:('NuGet') -Scope:('CurrentUser') -Force
}
$PSDependencies = @{
'PowerShellGet' = @{Repository = 'PSGallery'; RequiredVersion = '3.0.12-beta' }
'PackageManagement' = @{Repository = 'PSGallery'; RequiredVersion = '1.4.8.1' }
'PSScriptAnalyzer' = @{Repository = 'PSGallery'; RequiredVersion = '1.19.1' }
'PlatyPS' = @{Repository = 'PSGallery'; RequiredVersion = '0.14.2' }
'AWS.Tools.Common' = @{Repository = 'PSGallery'; RequiredVersion = '4.1.122' }
'AWS.Tools.CodeArtifact' = @{Repository = 'PSGallery'; RequiredVersion = '4.1.122' }
'JumpCloud.SDK.V1' = @{Repository = 'PSGallery'; RequiredVersion = 'latest'}
'JumpCloud.SDK.V2' = @{Repository = 'PSGallery'; RequiredVersion = 'latest'}
'JumpCloud.SDK.DirectoryInsights' = @{Repository = 'PSGallery'; RequiredVersion = 'latest'}
}
foreach ($RequiredModule in $PSDependencies.Keys) {
If ([System.String]::IsNullOrEmpty((Get-InstalledModule | Where-Object { $_.Name -eq $RequiredModule }))) {
Write-Host("[status]Installing module: '$RequiredModule'; version: $($PSDependencies[$RequiredModule].RequiredVersion) from $($PSDependencies[$RequiredModule].Repository)")
if ($($PSDependencies[$RequiredModule].RequiredVersion) -eq "latest"){
Install-Module -Name $RequiredModule -Repository:($($PSDependencies[$RequiredModule].Repository)) -AllowPrerelease -Force
} else {
Install-Module -Name $RequiredModule -Repository:($($PSDependencies[$RequiredModule].Repository)) -RequiredVersion:($($PSDependencies[$RequiredModule].RequiredVersion)) -AllowPrerelease -Force -AllowClobber
}
}
}

Build-Nuspec-Nupkg:
needs: Setup-Build-Dependencies
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: 'C:\Users\runneradmin\Documents\PowerShell\Modules\'
key: PS-Dependencies
- name: Build Nuspec
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
. "${{ github.workspace }}/scripts/automation/Radius/deploy/BuildNuspecFromPsd1.ps1" -RequiredModulesRepo PSGallery
- name: Pack nuspec
shell: pwsh
run: |
nuget pack "${{ github.workspace }}/scripts/automation/Radius/JumpCloud.Radius.nuspec" -Properties NoWarn=NU5111,NU5110 -OutputDirectory "${{ github.workspace }}/scripts/automation/Radius/"
- name: Validate NuPkg File
shell: pwsh
run: |
$NupkgPathDirectory = (Get-ChildItem -Path:("${{ github.workspace }}/scripts/automation/Radius/JumpCloud.Radius.*.nupkg")).Directory
$nupkgPath = (Get-ChildItem -Path:("${{ github.workspace }}/scripts/automation/Radius/JumpCloud.Radius*.nupkg")).FullName
Write-Host "NuPkg Path: $nupkgPath"
mkdir $NupkgPathDirectory/nupkg_module
unzip $nupkgPath -d $NupkgPathDirectory/nupkg_module
$moduleRootFiles = Get-ChildItem -File -Path:("$NupkgPathDirectory/nupkg_module")
$moduleRootDirectories = Get-ChildItem -Directory -Path:("$NupkgPathDirectory/nupkg_module")
$moduleRootDirectory = "$NupkgPathDirectory/nupkg_module"
Write-Host "Module Files:\n$moduleRootFiles"
Write-Host "Module Directories:\n$moduleRootDirectories"
# Validate that the nuspec directory contains a Functions directory with a Public/ Private directory
"Functions" | should -bein $moduleRootDirectories.name
# the public and private directories should be inside the Functions directory
"Public" | should -bein (Get-ChildItem -Directory -Path:("$moduleRootDirectory/Functions")).name
"Private" | should -bein (Get-ChildItem -Directory -Path:("$moduleRootDirectory/Functions")).name
# Validate that the nuspec directory contains an Extensions directory
"Extensions" | should -bein $moduleRootDirectories.name

- name: Upload Nupkg
uses: ./.github/actions/upload-secure-artifact
with:
name: radius-module-nupkg
path: D:/a/support/support/scripts/automation/Radius/JumpCloud.Radius*.nupkg
retention-days: 1

Manual-Approval-Release:
needs: ["Check-PR-Labels", "Setup-Build-Dependencies"]
environment: PublishToPSGallery
runs-on: ubuntu-latest
steps:
- name: Manual Approval for Release
run: echo "Awaiting approval from required reviewers before continuing"

Draft-GH-Release:
needs: [Build-Nuspec-Nupkg, Manual-Approval-Release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Draft Release
run: |
VERSION=$(grep -Po "ModuleVersion\s*=\s*'\K[0-9]+\.[0-9]+\.[0-9]+" ${{ github.workspace }}/scripts/automation/Radius/JumpCloud.Radius.psd1)
TITLE="JumpCloud Radius Module v$VERSION"
CHANGELOG=$(cat ${{ github.workspace }}/scripts/automation/Radius/Changelog.md |awk "/^## $VERSION/{ f = 1; next } /## [0-9]+.[0-9]+.[0-9]+/{ f = 0 } f")
TAG="radius_v$VERSION"
BODY="$TITLE $CHANGELOG"

(gh release view $TAG && echo "Release exists for $TAG") || gh release create $TAG --title "$TITLE" --notes "$BODY" --draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Deploy-Nupkg:
needs: [Build-Nuspec-Nupkg, Manual-Approval-Release]
runs-on: windows-latest
steps:
- name: Download nupkg artifact
uses: actions/download-artifact@v4
with:
name: radius-module-nupkg
path: D:/a/support/support/scripts/automation/Radius/
- name: Publish
shell: pwsh
run: |
# add nuget source for PSGallery:
dotnet nuget add source "https://www.powershellgallery.com/api/v2/package" --name PSGallery
# get nupkg artifact:
$nupkgPath = (Get-ChildItem -Path:("D:/a/support/support/scripts/automation/Radius/JumpCloud.Radius*.nupkg")).FullName
# test
$nupkgPath | Should -Exist
Write-Host "Nupkg Artifact Restored: $nupkgPath"
# nuget push from here:
dotnet nuget push $nupkgPath --source PSGallery --api-key $env:NuGetApiKey
env:
NuGetApiKey: ${{ secrets.NUGETAPIKEY }}

Cleanup-Cache:
needs: Deploy-Nupkg
runs-on: ubuntu-latest
steps:
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache

echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )

## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
Loading