Skip to content

Commit

Permalink
v 3.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Aug 20, 2021
1 parent 029f853 commit 61fbef9
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>",
"copyright": "© 2016-2021, Rocket.Chat",
"homepage": "https://rocket.chat",
Expand Down
44 changes: 30 additions & 14 deletions workspaces/desktop-release-action/src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
10 changes: 7 additions & 3 deletions workspaces/desktop-release-action/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 7 additions & 1 deletion workspaces/desktop-release-action/src/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)}`
)
);
});
});

Expand Down

0 comments on commit 61fbef9

Please sign in to comment.