Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/adapt for publish pipeline #7

Merged
merged 2 commits into from
Jan 12, 2024
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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@js-soft/codemagic-tools",
"version": "1.0.1",
"version": "1.0.2",
"description": "Codemagic extended tooling",
"homepage": "https://github.com/js-soft/codemagic-tools#readme",
"bugs": {
Expand Down
16 changes: 6 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { runTeamsDevelopMessagingCommand } from "./commands/TeamsDevelopMessagin
import { runTeamsProductionMessagingCommand } from "./commands/TeamsProductionMessaging";

async function run() {
let buildWasSuccessful = fs.existsSync(`${os.homedir()}/SUCCESS`);
const buildWasSuccessful = fs.existsSync(`${os.homedir()}/SUCCESS`);

const webhook = process.env.teams_webhook_url!;
const buildId = process.env.CM_BUILD_ID!;
Expand All @@ -20,11 +20,13 @@ async function run() {
let artifactUrl: string;
let artifactType: string;

// if no artifact is found, logs are used as a fallback
artifactUrl = buildUrl;
artifactType = "logs";

if (process.env.CM_ARTIFACT_LINKS !== undefined) {
const cmArtifactLinks = JSON.parse(process.env.CM_ARTIFACT_LINKS);
if (cmArtifactLinks.filter((element: any) => element.type === "apk" || element.type === "ipa").length === 0) {
buildWasSuccessful = false;
} else {
if (cmArtifactLinks.filter((element: any) => element.type === "apk" || element.type === "ipa").length !== 0) {
const pickedElement = cmArtifactLinks.filter(
(element: any) => element.type === "apk" || element.type === "ipa"
)[0];
Expand All @@ -33,12 +35,6 @@ async function run() {
}
}

if (!buildWasSuccessful) {
// should link to the workflow-log can be determined from buildId and projectId
artifactUrl = buildUrl;
artifactType = "logs";
}

await yargs(process.argv.slice(2))
.option("platform", {
description: "Identifier of the platform for which the build was created",
Expand Down
Loading