Skip to content

Commit

Permalink
add engine-version input param
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Apr 22, 2024
1 parent c3f6f34 commit 33081a9
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ jobs:
uses: ./
with:
wasm: true
engine-version: 0.2.6
args: base_pipeline hello Tsiry Sandratraina
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` | |
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: .
Expand Down
1 change: 1 addition & 0 deletions dist/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion dist/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 3 additions & 0 deletions src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { installDocker } from "./setup-docker.js";

export default async ({
daggerVersion,
engineVersion,
wasm,
pipeline,
args,
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 33081a9

Please sign in to comment.