Skip to content
Merged
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
10 changes: 0 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,6 @@ jobs:
yq -i ".packageVersion = \"$VERSION\"" sdk-resources/v2025-nerm-config.yaml
sed -i "s/const PACKAGE_VERSION = \"[^\"]*\"/const PACKAGE_VERSION = \"$VERSION\"/" sdk-resources/build-versioned-sdk.js

- name: Update Build.ps1 ModuleVersion
shell: bash
run: |
LATEST="${{ steps.version.outputs.latest }}"
NEW="${{ steps.version.outputs.new }}"
LATEST_ESCAPED="${LATEST//./\\.}"
cd PSSailpoint
sed -e "s/ModuleVersion = '${LATEST_ESCAPED}'/ModuleVersion = '${NEW}'/g" Build.ps1 > Build.ps1.tmp && mv Build.ps1.tmp Build.ps1
sed -e "s/RequiredVersion = '${LATEST_ESCAPED}'/RequiredVersion = '${NEW}'/g" Build.ps1 > Build.ps1.tmp && mv Build.ps1.tmp Build.ps1

- name: Build SDK
uses: ./.github/actions/build-sdk

Expand Down
2 changes: 1 addition & 1 deletion PSSailpoint/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $Manifest = @{
CompanyName = 'SailPoint Technologies'
Description = 'PSSailpoint - the PowerShell module for IdentityNow'

ModuleVersion = '1.0.0'
ModuleVersion = '2.0.1'

RootModule = 'PSSailpoint.psm1'
Guid = '7A197170-97E8-4DCD-A171-271D4AEC2F36' # Must stay static
Expand Down
2 changes: 1 addition & 1 deletion PSSailpoint/PSSailpoint.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'PSSailpoint.psm1'

# Version number of this module.
ModuleVersion = '1.0.0'
ModuleVersion = '2.0.1'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
44 changes: 44 additions & 0 deletions sdk-resources/build-versioned-sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,46 @@ function generateBarrelModule() {
console.log(` Wrote PSSailpoint/PSSailpoint.psm1 with ${partitionDirs.length} partition imports + Get-SailPointCommand`);
}

// ---------------------------------------------------------------------------
// Sync the main PSSailpoint module version to PACKAGE_VERSION.
//
// Unlike the partition modules (whose manifests are fully generated by
// openapi-generator from packageVersion), the main wrapper's Build.ps1 and
// PSSailpoint.psd1 are hand-maintained. To keep PACKAGE_VERSION as the single
// source of truth, we patch only their ModuleVersion line in place and leave
// the rest of each file untouched.
// ---------------------------------------------------------------------------

function syncMainModuleVersion() {
const psSailpointDir = path.join(SDK_ROOT, "PSSailpoint");

// (label, file path, regex matching the ModuleVersion assignment).
// Build.ps1 pads with spaces ("ModuleVersion = '...'"); the psd1 does not.
const targets = [
["PSSailpoint/Build.ps1", path.join(psSailpointDir, "Build.ps1"), /(ModuleVersion\s*=\s*)'[^']*'/],
["PSSailpoint/PSSailpoint.psd1", path.join(psSailpointDir, "PSSailpoint.psd1"), /(ModuleVersion\s*=\s*)'[^']*'/],
];

for (const [label, filePath, re] of targets) {
if (!fs.existsSync(filePath)) {
console.log(` ${label} not found, skipping version sync.`);
continue;
}
const original = fs.readFileSync(filePath, "utf8");
if (!re.test(original)) {
console.log(` WARNING: no ModuleVersion line found in ${label}, skipping.`);
continue;
}
const updated = original.replace(re, `$1'${PACKAGE_VERSION}'`);
if (updated !== original) {
fs.writeFileSync(filePath, updated, "utf8");
console.log(` Set ${label} ModuleVersion → ${PACKAGE_VERSION}`);
} else {
console.log(` ${label} ModuleVersion already ${PACKAGE_VERSION}`);
}
}
}

// ---------------------------------------------------------------------------
// Main
// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -618,6 +658,10 @@ async function main() {
console.log("\n[BARREL] Regenerating PSSailpoint/PSSailpoint.psm1 ...");
generateBarrelModule();

// Keep the hand-maintained main module manifest in sync with PACKAGE_VERSION.
console.log("\n[VERSION] Syncing main PSSailpoint module version ...");
syncMainModuleVersion();

// Write error reports
if (results.failed.length > 0) {
const summaryPath = writeSummaryReport(results, apisDir);
Expand Down
Loading