Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
rust
Duniter v2S
Commits
5906820a
Commit
5906820a
authored
3 months ago
by
Cédric Moreau
Browse files
Options
Downloads
Patches
Plain Diff
#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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+10
-13
10 additions, 13 deletions
.gitlab-ci.yml
xtask/src/gitlab.rs
+28
-5
28 additions, 5 deletions
xtask/src/gitlab.rs
xtask/src/main.rs
+18
-0
18 additions, 0 deletions
xtask/src/main.rs
with
56 additions
and
18 deletions
.gitlab-ci.yml
+
10
−
13
View file @
5906820a
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
xtask/src/gitlab.rs
+
28
−
5
View file @
5906820a
...
...
@@ -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
?
;
...
...
This diff is collapsed.
Click to expand it.
xtask/src/main.rs
+
18
−
0
View file @
5906820a
...
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment