Skip to content

Commit fce3de8

Browse files
fix: ignore pattern while finding oss readme file (#451)
2 parents 049da12 + df15fe5 commit fce3de8

3 files changed

Lines changed: 17 additions & 5 deletions

File tree

.github/workflows/BuildMpk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- name: "Upload MPK artifact"
5555
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
5656
with:
57-
name: ${{ env.ARTIFACT_NAME }}
57+
name: ${{ env.ARTIFACT_NAME }}-${{ steps.bump_version.outputs.VERSION }}
5858
path: ${{ env.ARTIFACT_PATH }}
5959
if-no-files-found: error
6060

scripts/release/build-mpk.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { basename, join, dirname } from "path";
2-
import { readdir, copyFile, rm, mkdir } from "fs/promises";
2+
import { readdir, copyFile, rm, mkdir, rename } from "fs/promises";
33
import { appendFileSync } from "fs";
44
import {
55
execShellCommand,
@@ -101,6 +101,16 @@ async function main(): Promise<ArtifactResult> {
101101
throw new Error(`${LOG_PREFIX} No implementation for MODULE="${inputs.module}"`);
102102
}
103103

104+
async function appendVersionToMpkFilename(mpkPath: string): Promise<string> {
105+
const versionedMpkPath = mpkPath.replace(/\.mpk$/, `-v${inputs.version}.mpk`);
106+
if (versionedMpkPath === mpkPath) {
107+
throw new Error(`${LOG_PREFIX} Expected an .mpk file path, got: ${mpkPath}`);
108+
}
109+
await rename(mpkPath, versionedMpkPath);
110+
log(`Renamed MPK to include version: ${versionedMpkPath}`);
111+
return versionedMpkPath;
112+
}
113+
104114
async function createNativeMobileResourcesModule(): Promise<ArtifactResult> {
105115
log("Creating the Native Mobile Resource module...");
106116
const moduleFolder = join(repoRootPath, "packages/jsActions", inputs.module);
@@ -130,8 +140,9 @@ async function createNativeMobileResourcesModule(): Promise<ArtifactResult> {
130140
log(`MPK created at: ${mpkOutput}`);
131141
log("Exporting module with widgets into MPK...");
132142
await exportModuleWithWidgets(moduleInfo.moduleNameInModeler, mpkOutput, nativeWidgetFolders, ossFiles);
143+
const versionedMpkOutput = await appendVersionToMpkFilename(mpkOutput);
133144
return {
134-
artifactPath: mpkOutput,
145+
artifactPath: versionedMpkOutput,
135146
artifactName: moduleInfo.moduleNameInModeler
136147
};
137148
}
@@ -162,8 +173,9 @@ async function createNanoflowCommonsModule(): Promise<ArtifactResult> {
162173
log(`MPK created at: ${mpkOutput}`);
163174
log("Copying OSS files into MPK...");
164175
await copyFilesToMpk(ossFiles, mpkOutput, moduleInfo.moduleNameInModeler);
176+
const versionedMpkOutput = await appendVersionToMpkFilename(mpkOutput);
165177
return {
166-
artifactPath: mpkOutput,
178+
artifactPath: versionedMpkOutput,
167179
artifactName: moduleInfo.moduleNameInModeler
168180
};
169181
}

scripts/release/module-automation/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export async function getOssFiles(
2424
}
2525

2626
const readmePattern = "*__*__READMEOSS_*.html";
27-
const readme = globSync(readmePattern, { cwd: folderPath, absolute: true, ignore: "**/.*/**" })[0];
27+
const readme = globSync(readmePattern, { cwd: folderPath, absolute: true })[0];
2828
if (validationCriteria) {
2929
validateOssReadme(readme, validationCriteria);
3030
}

0 commit comments

Comments
 (0)