Skip to content
Open
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
17 changes: 13 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getAssetName = exports.getRepo = exports.CarvelReleasesService = void 0;
const gha_installer_1 = __nccwpck_require__(631);
const crypto = __importStar(__nccwpck_require__(6113));
const path = __importStar(__nccwpck_require__(1017));
const fs = __importStar(__nccwpck_require__(7147));
const core = __importStar(__nccwpck_require__(2186));
const os_1 = __importDefault(__nccwpck_require__(2037));
class CarvelReleasesService extends gha_installer_1.GitHubReleasesService {
constructor(core, env, fs, octokit) {
super(core, env, octokit, { repo: getRepo, assetName: getAssetName });
Expand Down Expand Up @@ -84,13 +88,18 @@ function getAssetName(platform, app) {
}
exports.getAssetName = getAssetName;
function getAssetSuffix(platform) {
switch (platform) {
case 'win32':
const arch = os_1.default.arch();
switch (`${platform}-${arch}`) {
case 'win32-x64':
return 'windows-amd64.exe';
case 'darwin':
case 'darwin-x64':
return 'darwin-amd64';
default:
case 'linux-x64':
return 'linux-amd64';
case 'linux-arm64':
return 'linux-arm64';
default:
throw new Error(`Unsupported platform-arch combination: ${platform}-${arch}`);
}
}

Expand Down
14 changes: 10 additions & 4 deletions src/carvel_releases_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import * as crypto from 'crypto'
import * as path from 'path'
import * as fs from 'fs'
import * as core from '@actions/core'
import os from 'os';

export class CarvelReleasesService extends GitHubReleasesService {
private _fs: FileSystem
Expand Down Expand Up @@ -85,12 +86,17 @@ export function getAssetName(platform: string, app: AppInfo): string {
}

function getAssetSuffix(platform: string): string {
switch (platform) {
case 'win32':
const arch = os.arch()
switch (`${platform}-${arch}`) {
case 'win32-x64':
return 'windows-amd64.exe'
case 'darwin':
case 'darwin-x64':
return 'darwin-amd64'
default:
case 'linux-x64':
return 'linux-amd64'
case 'linux-arm64':
return 'linux-arm64'
default:
throw new Error(`Unsupported platform-arch combination: ${platform}-${arch}`)
}
}