rename dagger to dagger-cue (#79)

* rename dagger to dagger-cue
fixes #78

Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
This commit is contained in:
Marcos Nils 2023-02-13 17:08:12 -03:00 committed by GitHub
parent 75549c92b9
commit 2572459a33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 22 additions and 29 deletions

View file

@ -19,8 +19,8 @@ jobs:
fail-fast: false
matrix:
version:
- 0.2
- 0.2.5
- latest
- 0.2.232
steps:
-
name: Checkout
@ -56,8 +56,7 @@ jobs:
fail-fast: false
matrix:
version:
- 0.2
- 0.2.5
- 0.2.232
steps:
-
name: Checkout
@ -71,7 +70,7 @@ jobs:
-
name: Check
run: |
dagger version
dagger-cue version
build-ref:
runs-on: ubuntu-latest
@ -79,8 +78,7 @@ jobs:
fail-fast: false
matrix:
ref:
- refs/tags/v0.2.5
- refs/pull/2288/head
- refs/heads/cue-sdk
steps:
-
name: Checkout

View file

@ -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 |

View file

@ -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);
});

View file

@ -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'

2
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View file

@ -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'),

View file

@ -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();
@ -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
@ -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> {
@ -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> {
@ -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);
};