Skip to content

Commit

Permalink
fix: have CI properly rename linux binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
beebls committed Jul 4, 2023
1 parent f3c5f7a commit e7d824b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/create-release-assets/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ runs:
"windowsInstaller": `CSSLoader.Desktop_${versionNoV}.msi`,
"windowsUpdater": `CSSLoader.Desktop_${versionNoV}.msi.zip`,
"windowsUpdaterSig": `CSSLoader.Desktop_${versionNoV}.msi.zip.sig`,
"linuxInstaller": `CSSLoader.Desktop_${versionNoV}.AppImage`,
"linuxUpdater": `CSSLoader.Desktop_${versionNoV}.AppImage.tar.gz`,
"linuxUpdaterSig": `CSSLoader.Desktop_${versionNoV}.AppImage.tar.gz.sig`,
}
const assets = await github.rest.repos.listReleaseAssets({
Expand All @@ -106,12 +109,22 @@ runs:
const winUpdaterSig = assets.data.find((asset) => asset.name.endsWith(".msi.zip.sig"));
await setReleaseAssetName(winUpdaterSig.id, GENERIC_NAMES["windowsUpdaterSig"]);
const linuxInstaller = assets.data.find((asset) => asset.name.endsWith(".AppImage"));
await setReleaseAssetName(linuxInstaller.id, GENERIC_NAMES["linuxInstaller"]);
const linuxUpdater = assets.data.find((asset) => asset.name.endsWith(".AppImage.tar.gz"));
await setReleaseAssetName(linuxUpdater.id, GENERIC_NAMES["linuxUpdater"]);
const linuxUpdaterSig = assets.data.find((asset) => asset.name.endsWith(".AppImage.tar.gz.sig"));
await setReleaseAssetName(linuxUpdaterSig.id, GENERIC_NAMES["linuxUpdaterSig"]);
const latest = assets.data.find((asset) => asset.name === "latest.json");
const latestContentsBuff = Buffer.from(await getReleaseAssetContents(latest.id));
let latestContents = latestContentsBuff.toString();
await deleteReleaseAsset(latest.id);
latestContents = latestContents.replace(winUpdater.name, GENERIC_NAMES["windowsUpdater"]);
latestContents = latestContents.replace(linuxUpdater.name, GENERIC_NAMES["linuxUpdater"]);
await uploadReleaseAsset("latest.json", Buffer.from(latestContents));
Expand Down

0 comments on commit e7d824b

Please sign in to comment.