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
2 changes: 1 addition & 1 deletion .github/workflows/BuildMpk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: "Upload MPK artifact"
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
with:
name: ${{ env.ARTIFACT_NAME }}
name: ${{ env.ARTIFACT_NAME }}-${{ steps.bump_version.outputs.VERSION }}
path: ${{ env.ARTIFACT_PATH }}
if-no-files-found: error

Expand Down
18 changes: 15 additions & 3 deletions scripts/release/build-mpk.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { basename, join, dirname } from "path";
import { readdir, copyFile, rm, mkdir } from "fs/promises";
import { readdir, copyFile, rm, mkdir, rename } from "fs/promises";
import { appendFileSync } from "fs";
import {
execShellCommand,
Expand Down Expand Up @@ -101,6 +101,16 @@ async function main(): Promise<ArtifactResult> {
throw new Error(`${LOG_PREFIX} No implementation for MODULE="${inputs.module}"`);
}

async function appendVersionToMpkFilename(mpkPath: string): Promise<string> {
const versionedMpkPath = mpkPath.replace(/\.mpk$/, `-v${inputs.version}.mpk`);
if (versionedMpkPath === mpkPath) {
throw new Error(`${LOG_PREFIX} Expected an .mpk file path, got: ${mpkPath}`);
}
await rename(mpkPath, versionedMpkPath);
log(`Renamed MPK to include version: ${versionedMpkPath}`);
return versionedMpkPath;
}

async function createNativeMobileResourcesModule(): Promise<ArtifactResult> {
log("Creating the Native Mobile Resource module...");
const moduleFolder = join(repoRootPath, "packages/jsActions", inputs.module);
Expand Down Expand Up @@ -130,8 +140,9 @@ async function createNativeMobileResourcesModule(): Promise<ArtifactResult> {
log(`MPK created at: ${mpkOutput}`);
log("Exporting module with widgets into MPK...");
await exportModuleWithWidgets(moduleInfo.moduleNameInModeler, mpkOutput, nativeWidgetFolders, ossFiles);
const versionedMpkOutput = await appendVersionToMpkFilename(mpkOutput);
return {
artifactPath: mpkOutput,
artifactPath: versionedMpkOutput,
artifactName: moduleInfo.moduleNameInModeler
};
}
Expand Down Expand Up @@ -162,8 +173,9 @@ async function createNanoflowCommonsModule(): Promise<ArtifactResult> {
log(`MPK created at: ${mpkOutput}`);
log("Copying OSS files into MPK...");
await copyFilesToMpk(ossFiles, mpkOutput, moduleInfo.moduleNameInModeler);
const versionedMpkOutput = await appendVersionToMpkFilename(mpkOutput);
return {
artifactPath: mpkOutput,
artifactPath: versionedMpkOutput,
artifactName: moduleInfo.moduleNameInModeler
};
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/module-automation/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function getOssFiles(
}

const readmePattern = "*__*__READMEOSS_*.html";
const readme = globSync(readmePattern, { cwd: folderPath, absolute: true, ignore: "**/.*/**" })[0];
const readme = globSync(readmePattern, { cwd: folderPath, absolute: true })[0];
if (validationCriteria) {
validateOssReadme(readme, validationCriteria);
}
Expand Down
Loading