From 33081a9d2129d39a4893dedcd0f7ace26c96dde2 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Mon, 22 Apr 2024 08:56:19 +0000 Subject: [PATCH] add engine-version input param --- .github/workflows/plugin.yml | 1 + README.md | 1 + action.yml | 4 ++++ dist/action.js | 1 + dist/setup.js | 3 ++- src/action.ts | 1 + src/setup.ts | 3 +++ 7 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/plugin.yml b/.github/workflows/plugin.yml index b6670fb..ba63e6a 100644 --- a/.github/workflows/plugin.yml +++ b/.github/workflows/plugin.yml @@ -19,4 +19,5 @@ jobs: uses: ./ with: wasm: true + engine-version: 0.2.6 args: base_pipeline hello Tsiry Sandratraina diff --git a/README.md b/README.md index aed0ef2..7cf9bb3 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ jobs: | Key | Description | Default | | -------------- | --------------------------------------- | ------- | | dagger-version | The version of the Dagger Engine to use | 0.11.0 | +| engine-version | The version of the FluentCI Engine to use | 0.2.6 | | pipeline | The pipeline (module) to execute | | | plugin | Alias for `pipeline` | | | module | Alias for `pipeline` | | diff --git a/action.yml b/action.yml index 5e1a1de..542cf25 100644 --- a/action.yml +++ b/action.yml @@ -27,6 +27,10 @@ inputs: description: Dagger version to install required: false default: 0.11.0 + engine-version: + description: FluentCI engine version to install + required: false + default: 0.2.6 working-directory: description: Set the current working directory default: . diff --git a/dist/action.js b/dist/action.js index 55b2fc0..c823f5b 100644 --- a/dist/action.js +++ b/dist/action.js @@ -6,6 +6,7 @@ if (!process.env.RUNNER_TEMP) { } setup({ daggerVersion: action.getInput("dagger-version"), + engineVersion: action.getInput("engine-version"), wasm: action.getInput("wasm") === "false" ? false : action.getInput("wasm"), args: action .getInput("args") diff --git a/dist/setup.js b/dist/setup.js index dd85ce8..db84406 100644 --- a/dist/setup.js +++ b/dist/setup.js @@ -3,7 +3,7 @@ import { join } from "node:path"; import * as action from "@actions/core"; import { getExecOutput, exec } from "@actions/exec"; import { installDocker } from "./setup-docker.js"; -export default async ({ daggerVersion, wasm, pipeline, args, workdir, }) => { +export default async ({ daggerVersion, engineVersion, wasm, pipeline, args, workdir, }) => { // throw error on unsupported platforms (windows) if (process.platform === "win32") { throw new Error("FluentCI is not supported on Windows"); @@ -31,6 +31,7 @@ export default async ({ daggerVersion, wasm, pipeline, args, workdir, }) => { ]); await exec("sudo", ["mv", "bin/dagger", "/usr/local/bin"]); const version = await verifyFluentCI("fluentci"); + action.exportVariable("FLUENTCI_ENGINE_VERSION", engineVersion.startsWith('v') ? engineVersion : `v${engineVersion}`); if (pipeline) { if (wasm) { if (!args.length) { diff --git a/src/action.ts b/src/action.ts index abcfccd..52ec392 100644 --- a/src/action.ts +++ b/src/action.ts @@ -8,6 +8,7 @@ if (!process.env.RUNNER_TEMP) { setup({ daggerVersion: action.getInput("dagger-version"), + engineVersion: action.getInput("engine-version"), wasm: action.getInput("wasm") === "false" ? false : action.getInput("wasm"), args: action .getInput("args") diff --git a/src/setup.ts b/src/setup.ts index dcafbf3..0350027 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -6,6 +6,7 @@ import { installDocker } from "./setup-docker.js"; export default async ({ daggerVersion, + engineVersion, wasm, pipeline, args, @@ -47,6 +48,8 @@ export default async ({ await exec("sudo", ["mv", "bin/dagger", "/usr/local/bin"]); const version = await verifyFluentCI("fluentci"); + action.exportVariable("FLUENTCI_ENGINE_VERSION", engineVersion.startsWith('v') ? engineVersion : `v${engineVersion}`); + if (pipeline) { if (wasm) { if (!args.length) {