Skip to content

Commit

Permalink
Merge pull request #1 from tyler-mairose-sp/feature/updateVersion
Browse files Browse the repository at this point in the history
Update action
  • Loading branch information
tyler-mairose-sp authored Sep 12, 2024
2 parents bf88c84 + 3a3c8fd commit 40c3cfa
Show file tree
Hide file tree
Showing 26 changed files with 73 additions and 5,484 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Build V2024 SDK
id: buildV2024
run: |
rm -rf ./PSSailpoint/v2024
rm -rf ./Tm/v2024
java -jar openapi-generator-cli.jar generate -i api-specs/idn/sailpoint-api.v2024.yaml -g powershell -o Tm/v2024 --global-property skipFormModel=false --config sdk-resources/v2024-config.yaml
node sdk-resources/postscript.js ./Tm/v2024
Expand Down Expand Up @@ -69,7 +69,9 @@ jobs:
Import-Module -Name '.\Tm\beta\src\Tm.Beta' -Verbose
Import-Module -Name '.\Tm\v3\src\Tm.V3' -Verbose
Import-Module -Name '.\Tm\v2024\src\Tm.V2024' -Verbose
Import-Module -Name '.\Tm' -Verbose
. .\Tm\Configuration.ps1
. .\Tm\Pagination.ps1
Install-Module -Name Pester -Force
Invoke-Pester -Output Detailed ./Tm/tests/
37 changes: 23 additions & 14 deletions .github/workflows/bump_version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,50 +72,59 @@ jobs:
if: steps.updateVersion.outcome == 'success'
run: |
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
cd PSSailpoint
cd Tm
sed -e "s/ModuleVersion = '${LATEST_TAG:1}'/ModuleVersion = '${{ github.event.inputs.version }}'/g" Build.ps1 > Build.ps1.tmp && mv Build.ps1.tmp Build.ps1
- name: Build V2024 SDK
id: buildV2024
if: steps.updateModuleVersion.outcome == 'success'
run: |
rm -rf ./PSSailpoint/v2024
java -jar openapi-generator-cli.jar generate -i api-specs/idn/sailpoint-api.v2024.yaml -g powershell -o PSSailpoint/v2024 --global-property skipFormModel=false --config sdk-resources/v2024-config.yaml
node sdk-resources/postscript.js ./PSSailpoint/v2024
rm -rf ./Tm/v2024
java -jar openapi-generator-cli.jar generate -i api-specs/idn/sailpoint-api.v2024.yaml -g powershell -o Tm/v2024 --global-property skipFormModel=false --config sdk-resources/v2024-config.yaml
node sdk-resources/postscript.js ./Tm/v2024
- name: Build V3 SDK
id: buildV3
if: steps.buildV2024.outcome == 'success'
run: |
rm -rf ./PSSailpoint/v3
java -jar openapi-generator-cli.jar generate -i api-specs/idn/sailpoint-api.v3.yaml -g powershell -o PSSailpoint/v3 --global-property skipFormModel=false --config sdk-resources/v3-config.yaml
node sdk-resources/postscript.js ./PSSailpoint/v3
rm -rf ./Tm/v3
java -jar openapi-generator-cli.jar generate -i api-specs/idn/sailpoint-api.v3.yaml -g powershell -o Tm/v3 --global-property skipFormModel=false --config sdk-resources/v3-config.yaml
node sdk-resources/postscript.js ./Tm/v3
- name: Build Beta SDK
id: buildBeta
if: steps.buildV3.outcome == 'success'
run: |
rm -rf ./PSSailpoint/beta
java -jar openapi-generator-cli.jar generate -i api-specs/idn/sailpoint-api.beta.yaml -g powershell -o PSSailpoint/beta --global-property skipFormModel=false --config sdk-resources/beta-config.yaml
node sdk-resources/postscript.js ./PSSailpoint/beta
rm -rf ./Tm/beta
java -jar openapi-generator-cli.jar generate -i api-specs/idn/sailpoint-api.beta.yaml -g powershell -o Tm/beta --global-property skipFormModel=false --config sdk-resources/beta-config.yaml
node sdk-resources/postscript.js ./Tm/beta
- name: After SDK Build
id: buildSDK
if: steps.buildBeta.outcome == 'success'
shell: pwsh
run: |
$DebugPreference="Continue"
./PSSailpoint/Build.ps1
Import-Module -Name '.\PSSailpoint' -Verbose
./Tm/Build.ps1
./Tm/v3/Build.ps1
./Tm/v2024/Build.ps1
./Tm/beta/Build.ps1
Import-Module -Name '.\Tm\beta\src\Tm.Beta' -Verbose
Import-Module -Name '.\Tm\v3\src\Tm.V3' -Verbose
Import-Module -Name '.\Tm\v2024\src\Tm.V2024' -Verbose
. .\Tm\Configuration.ps1
. .\Tm\Pagination.ps1
- name: Commit changes and create new version tag
if: steps.buildSDK.outcome == 'success'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Bump version to v${{ github.event.inputs.version }}
tagging_message: v${{ github.event.inputs.version }}
commit_user_name: developer-relations-sp
commit_user_email: devrel-service@sailpoint.com
commit_user_name: tyler-mairose-sp
commit_user_email: tyler.mairose@sailpoint.com

- name: Create Draft Release
id: createRelease
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: "Publish Powershell Module"

on:
release:
types: [published]
workflow_dispatch:
workflow_call:

jobs:
publish_powershell_sdk:
Expand Down
2 changes: 1 addition & 1 deletion Tm/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ $Manifest = @{
ModuleVersion = '1.4.3'

RootModule = 'PSSailpoint.psm1'
Guid = '7A197170-97E8-4DCD-A171-271D4AEC2F36' # Has to be static, otherwise each new build will be considered different module
Guid = '7A197170-97E8-4DCD-A171-271D4AEC2F37' # Has to be static, otherwise each new build will be considered different module

PowerShellVersion = '6.2'

Expand Down
8 changes: 8 additions & 0 deletions Tm/Configuration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ System.Collections.Hashtable
#>
function Get-DefaultConfiguration {

if($null -eq $Script:Configuration) {
$Script:Configuration = [System.Collections.Hashtable]::new()
}

$Script:Configuration = Get-Config
$Configuration = $Script:Configuration

Expand Down Expand Up @@ -135,6 +139,10 @@ function Set-DefaultConfiguration {

Process {

if ($null -eq $Script:Configuration) {
$Script:Configuration = [System.Collections.Hashtable]::new()
}

If ($BaseUrl) {
# validate URL
$URL = $BaseUrl -as [System.URI]
Expand Down
16 changes: 8 additions & 8 deletions Tm/Tm.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@

@{

# Script module or binary module file associated with this manifest.
RootModule = 'PSSailpoint.psm1'
# Script module or binary module file associated with this manifest.
RootModule = 'Tm.psm1'

# Version number of this module.
ModuleVersion = '1.4.3'
ModuleVersion = '1.4.5'

# Supported PSEditions
# CompatiblePSEditions = @()

# ID used to uniquely identify this module
GUID = '7a197170-97e8-4dcd-a171-271d4aec2f36'
GUID = '7a197170-97e8-4dcd-a171-271d4aec2f37'

# Author of this module
Author = 'Sailpoint Developer Relations'
Expand Down Expand Up @@ -69,15 +69,15 @@ PowerShellVersion = '6.2'
# 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 = 'Get-FunctionsToExport', 'Get-DefaultConfiguration',
FunctionsToExport = 'Get-DefaultConfiguration',
'Set-DefaultConfiguration', 'Get-IDNAccessToken', 'Get-EnvConfig',
'Get-LocalConfig', 'Get-Config', 'Invoke-Paginate',
'Invoke-PaginateSearch'

RequiredModules = @(
@{ModuleName = 'Tm.beta'; ModuleVersion = '1.4.3'; },
@{ModuleName = 'Tm.v3'; RequiredVersion = '1.4.3'; },
@{ModuleName = 'Tm.v2024'; RequiredVersion = '1.4.3'; }
@{ModuleName = 'Tm.Beta'; ModuleVersion = '1.4.3'; },
@{ModuleName = 'Tm.V3'; RequiredVersion = '1.4.3'; },
@{ModuleName = 'Tm.V2024'; RequiredVersion = '1.4.3'; }
)

# 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
39 changes: 7 additions & 32 deletions Tm/Tm.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
#region Import functions

# define the following classes in PowerShell
try {
Add-Type -AssemblyName System.Web -ErrorAction Ignore | Out-Null
Add-Type -AssemblyName System.Net -ErrorAction Ignore | Out-Null
}
catch {
Write-Verbose $_
}
# try {
# Add-Type -AssemblyName System.Web -ErrorAction Ignore | Out-Null
# Add-Type -AssemblyName System.Net -ErrorAction Ignore | Out-Null
# }
# catch {
# Write-Verbose $_
# }

# set $ErrorActionPreference to 'Stop' globally
$ErrorActionPreference = 'Stop'
Expand All @@ -24,31 +24,6 @@ $Script:Configuration = [System.Collections.HashTable]@{}

$Script:CmdletBindingParameters = @('Verbose', 'Debug', 'ErrorAction', 'WarningAction', 'InformationAction', 'ErrorVariable', 'WarningVariable', 'InformationVariable', 'OutVariable', 'OutBuffer', 'PipelineVariable')


# $V3API = @( Get-ChildItem -Path "$PSScriptRoot\v3\src\PSSailpoint\Api\*.ps1" )
# $V3Client = @( Get-ChildItem -Path "$PSScriptRoot\v3\src\PSSailpoint\Client\*.ps1" )
# $V3Model = @( Get-ChildItem -Path "$PSScriptRoot\v3\src\PSSailpoint\Model\*.ps1" )
# $V3Private = @( Get-ChildItem -Path "$PSScriptRoot\v3\src\PSSailpoint\Private\*.ps1" )

# $BetaAPI = @( Get-ChildItem -Path "$PSScriptRoot\beta\src\PSSailpointBeta\Api\*.ps1")
# $BetaClient = @( Get-ChildItem -Path "$PSScriptRoot\beta\src\PSSailpointBeta\Client\*.ps1" )
# $BetaModel = @( Get-ChildItem -Path "$PSScriptRoot\beta\src\PSSailpointBeta\Model\*.ps1" )
# $BetaPrivate = @( Get-ChildItem -Path "$PSScriptRoot\beta\src\PSSailpointBeta\Private\*.ps1" )

# $V2024API = @( Get-ChildItem -Path "$PSScriptRoot\v2024\src\PSSailpointV2024\Api\*.ps1")
# $V2024Client = @( Get-ChildItem -Path "$PSScriptRoot\v2024\src\PSSailpointV2024\Client\*.ps1" )
# $V2024Model = @( Get-ChildItem -Path "$PSScriptRoot\v2024\src\PSSailpointV2024\Model\*.ps1" )
# $V2024Private = @( Get-ChildItem -Path "$PSScriptRoot\v2024\src\PSSailpointV2024\Private\*.ps1" )

# Foreach ($import in @($V3API + $V3Client + $V3Model + $V3Private + $BetaAPI + $BetaClient + $BetaModel + $BetaPrivate + $V2024API + $V2024Client + $V2024Model + $V2024Private)) {
# Try {
# . $import.fullname
# }
# Catch {
# Write-Error -Message "Failed to import function $($import.fullname): $_"
# }
# }

. $PSScriptRoot\Configuration.ps1
. $PSScriptRoot\Pagination.ps1

Expand Down
2 changes: 1 addition & 1 deletion Tm/beta/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ $Manifest = @{
CompanyName = 'SailPoint Technologies'
Description = 'Tm.Beta - the PowerShell module for Identity Security Cloud Beta API'

ModuleVersion = '1.4.3'
ModuleVersion = '1.4.5'

RootModule = 'Tm.Beta.psm1'
Guid = '61785CF2-2EB2-4FB6-9F7C-C5BD5B1733EB' # Has to be static, otherwise each new build will be considered different module
Expand Down
4 changes: 2 additions & 2 deletions Tm/beta/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Use these APIs to interact with the Identity Security Cloud platform to achieve
This PowerShell module is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 3.1.0-beta
- SDK version: 1.4.3
- SDK version: 1.4.5
- Build package: org.openapitools.codegen.languages.PowerShellClientCodegen
For more information, please visit [https://developer.sailpoint.com/discuss/api-help](https://developer.sailpoint.com/discuss/api-help)

Expand All @@ -30,7 +30,7 @@ To avoid function name collision, one can use `-Prefix`, e.g. `Import-Module -Na

To uninstall the module, simply run:
```powershell
Remove-Module -FullyQualifiedName @{ModuleName = "Tm.Beta"; ModuleVersion = "1.4.3"}
Remove-Module -FullyQualifiedName @{ModuleName = "Tm.Beta"; ModuleVersion = "1.4.5"}
```

<a id="tests"></a>
Expand Down
4 changes: 2 additions & 2 deletions Tm/beta/src/Tm.Beta/Private/BetaApiClient.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ function Invoke-BetaApiClient {
}

# Add Custom Header
$HeaderParameters['X-SailPoint-SDK'] = "Powershell-1.4.3"
$HeaderParameters['User-Agent'] = "OpenAPI-Generator/1.4.3/ps"
$HeaderParameters['X-SailPoint-SDK'] = "Powershell-1.4.5"
$HeaderParameters['User-Agent'] = "OpenAPI-Generator/1.4.5/ps"


$HasFormData = $False
Expand Down
Loading

0 comments on commit 40c3cfa

Please sign in to comment.