Skip to content

Commit

Permalink
rename dagger to dagger-cue
Browse files Browse the repository at this point in the history
fixes #78

Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
  • Loading branch information
marcosnils committed Feb 13, 2023
1 parent 75549c9 commit 961905e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 26 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
fail-fast: false
matrix:
version:
- 0.2
- 0.2.5
- latest
- 0.2.232
steps:
-
name: Checkout
Expand Down Expand Up @@ -56,8 +56,7 @@ jobs:
fail-fast: false
matrix:
version:
- 0.2
- 0.2.5
- 0.2.232
steps:
-
name: Checkout
Expand All @@ -71,16 +70,15 @@ jobs:
-
name: Check
run: |
dagger version
dagger-cue version
build-ref:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ref:
- refs/tags/v0.2.5
- refs/pull/2288/head
- refs/heads/cue-sdk
steps:
-
name: Checkout
Expand Down
11 changes: 3 additions & 8 deletions __tests__/dagger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,13 @@ describe('build', () => {
});

describe('install', () => {
it('acquires latest version of Dagger', async () => {
it('acquires latest version of dagger-cue', async () => {
const daggerBin = await dagger.install('latest');
expect(fs.existsSync(daggerBin)).toBe(true);
}, 100000);

it('acquires latest 0.1 version', async () => {
const daggerBin = await dagger.install('0.1');
expect(fs.existsSync(daggerBin)).toBe(true);
}, 100000);

it('acquires 0.1.0-alpha.9 version of Dagger', async () => {
const daggerBin = await dagger.install('0.1.0-alpha.9');
it('acquires latest 0.2.232 version', async () => {
const daggerBin = await dagger.install('0.2.232');
expect(fs.existsSync(daggerBin)).toBe(true);
}, 100000);
});
5 changes: 3 additions & 2 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions src/dagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as exec from '@actions/exec';
import * as http from '@actions/http-client';
import * as tc from '@actions/tool-cache';

const s3URL = 'https://dl.dagger.io/dagger';
const s3URL = 'https://dl.dagger.io/dagger-cue';
const osPlat: string = os.platform();
const osArch: string = os.arch();

Expand All @@ -23,7 +23,7 @@ export async function build(inputBuildRef: string): Promise<string> {
core.debug(`Remote ref ${sha} found`);

let toolPath: string;
toolPath = tc.find('dagger', sha);
toolPath = tc.find('dagger-cue', sha);
if (!toolPath) {
const outFolder = path.join(context.tmpDir(), 'out').split(path.sep).join(path.posix.sep);
toolPath = await exec
Expand All @@ -34,11 +34,11 @@ export async function build(inputBuildRef: string): Promise<string> {
if (res.stderr.length > 0 && res.exitCode != 0) {
core.warning(res.stderr.trim());
}
return tc.cacheFile(`${outFolder}/bin/dagger`, osPlat == 'win32' ? 'dagger.exe' : 'dagger', 'dagger', sha);
return tc.cacheFile(`${outFolder}/bin/dagger-cue`, osPlat == 'win32' ? 'dagger-cue.exe' : 'dagger-cue', 'dagger-cue', sha);
});
}

return path.join(toolPath, osPlat == 'win32' ? 'dagger.exe' : 'dagger');
return path.join(toolPath, osPlat == 'win32' ? 'dagger-cue.exe' : 'dagger-cue');
}

export async function install(version: string): Promise<string> {
Expand All @@ -59,13 +59,13 @@ export async function install(version: string): Promise<string> {
}
core.debug(`Extracted to ${extPath}`);

const cachePath: string = await tc.cacheDir(extPath, 'dagger', version);
const cachePath: string = await tc.cacheDir(extPath, 'dagger-cue', version);
core.debug(`Cached to ${cachePath}`);

const exePath: string = path.join(cachePath, osPlat == 'win32' ? 'dagger.exe' : 'dagger');
const exePath: string = path.join(cachePath, osPlat == 'win32' ? 'dagger-cue.exe' : 'dagger-cue');
core.debug(`Exe path is ${exePath}`);

return path.join(cachePath, osPlat == 'win32' ? 'dagger.exe' : 'dagger');
return path.join(cachePath, osPlat == 'win32' ? 'dagger-cue.exe' : 'dagger-cue');
}

async function getVersionMapping(version: string): Promise<string> {
Expand All @@ -84,5 +84,5 @@ const getFilename = (version: string): string => {
const platform: string = osPlat == 'win32' ? 'windows' : osPlat;
const arch: string = osArch == 'x64' ? 'amd64' : osArch;
const ext: string = osPlat == 'win32' ? '.zip' : '.tar.gz';
return util.format('dagger_v%s_%s_%s%s', version, platform, arch, ext);
return util.format('dagger-cue_v%s_%s_%s%s', version, platform, arch, ext);
};

0 comments on commit 961905e

Please sign in to comment.