From 61fbef9c01142e96d6be80a330f4f8254a204879 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Thu, 19 Aug 2021 14:59:30 -0300 Subject: [PATCH] v 3.2.5 --- CHANGELOG.md | 4 ++ package.json | 2 +- .../desktop-release-action/src/github.ts | 44 +++++++++++++------ .../desktop-release-action/src/index.ts | 10 +++-- .../desktop-release-action/src/shell.ts | 8 +++- 5 files changed, 49 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc481dfc3f..3a9af05da4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [3.2.5](https://github.com/RocketChat/Rocket.Chat.Electron/compare/3.2.4...3.2.5) (2021-08-19) + + + ## [3.2.4](https://github.com/RocketChat/Rocket.Chat.Electron/compare/3.2.3...3.2.4) (2021-08-16) diff --git a/package.json b/package.json index 04e7876baf..4f9cd3f26b 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ ], "name": "rocketchat", "description": "Official OSX, Windows, and Linux Desktop Clients for Rocket.Chat", - "version": "3.4.0-snapshot", + "version": "3.2.5", "author": "Rocket.Chat Support ", "copyright": "© 2016-2021, Rocket.Chat", "homepage": "https://rocket.chat", diff --git a/workspaces/desktop-release-action/src/github.ts b/workspaces/desktop-release-action/src/github.ts index cae6da470e..0dcbd4aa49 100644 --- a/workspaces/desktop-release-action/src/github.ts +++ b/workspaces/desktop-release-action/src/github.ts @@ -77,26 +77,42 @@ export const getSnapshotRelease = async (commitSha: string) => { }; export const getTaggedRelease = async (version: SemVer, commitSha: string) => { + core.info(`getChangelog()`); const body = await getChangelog(); - + core.info(`getChangelog() done`); + core.info(`findRelease()`); const release = await findRelease( (release: Release) => release.tag_name === version.version ); + core.info(`findRelease() done ${JSON.stringify(release)}`); if (release) { - return ( - await octokit.request( - 'PATCH /repos/{owner}/{repo}/releases/{release_id}', - { - ...getRepoParams(), - release_id: release.id, - draft: true, - body, - tag_name: version.version, - target_commitish: commitSha, - } - ) - ).data; + core.info(`getRepoParams() done ${JSON.stringify(getRepoParams())}`); + core.info( + `release ${JSON.stringify({ + ...getRepoParams(), + release_id: release.id, + draft: true, + body, + tag_name: version.version, + target_commitish: commitSha, + })}` + ); + + try { + const result = await octokit.rest.repos.updateRelease({ + ...getRepoParams(), + release_id: release.id, + draft: true, + body: body || version.version, + tag_name: version.version, + target_commitish: commitSha, + }); + core.info(`result ${JSON.stringify(result)}`); + return result.data; + } catch (error) { + core.setFailed(error as any); + } } return ( diff --git a/workspaces/desktop-release-action/src/index.ts b/workspaces/desktop-release-action/src/index.ts index fb911e7ca2..418947dd71 100644 --- a/workspaces/desktop-release-action/src/index.ts +++ b/workspaces/desktop-release-action/src/index.ts @@ -74,17 +74,21 @@ const releaseSnapshot = async (commitSha: string) => { }; const releaseTagged = async (version: SemVer, commitSha: string) => { + core.info(`[releaseTagged] started`); await pack(); - + core.info(`[releaseTagged] pack finished`); const release = await getTaggedRelease(version, commitSha); if (!release.draft) { throw new Error(`not updating a published release`); } - + core.info(`[releaseTagged] release found`); const assets = await getReleaseAssets(release.id); + core.info(`[releaseTagged] assets: ${JSON.stringify(assets)}`); - for (const path of await getFilesToUpload()) { + const files = await getFilesToUpload(); + core.info(`[releaseTagged] files: ${JSON.stringify(files)}`); + for (const path of files) { const name = basename(path); const extension = extname(path).toLowerCase(); const { size } = await promises.stat(path); diff --git a/workspaces/desktop-release-action/src/shell.ts b/workspaces/desktop-release-action/src/shell.ts index 318ac0460f..6a208f5fc3 100644 --- a/workspaces/desktop-release-action/src/shell.ts +++ b/workspaces/desktop-release-action/src/shell.ts @@ -63,7 +63,13 @@ export const runAndBuffer = ( return; } - reject(new Error(`process failed (exitCode=${exitCode})`)); + reject( + new Error( + `process failed (exitCode=${exitCode}) \n\n ${buffer.toString( + 'utf-8' + )}` + ) + ); }); });