Skip to content

Commit

Permalink
update dist
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszBlizniak committed Aug 28, 2024
1 parent c79b084 commit 95b8ef7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33268,6 +33268,11 @@ const CLI_VERSION = core.getInput('cli-version');
const EXECUTABLE_PATH = core.getInput('executable-path') || path.join(process.env.GITHUB_WORKSPACE, 'bin', 'cloudsmith');
const PIP_INSTALL = core.getInput('pip-install') === 'true';

// Define constants for URL construction
const BASE_URL = 'https://dl.cloudsmith.io/public';
const NAMESPACE = 'cloudsmith';
const REPO_NAME = 'cli-zipapp';

// Ensure the executable directory exists
fs.mkdirSync(path.dirname(EXECUTABLE_PATH), { recursive: true });

Expand Down Expand Up @@ -33300,7 +33305,7 @@ function addPathAndCreateBatchScript() {
// Download the latest release of the CLI
async function downloadLatestRelease() {
try {
const downloadUrl = 'https://dl.cloudsmith.io/public/bart-demo-org/cloudsmith-cli-zipapp/raw/names/cloudsmith-cli/versions/latest/cloudsmith.pyz';
const downloadUrl = `${BASE_URL}/${NAMESPACE}/${REPO_NAME}/raw/names/cloudsmith-cli/versions/latest/cloudsmith.pyz`;
await downloadFile(downloadUrl, EXECUTABLE_PATH);
addPathAndCreateBatchScript();
} catch (error) {
Expand All @@ -33311,7 +33316,7 @@ async function downloadLatestRelease() {
// Download a specific release of the CLI by version
async function downloadSpecificRelease(version) {
try {
const downloadUrl = `https://dl.cloudsmith.io/public/bart-demo-org/cloudsmith-cli-zipapp/raw/names/cloudsmith-cli/versions/${version}/cloudsmith.pyz`;
const downloadUrl = `${BASE_URL}/${NAMESPACE}/${REPO_NAME}/raw/names/cloudsmith-cli/versions/${version}/cloudsmith.pyz`;
await downloadFile(downloadUrl, EXECUTABLE_PATH);
addPathAndCreateBatchScript();
} catch (error) {
Expand All @@ -33334,7 +33339,7 @@ async function installCli() {
try {
if (PIP_INSTALL) {
await installCliViaPip();
} else if (CLI_VERSION && CLI_VERSION !== 'none') {
} else if (CLI_VERSION && CLI_VERSION !== '') {
await downloadSpecificRelease(CLI_VERSION);
} else {
await downloadLatestRelease();
Expand Down

0 comments on commit 95b8ef7

Please sign in to comment.