Skip to content

Commit

Permalink
chore(appimage): more old PackSquash version support cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTMjugador committed Oct 14, 2022
1 parent a5b0075 commit 0409760
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 34 deletions.
2 changes: 1 addition & 1 deletion dist/main/index.js

Large diffs are not rendered by default.

50 changes: 17 additions & 33 deletions src/appimage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,31 @@ export async function downloadAppImage(workingDirectory: WorkingDirectory) {
const arch = getArchitecture();
debug(`Runner architecture: ${arch}`);

let arch_infix;
let archInfix;
switch (arch) {
case 'X64':
archInfix = 'x86_64';
break;
case 'ARM64':
archInfix = 'aarch64';
break;
default:
throw Error(
`The ${arch} architecture is not supported by this action. Please use a runner with a supported architecture.`
);
}

switch (version) {
case 'v0.1.0':
case 'v0.1.1':
case 'v0.1.2':
case 'v0.2.0':
case 'v0.2.1':
case 'v0.3.0-rc.1':
case 'v0.3.0':
throw Error(`Unsupported PackSquash version: ${version}. Please use PackSquash-action@v2 instead.`);
case 'v0.3.1':
switch (arch) {
case 'X64':
arch_infix = 'x86_64';
break;
case 'ARM64':
arch_infix = 'aarch64';
break;
default:
throw Error(
`PackSquash ${version} does not support ${arch}. Please use a runner with a supported architecture, or request support for it. A newer version might add support for this architecture.`
);
}
await downloadReleaseAppImage(workingDirectory, version, `PackSquash-${version}-${arch_infix}.AppImage`);
await downloadReleaseAppImage(workingDirectory, version, `PackSquash-${version}-${archInfix}.AppImage`);
break;
case 'latest':
switch (arch) {
case 'X64':
arch_infix = 'x86_64';
break;
case 'ARM64':
arch_infix = 'aarch64';
break;
default:
throw Error(`The latest PackSquash build does not support ${arch}. Please use a runner with a supported architecture, or request support for it.`);
}
await downloadLatestAppImage(workingDirectory, arch_infix);
await downloadLatestAppImage(workingDirectory, archInfix);
break;
default:
throw Error(`Unsupported PackSquash version: ${version}`);
}

await chmod(workingDirectory.packsquashBinary, '755');
}

Expand Down

0 comments on commit 0409760

Please sign in to comment.