Skip to content

Commit

Permalink
fix: promote nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
4e6 committed Dec 1, 2024
1 parent 0b6b1f0 commit cf8e067
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 27 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
uses: ./.github/workflows/promote.yml
with:
designator: nightly
ydoc: ${{ env.ENV_INPUTS_YDOC }}
ydoc: ${{ inputs.ydoc || 'nodejs' }}
secrets: inherit
env:
ENSO_BUILD_SKIP_VERSION_CHECK: "true"
ENV_INPUTS_YDOC: ${{ inputs.ydoc || nodejs }}
19 changes: 0 additions & 19 deletions build/build/src/ci/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,6 @@ pub mod name {
pub const YDOC: &str = "ydoc";
}

pub mod env {
use ide_ci::env::accessor::RawVariable;

#[derive(Clone, Copy, Debug, Default)]
pub struct Ydoc;

impl RawVariable for Ydoc {
fn name(&self) -> &str {
"ENV_INPUTS_YDOC"
}
}

impl From<Ydoc> for String {
fn from(val: Ydoc) -> Self {
val.name().to_owned()
}
}
}

pub fn designator() -> WorkflowDispatchInput {
WorkflowDispatchInput::new_choice(
"What kind of release should be promoted.",
Expand Down
10 changes: 4 additions & 6 deletions build/build/src/ci_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use crate::version::ENSO_RELEASE_MODE;
use crate::version::ENSO_VERSION;

use ide_ci::actions::workflow::definition::checkout_repo_step;
use ide_ci::actions::workflow::definition::env_expression;
use ide_ci::actions::workflow::definition::get_input;
use ide_ci::actions::workflow::definition::get_input_expression;
use ide_ci::actions::workflow::definition::is_non_windows_runner;
Expand Down Expand Up @@ -502,14 +501,13 @@ pub fn nightly() -> Result<Workflow> {
};

let mut workflow = Workflow { on, name: "Nightly Release".into(), ..default() };
// Scheduled workflows do not support input parameters. Instead we provide env variable
// expression with default. Feature request is tracked by https://github.com/orgs/community/discussions/74698
let input_env_ydoc = format!("{} || {}", get_input(input::name::YDOC), input_ydoc_default);
workflow.env(input::env::Ydoc, wrap_expression(input_env_ydoc));
// Scheduled workflows do not support input parameters. We need to provide an explicit default
// value. Feature request is tracked by https://github.com/orgs/community/discussions/74698
let input_ydoc = format!("{} || '{}'", get_input(input::name::YDOC), input_ydoc_default);

let job = workflow_call_job("Promote nightly", PROMOTE_WORKFLOW_PATH)
.with_with(input::name::DESIGNATOR, Designation::Nightly.as_ref())
.with_with(input::name::YDOC, env_expression(&input::env::Ydoc));
.with_with(input::name::YDOC, wrap_expression(input_ydoc));
workflow.add_job(job);
Ok(workflow)
}
Expand Down

0 comments on commit cf8e067

Please sign in to comment.