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
1 change: 1 addition & 0 deletions .github/workflows/MarketplaceRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
CPAPI_USERNAME: ${{ secrets.CPAPI_USERNAME }}
CPAPI_PASS_PROD: ${{ secrets.CPAPI_PASS_PROD }}
TAG: ${{ steps.variables.outputs.tag }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Send slack msg on failure"
if: ${{ failure() }}
uses: ./.github/actions/slack-notification
Expand Down
2 changes: 2 additions & 0 deletions packages/jsActions/mobile-resources-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [11.3.6] Native Mobile Resources - 2026-3-5

- We fixed native file system module reference.

## [11.3.5] Native Mobile Resources - 2026-2-4
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/jsActions/mobile-resources-native/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mobile-resources-native",
"moduleName": "Native Mobile Resources",
"version": "11.3.5",
"version": "11.3.6",
"license": "Apache-2.0",
"copyright": "© Mendix Technology BV 2022. All rights reserved.",
"repository": {
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
48 changes: 33 additions & 15 deletions scripts/release/marketplaceRelease.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,40 @@ async function uploadModuleToAppStore(pkgName, marketplaceId, version, minimumMX

async function getGithubAssetUrl() {
console.log("Retrieving informations from Github Tag");
const request = await fetch("GET", "https://api.github.com/repos/mendix/native-widgets/releases?per_page=10");
const data = (await request) ?? [];
const releaseId = data.find(info => info.tag_name === process.env.TAG)?.id;
if (!releaseId) {
throw new Error(`Could not find release with tag ${process.env.TAG} on GitHub`);
}
const assetsRequest = await fetch(
"GET",
`https://api.github.com/repos/mendix/native-widgets/releases/${releaseId}/assets`
);
const assetsData = (await assetsRequest) ?? [];
const downloadUrl = assetsData.find(asset => asset.name.endsWith(".mpk"))?.browser_download_url;
if (!downloadUrl) {
throw new Error(`Could not retrieve MPK url from GitHub release with tag ${process.env.TAG}`);
const tag = process.env.TAG;
const githubHeaders = process.env.GITHUB_TOKEN ? { Authorization: `Bearer ${process.env.GITHUB_TOKEN}` } : {};

// Use direct tag lookup endpoint instead of listing releases
// This avoids pagination issues and is more reliable
const maxRetries = 5;
const retryDelayMs = 5000;

for (let attempt = 1; attempt <= maxRetries; attempt++) {
console.log(`Attempt ${attempt}/${maxRetries}: Fetching release for tag ${tag}`);

const releaseData = await fetch(
"GET",
`https://api.github.com/repos/mendix/native-widgets/releases/tags/${tag}`,
undefined,
githubHeaders
);

if (releaseData && releaseData.id) {
console.log(`Found release: ${releaseData.name} (id: ${releaseData.id})`);
const downloadUrl = releaseData.assets?.find(asset => asset.name.endsWith(".mpk"))?.browser_download_url;
if (!downloadUrl) {
throw new Error(`Could not retrieve MPK url from GitHub release with tag ${tag}`);
}
return downloadUrl;
}

if (attempt < maxRetries) {
console.log(`Release not found yet, waiting ${retryDelayMs / 1000}s before retry...`);
await new Promise(resolve => setTimeout(resolve, retryDelayMs));
}
}
return downloadUrl;

throw new Error(`Could not find release with tag ${tag} on GitHub after ${maxRetries} attempts`);
}

async function createDraft(marketplaceId, version, minimumMXVersion) {
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