Skip to content

Commit

Permalink
Revert "(test): run workflows"
Browse files Browse the repository at this point in the history
This reverts commit e66085d.
  • Loading branch information
rcasperson-jc committed Sep 13, 2024
1 parent 65fda44 commit 977e8b8
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 84 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/powershell-module-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@ name: PowerShell Module CI

on:
pull_request:

# Sequence of patterns matched against refs/heads
branches:
- "master"
paths:
- "PowerShell/Deploy/**"
- "PowerShell/JumpCloud Module/**"
- "PowerShell/ModuleChangelog.md"
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, 'PowerShell Module')
if: contains(github.event.pull_request.labels.*.name, 'PowerShell Module')
steps:
- run: echo "Building JumpCloud Module Event 'JumpCloudModule_'"
Check-PR-Labels:
Expand Down Expand Up @@ -37,8 +44,12 @@ jobs:
}
}
echo "RELEASE_TYPE=$RELEASE_TYPE" >> $env:GITHUB_OUTPUT
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:
Expand Down
70 changes: 39 additions & 31 deletions .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
name: Release and Publish PSModule
on:
pull_request:
types:
- closed
paths:
- "PowerShell/Deploy/**"
- "PowerShell/JumpCloud Module/**"
- "PowerShell/ModuleChangelog.md"
branches:
- master

jobs:
Check-If-Merged:
# if: github.event.pull_request.merged == true
if: github.event.pull_request.merged == true
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, 'PowerShell Module')
if: contains(github.event.pull_request.labels.*.name, 'PowerShell Module')
steps:
- run: echo "Building JumpCloud Module Event 'JumpCloudModule_'"

Expand Down Expand Up @@ -124,22 +132,22 @@ jobs:
- name: Manual Approval for Release
run: echo "Awaiting approval from required reviewers before continuing"

# Draft-GH-Release:
# needs: [Manual-Approval-Release]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Build Draft Release
# run: |
# VERSION=$(grep -Po '(\d+\.\d+\.\d+)' ${{ github.workspace }}/PowerShell/JumpCloud\ Module/JumpCloud.psd1)
# TITLE="JumpCloud PowerShell Module v$VERSION"
# CHANGELOG=$(cat ${{ github.workspace }}/PowerShell/ModuleChangelog.md |awk "/^## $VERSION/{ f = 1; next } /## [0-9]+.[0-9]+.[0-9]+/{ f = 0 } f")
# TAG="v$VERSION"
# BODY="$TITLE $CHANGELOG"
Draft-GH-Release:
needs: [Manual-Approval-Release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Draft Release
run: |
VERSION=$(grep -Po '(\d+\.\d+\.\d+)' ${{ github.workspace }}/PowerShell/JumpCloud\ Module/JumpCloud.psd1)
TITLE="JumpCloud PowerShell Module v$VERSION"
CHANGELOG=$(cat ${{ github.workspace }}/PowerShell/ModuleChangelog.md |awk "/^## $VERSION/{ f = 1; next } /## [0-9]+.[0-9]+.[0-9]+/{ f = 0 } f")
TAG="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 }}
(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: [Manual-Approval-Release, Build-Nuspec-Nupkg]
Expand All @@ -149,20 +157,20 @@ jobs:
uses: actions/download-artifact@v4
with:
name: jumpcloud-module-nupkg
# - 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:("./*.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 }}
- 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:("./*.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
Expand Down
2 changes: 1 addition & 1 deletion PowerShell/JumpCloud Module/Docs/JumpCloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Module Name: JumpCloud
Module Guid: 31c023d1-a901-48c4-90a3-082f91b31646
Download Help Link: https://github.com/TheJumpCloud/support/wiki
Help Version: 2.13.2
Help Version: 2.13.1
Locale: en-Us
---

Expand Down
64 changes: 32 additions & 32 deletions PowerShell/JumpCloud Module/JumpCloud.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'JumpCloud.psm1'

# Version number of this module.
ModuleVersion = '2.13.2'
ModuleVersion = '2.13.1'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -51,8 +51,8 @@ PowerShellVersion = '4.0'
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @('JumpCloud.SDK.DirectoryInsights',
'JumpCloud.SDK.V1',
RequiredModules = @('JumpCloud.SDK.DirectoryInsights',
'JumpCloud.SDK.V1',
'JumpCloud.SDK.V2')

# Assemblies that must be loaded prior to importing this module
Expand All @@ -71,35 +71,35 @@ RequiredModules = @('JumpCloud.SDK.DirectoryInsights',
# NestedModules = @()

# 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-JCAssociation', 'Add-JCCommandTarget', 'Add-JCGsuiteMember',
'Add-JCOffice365Member', 'Add-JCRadiusReplyAttribute',
'Add-JCSystemGroupMember', 'Add-JCSystemUser',
'Add-JCUserGroupMember', 'Backup-JCOrganization', 'Connect-JCOnline',
'Copy-JCAssociation', 'Get-JCAdmin', 'Get-JCAssociation',
'Get-JCBackup', 'Get-JCCloudDirectory', 'Get-JCCommand',
'Get-JCCommandResult', 'Get-JCCommandTarget', 'Get-JCEvent',
'Get-JCEventCount', 'Get-JCGroup', 'Get-JCOrganization', 'Get-JCPolicy',
'Get-JCPolicyResult', 'Get-JCPolicyTargetGroup',
'Get-JCPolicyTargetSystem', 'Get-JCRadiusReplyAttribute',
'Get-JCRadiusServer', 'Get-JCScheduledUserstate', 'Get-JCSystem',
'Get-JCSystemApp', 'Get-JCSystemGroupMember', 'Get-JCSystemInsights',
'Get-JCSystemUser', 'Get-JCUser', 'Get-JCUserGroupMember',
'Import-JCCommand', 'Import-JCMSPFromCSV', 'Import-JCUsersFromCSV',
'Invoke-JCCommand', 'Invoke-JCDeployment', 'New-JCCommand',
'New-JCDeploymentTemplate', 'New-JCImportTemplate',
'New-JCMSPImportTemplate', 'New-JCPolicy', 'New-JCRadiusServer',
'New-JCSystemGroup', 'New-JCUser', 'New-JCUserGroup',
'Remove-JCAssociation', 'Remove-JCCommand', 'Remove-JCCommandResult',
'Remove-JCCommandTarget', 'Remove-JCGsuiteMember',
'Remove-JCOffice365Member', 'Remove-JCPolicy',
'Remove-JCRadiusReplyAttribute', 'Remove-JCRadiusServer',
'Remove-JCSystem', 'Remove-JCSystemGroup',
'Remove-JCSystemGroupMember', 'Remove-JCSystemUser', 'Remove-JCUser',
'Remove-JCUserGroup', 'Remove-JCUserGroupMember',
'Send-JCPasswordReset', 'Set-JCCloudDirectory', 'Set-JCCommand',
'Set-JCOrganization', 'Set-JCPolicy', 'Set-JCRadiusReplyAttribute',
'Set-JCRadiusServer', 'Set-JCSettingsFile', 'Set-JCSystem',
'Set-JCSystemUser', 'Set-JCUser', 'Set-JCUserGroupLDAP',
FunctionsToExport = 'Add-JCAssociation', 'Add-JCCommandTarget', 'Add-JCGsuiteMember',
'Add-JCOffice365Member', 'Add-JCRadiusReplyAttribute',
'Add-JCSystemGroupMember', 'Add-JCSystemUser',
'Add-JCUserGroupMember', 'Backup-JCOrganization', 'Connect-JCOnline',
'Copy-JCAssociation', 'Get-JCAdmin', 'Get-JCAssociation',
'Get-JCBackup', 'Get-JCCloudDirectory', 'Get-JCCommand',
'Get-JCCommandResult', 'Get-JCCommandTarget', 'Get-JCEvent',
'Get-JCEventCount', 'Get-JCGroup', 'Get-JCOrganization', 'Get-JCPolicy',
'Get-JCPolicyResult', 'Get-JCPolicyTargetGroup',
'Get-JCPolicyTargetSystem', 'Get-JCRadiusReplyAttribute',
'Get-JCRadiusServer', 'Get-JCScheduledUserstate', 'Get-JCSystem',
'Get-JCSystemApp', 'Get-JCSystemGroupMember', 'Get-JCSystemInsights',
'Get-JCSystemUser', 'Get-JCUser', 'Get-JCUserGroupMember',
'Import-JCCommand', 'Import-JCMSPFromCSV', 'Import-JCUsersFromCSV',
'Invoke-JCCommand', 'Invoke-JCDeployment', 'New-JCCommand',
'New-JCDeploymentTemplate', 'New-JCImportTemplate',
'New-JCMSPImportTemplate', 'New-JCPolicy', 'New-JCRadiusServer',
'New-JCSystemGroup', 'New-JCUser', 'New-JCUserGroup',
'Remove-JCAssociation', 'Remove-JCCommand', 'Remove-JCCommandResult',
'Remove-JCCommandTarget', 'Remove-JCGsuiteMember',
'Remove-JCOffice365Member', 'Remove-JCPolicy',
'Remove-JCRadiusReplyAttribute', 'Remove-JCRadiusServer',
'Remove-JCSystem', 'Remove-JCSystemGroup',
'Remove-JCSystemGroupMember', 'Remove-JCSystemUser', 'Remove-JCUser',
'Remove-JCUserGroup', 'Remove-JCUserGroupMember',
'Send-JCPasswordReset', 'Set-JCCloudDirectory', 'Set-JCCommand',
'Set-JCOrganization', 'Set-JCPolicy', 'Set-JCRadiusReplyAttribute',
'Set-JCRadiusServer', 'Set-JCSettingsFile', 'Set-JCSystem',
'Set-JCSystemUser', 'Set-JCUser', 'Set-JCUserGroupLDAP',
'Update-JCModule', 'Update-JCMSPFromCSV', 'Update-JCUsersFromCSV'

# Cmdlets 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 cmdlets to export.
Expand Down
16 changes: 0 additions & 16 deletions PowerShell/ModuleChangelog.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
## 2.13.2


Release Date: August 20, 2024

#### RELEASE NOTES

```
TEST - DO NOT MERGE
```

#### FEATURES:

* Get-JCAdmin - Returns administrators in your organization
* MSP/MTP tenants can query multiple organizations or individual organizations

## 2.13.1

Release Date: August 20, 2024
Expand Down

0 comments on commit 977e8b8

Please sign in to comment.