Skip to content
Snippets Groups Projects
Commit 5906820a authored by Cédric Moreau's avatar Cédric Moreau
Browse files

#239: fix: create_client_release must not depend on runtime milestone

parent 00555964
No related branches found
No related tags found
No related merge requests found
......@@ -188,8 +188,8 @@ tests:
- echo $CLIENT_VERSION
- export RUNTIME_VERSION=$(cat runtime/gdev/src/lib.rs | grep "spec_version:" | sed "s/ *spec_version. //g" | sed "s/,//g")
- echo $RUNTIME_VERSION
- export RUNTIME_MILESTONE="runtime-$RUNTIME_VERSION"
- echo $RUNTIME_MILESTONE
- export CLIENT_MILESTONE="client-$CLIENT_VERSION"
- echo $CLIENT_MILESTONE
- export NETWORK_RELEASE="$NETWORK"
- echo $NETWORK_RELEASE
- export DOCKER_TAG="$RUNTIME_VERSION-$CLIENT_VERSION"
......@@ -260,11 +260,10 @@ docker_deploy:
############## SRTOOL ##############
# We always build the runtime on a network/ branch, either it is for:
# - creating a network release (i.e.: genesis)
# - creating a client release (i.e.: which also includes the runtime)
build_runtime:
# The Network Runtime is only built when creating a network release (i.e.: genesis)
build_network_runtime:
stage: build
needs: ["trigger_network_release"]
rules:
- <<: *is_network_branch
image: paritytech/srtool:1.77.0-0.15.0
......@@ -340,7 +339,7 @@ g1_data:
build_specs:
stage: build
needs: ["build_runtime", "g1_data"]
needs: ["build_network_runtime", "g1_data"]
rules:
- <<: *is_network_branch
extends: .env
......@@ -425,17 +424,15 @@ create_network_release:
create_client_release:
stage: release
needs: ["build_runtime", "build_raw_specs"]
needs: ["build_raw_specs"]
rules:
- <<: *is_network_branch
image: rust:1-bullseye
variables:
# Used by `release-runtime` command
SRTOOL_OUTPUT: $CI_PROJECT_DIR/release/srtool_output.json
script:
- *define_network_branch_vars
- cargo xtask release-runtime $CLIENT_RELEASE_NAME $NETWORK_RELEASE $CI_COMMIT_BRANCH $RUNTIME_MILESTONE
- cargo xtask create-asset-link $CLIENT_RELEASE_NAME ${RUNTIME}_runtime.compact.compressed.wasm https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/$RELEASE_FILE_WASM
# Create the GitLab release page + tag and associate the milestone
- cargo xtask release-client $CLIENT_RELEASE_NAME $CI_COMMIT_BRANCH $CLIENT_MILESTONE
# Add the client assets
- cargo xtask create-asset-link $CLIENT_RELEASE_NAME ${RUNTIME}_client-specs.yaml https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/$RELEASE_FILE_CLIENT_SPEC
- cargo xtask create-asset-link $CLIENT_RELEASE_NAME ${RUNTIME}-raw.json https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/$RELEASE_FILE_RAW_SPEC
artifacts:
......
......@@ -91,14 +91,37 @@ pub(super) async fn release_runtime(
branch: String,
milestone: String,
) -> Result<()> {
let mut release_notes = String::from(
release(
"Runtime".to_string(),
name,
Some(network),
branch,
milestone,
)
.await
}
pub(super) async fn release_client(name: String, branch: String, milestone: String) -> Result<()> {
release("Client".to_string(), name, None, branch, milestone).await
}
async fn release(
title: String,
name: String,
network: Option<String>,
branch: String,
milestone: String,
) -> Result<()> {
let mut release_notes = String::from(format!(
"
# Runtime
# {title}
",
);
"
));
add_srtool_notes(network, &mut release_notes)?;
if let Some(network) = network {
add_srtool_notes(network.clone(), &mut release_notes)?;
}
// Get changes (list of MRs) from gitlab API
let changes = get_changes::get_changes(milestone.clone()).await?;
......
......@@ -57,9 +57,22 @@ enum DuniterXTaskCommand {
ReleaseNetwork { network: String, branch: String },
/// Release a new runtime
ReleaseRuntime {
/// Name of the release + tag to be applied
name: String,
/// Name of the network to be put in the release notes title of the srtool part
network: String,
/// Branch on which the tag `name` will be created during the release
branch: String,
/// Name of the milestone to add this release to
milestone: String,
},
/// Release a new client for a network
ReleaseClient {
/// Name of the release + tag to be applied
name: String,
/// Branch on which the tag `name` will be created during the release
branch: String,
/// Name of the milestone to add this release to
milestone: String,
},
/// Print the chainSpec published on given Network Release
......@@ -112,6 +125,11 @@ async fn main() -> Result<()> {
branch,
milestone,
} => gitlab::release_runtime(name, network, branch, milestone).await,
DuniterXTaskCommand::ReleaseClient {
name,
branch,
milestone,
} => gitlab::release_client(name, branch, milestone).await,
DuniterXTaskCommand::PrintSpec { network } => gitlab::print_spec(network).await,
DuniterXTaskCommand::CreateAssetLink {
tag,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment