Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename dagger to dagger-cue #79

Merged
merged 2 commits into from
Feb 13, 2023
Merged
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
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Following inputs can be used as `step.with` keys

| Name | Type | Default | Description |
|----------------|--------|---------|----------------------------------------------------------------------------------------|
| `version` | String | `0.2` | Dagger version (e.g., `0.2.36`, `latest`, `https://github.com/dagger/dagger.git#main`) |
| `version` | String | `0.2.232` | Dagger version (e.g., `0.2.232`, `latest`, `https://github.com/dagger/dagger.git#main`) |
| `cmds` | List | | List of Dagger commands |
| `workdir` | String | `.` | Working directory (below repository root) |
| `install-only` | Bool | `false` | Just install Dagger |
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);
});
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ branding:

inputs:
version:
description: 'Dagger version'
default: '0.2'
description: 'Dagger CUE version'
default: '0.2.232'
required: false
args:
description: 'Arguments to pass to Dagger'
Expand Down
2 changes: 1 addition & 1 deletion 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.

2 changes: 1 addition & 1 deletion src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface Inputs {

export async function getInputs(): Promise<Inputs> {
return {
version: core.getInput('version') || '0.2',
version: core.getInput('version') || '0.2.232',
workdir: core.getInput('workdir') || '.',
args: core.getInput('args'),
installOnly: core.getBooleanInput('install-only'),
Expand Down
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);
};