Skip to content

Commit

Permalink
Merge pull request #98 from fullstackedorg/runner-improvements
Browse files Browse the repository at this point in the history
Runner Improvements
  • Loading branch information
cplepage authored Oct 8, 2024
2 parents 10d321f + 78d0c1c commit c665495
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 46 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# FullStacked Editor

[Docs](https://docs.fullstacked.org) | [Demo](https://demo.fullstacked.org)
[Docs](https://docs.fullstacked.org) | [Demo](https://demo.fullstacked.org) | [Figma](https://www.figma.com/design/xb3JBRCvEWpbwGda03T5QQ/Mockups)

Create local-first web-like apps on any platform.

Expand Down
2 changes: 1 addition & 1 deletion platform/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
"esbuild": "^0.24.0",
"tar": "^7.4.3"
}
}
}
2 changes: 1 addition & 1 deletion platform/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
"mime": "^4.0.4",
"ws": "^8.18.0"
}
}
}
96 changes: 53 additions & 43 deletions runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ const currentVersion = JSON.parse(
).version;
const latestReleaseVersion = await getLatestReleaseVersion();

if (semver.lte(currentVersion, latestReleaseVersion)) {
notifyError(
`Trying to run same or older version. Current [${currentVersion}] | Latest [${latestReleaseVersion}]`
);
}

const electronDirectory = "platform/electron";

const BUILD_AND_TEST = () => {
Expand All @@ -103,7 +97,11 @@ const NODE_BUILD = async () => {
const nodePackageJson = JSON.parse(
fs.readFileSync(nodePackageJsonFile, { encoding: "utf-8" })
);
nodePackageJson.version = currentVersion + "-" + commitNumber;

nodePackageJson.version = release
? currentVersion
: currentVersion + "-" + commitNumber;

fs.writeFileSync(
nodePackageJsonFile,
JSON.stringify(nodePackageJson, null, 4)
Expand Down Expand Up @@ -497,11 +495,15 @@ const DOCKER_DEPLOY = () => {
);
};


async function run() {

const start = new Date();

if (!release && semver.lte(currentVersion, latestReleaseVersion)) {
await notifyError(
`Trying to run same or older version. Current [${currentVersion}] | Latest [${latestReleaseVersion}]`
);
}

/////// BUILD AND TESTS ////////

let tries = 5;
Expand All @@ -528,24 +530,28 @@ async function run() {
console.error(e);
await notifyError("Failed to build for node");
}
try {
await ELECTRON_BUILD();
} catch (e) {
console.error(e);
await notifyError("Failed to build for electron");
}
try {
IOS_BUILD();
} catch (e) {
console.error(e);
await notifyError("Failed to build for ios");
}
try {
ANDROID_BUILD();
} catch (e) {
console.error(e);
await notifyError("Failed to build for android");

if (!release) {
try {
await ELECTRON_BUILD();
} catch (e) {
console.error(e);
await notifyError("Failed to build for electron");
}
try {
IOS_BUILD();
} catch (e) {
console.error(e);
await notifyError("Failed to build for ios");
}
try {
ANDROID_BUILD();
} catch (e) {
console.error(e);
await notifyError("Failed to build for android");
}
}

try {
DOCKER_BUILD();
} catch (e) {
Expand All @@ -561,24 +567,28 @@ async function run() {
console.error(e);
notifyError("Failed to deploy for node", false);
}
try {
await ELECTRON_DEPLOY();
} catch (e) {
console.error(e);
notifyError("Failed to deploy for electron", false);
}
try {
IOS_DEPLOY();
} catch (e) {
console.error(e);
notifyError("Failed to deploy for ios", false);
}
try {
ANDROID_DEPLOY();
} catch (e) {
console.error(e);
notifyError("Failed to deploy for android", false);

if (!release) {
try {
await ELECTRON_DEPLOY();
} catch (e) {
console.error(e);
notifyError("Failed to deploy for electron", false);
}
try {
IOS_DEPLOY();
} catch (e) {
console.error(e);
notifyError("Failed to deploy for ios", false);
}
try {
ANDROID_DEPLOY();
} catch (e) {
console.error(e);
notifyError("Failed to deploy for android", false);
}
}

try {
DOCKER_DEPLOY();
} catch (e) {
Expand Down

0 comments on commit c665495

Please sign in to comment.