Skip to content

Commit 21617c2

Browse files
Merge branch 'develop' into chore/enable-epoch4-consensus-tests
2 parents 557c373 + 91f4c11 commit 21617c2

98 files changed

Lines changed: 1065 additions & 1465 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/release/action.yml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
name: Create Releases
22
description: |
3-
Wrapper workflow to create GitHub Releases
3+
Wrapper workflow to create the GitHub Release
44
55
inputs:
6-
node_tag:
7-
description: "Node Release Tag"
8-
required: true
9-
signer_tag:
10-
description: "Signer Release Tag"
6+
tag:
7+
description: "Release Tag (e.g. 4.0.0)"
118
required: true
129
digest_manifest:
1310
description: "Path to docker digest manifest directory (optional)"
@@ -19,24 +16,13 @@ runs:
1916
steps:
2017
# Checkout the code
2118
- name: Checkout the latest code
22-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2320
with:
2421
ref: ${{ github.event.pull_request.head.sha || github.ref }}
2522

26-
# Creates the node release
27-
- name: Create Node Release
28-
if: inputs.node_tag != ''
29-
uses: ./.github/actions/release/create-github-release
30-
with:
31-
tag: ${{ inputs.node_tag }}
32-
release_type: stacks-core
33-
digest_manifest: ${{ inputs.digest_manifest }}
34-
35-
# Creates the signer release
36-
- name: Create Signer Release
37-
if: inputs.signer_tag != ''
23+
# Creates the combined release
24+
- name: Create Release
3825
uses: ./.github/actions/release/create-github-release
3926
with:
40-
tag: ${{ inputs.signer_tag }}
41-
release_type: stacks-signer
27+
tag: ${{ inputs.tag }}
4228
digest_manifest: ${{ inputs.digest_manifest }}

.github/actions/release/create-github-release/action.yml

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ description: |
44
55
inputs:
66
tag:
7-
description: "Release tag (bare version, no 'signer-' prefix for signer releases)"
8-
required: true
9-
release_type:
10-
description: "Release type: stacks-core or stacks-signer"
7+
description: "Release tag (e.g. 4.0.0)"
118
required: true
129
digest_manifest:
1310
description: "Path to docker digest manifest file (optional)"
@@ -18,51 +15,37 @@ runs:
1815
using: "composite"
1916
steps:
2017
# Downloads the artifacts built in `create-source-binary`
18+
# - the archives contain both the stacks-node and stacks-signer binaries
2119
- name: Download Artifacts
2220
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
2321
with:
24-
pattern: "${{ github.sha }}-${{ inputs.release_type }}*"
22+
pattern: "${{ github.sha }}-stacks-core*"
2523
path: release
2624
merge-multiple: true
2725

2826
# Generate a checksums file to be added to the release page
2927
- name: Generate Checksums
3028
uses: ./.github/actions/release/generate-checksum
3129
with:
32-
artifact_download_pattern: "${{ github.sha }}-${{ inputs.release_type }}*"
30+
artifact_download_pattern: "${{ github.sha }}-stacks-core*"
3331

34-
# Generate the release body from the template and changelog
32+
# Generate the release body from the template and changelogs
3533
- name: Draft Release Body
3634
id: draft
3735
shell: bash
3836
env:
39-
RELEASE_TYPE: ${{ inputs.release_type }}
37+
VERSION: ${{ inputs.tag }}
38+
CHANGELOG: CHANGELOG.md
39+
SIGNER_CHANGELOG: stacks-signer/CHANGELOG.md
4040
TEMPLATE: .github/actions/release/create-github-release/release.template
4141
REPO: ${{ github.repository }}
4242
DIGEST_MANIFEST: ${{ inputs.digest_manifest }}
43-
run: |
44-
# Strip "signer-" prefix from tag if present so VERSION is always bare
45-
VERSION="${{ inputs.tag }}"
46-
VERSION="${VERSION#signer-}"
47-
48-
if [[ "${RELEASE_TYPE}" == "stacks-signer" ]]; then
49-
CHANGELOG="stacks-signer/CHANGELOG.md"
50-
else
51-
CHANGELOG="CHANGELOG.md"
52-
fi
53-
54-
VERSION="${VERSION}" \
55-
CHANGELOG="${CHANGELOG}" \
56-
TEMPLATE="${TEMPLATE}" \
57-
RELEASE_TYPE="${RELEASE_TYPE}" \
58-
REPO="${REPO}" \
59-
DIGEST_MANIFEST="${DIGEST_MANIFEST}" \
60-
bash ./.github/scripts/draft_release.sh
43+
run: bash ./.github/scripts/draft_release.sh
6144

6245
# Upload the release archives with the checksums file
6346
# - pre-populate the release body text
6447
- name: Upload Release
65-
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
48+
uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1
6649
with:
6750
name: "Release ${{ inputs.tag }}"
6851
tag_name: ${{ inputs.tag }}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
This release contains bugfixes and improvements to the stacks-node and stacks-signer binaries, ensuring more consistent block production.
22
This release is compatible with chainstate directories from ${node_epoch}.
33

4-
${companion_line}
5-
6-
This release is recommended for all Stacks node operators.
4+
This release is recommended for all Stacks node and signer operators.
75

86
${changelog_section}
97

8+
${signer_changelog_section}
9+
1010
${docker_pulls_with_digests}

.github/scripts/check_release.sh

Lines changed: 40 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
#!/usr/bin/env bash
22

3-
# Checks whether the current branch name matches a release pattern and, if so,
4-
# derives the release tags and validates them against versions.toml.
3+
# Checks whether the current branch name matches the release pattern and, if so,
4+
# derives the release tag and validates it against versions.toml.
5+
#
6+
# The node and signer share a single version (see versions.toml) and are
7+
# released together: a single `release/x.x.x` branch produces one combined
8+
# GitHub release containing both the stacks-core and stacks-signer
9+
# artifacts/images at that version.
510
#
611
# Required env vars:
7-
# BRANCH - branch name from github.ref_name (e.g. release/1.0.0.0.0)
12+
# BRANCH - branch name from github.ref_name (e.g. release/4.0.0)
813
#
914
# Exit behaviour:
10-
# - Branch matches a release pattern → validates versions.toml, writes outputs, exits 0
11-
# - Branch does not match → exits 0 (all outputs empty/false; downstream
12-
# jobs guard themselves with is_node/signer_release checks)
15+
# - Branch matches the release pattern → validates versions.toml, writes outputs, exits 0
16+
# - Branch does not match → exits 0 (all outputs empty/false; downstream
17+
# jobs guard themselves with is_release checks)
1318
# Outputs:
1419
# GITHUB_OUTPUT - Path to the GitHub Actions output file (set by runner); prints to stderr if unset (via logging.sh)
15-
# node_tag - node release tag (e.g. 1.0.0.0.0) empty for signer-only releases
16-
# signer_tag - signer release tag (e.g. signer-1.0.0.0.0.0)
17-
# is_node_release - "true" if this is a node release branch
18-
# is_signer_release - "true" if this is a signer release branch
20+
# tag - release tag (e.g. 4.0.0)
21+
# is_release - "true" if this is a release branch
1922
set -euo pipefail
2023

2124
# Load logging functions from logging.sh for color and standardized output
@@ -25,56 +28,36 @@ source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/logging.sh"
2528
## ── Validate required inputs ────────────────────────────────────────────────
2629
: "${BRANCH:?BRANCH is required}"
2730

28-
## ── Release branch patterns ─────────────────────────────────────────────────
29-
# Node release: release/x.x.x.x.x (5-part version, optional -rcN suffix)
30-
# Signer release: release/signer-x.x.x.x.x.x (6-part version, optional -rcN suffix)
31+
## ── Release branch pattern ──────────────────────────────────────────────────
32+
# Release: release/x.x.x (3-part version, major.minor.revision, optional -rcN suffix)
3133
versions_file="versions.toml"
32-
node_key="stacks_node_version"
33-
signer_key="stacks_signer_version"
34+
version_key="stacks_node_version"
3435

35-
node_version_regex="([0-9]+\.){4}[0-9]+(-rc[0-9]+)?"
36-
signer_version_regex="([0-9]+\.){5}[0-9]+(-rc[0-9]+)?"
36+
version_regex="([0-9]+\.){2}[0-9]+(-rc[0-9]+)?"
3737

3838
release_prefix="release/"
39-
signer_prefix="release/signer-"
40-
41-
node_release_regex="^${release_prefix}${node_version_regex}$"
42-
signer_release_regex="^${signer_prefix}${signer_version_regex}$"
39+
release_regex="^${release_prefix}${version_regex}$"
4340

4441
## ── Initialise output variables ─────────────────────────────────────────────
45-
node_tag=""
46-
signer_tag=""
47-
is_node_release=false
48-
is_signer_release=false
42+
tag=""
43+
is_release=false
4944

50-
## ── Match branch against release patterns -----------------------------------
51-
# Signer must be tested first — its prefix (release/signer-) is a superset of
52-
# the node prefix (release/), so a signer branch would also match the node regex.
53-
if [[ "${BRANCH}" =~ ${signer_release_regex} ]]; then
54-
signer_tag=$(echo "${BRANCH}" | sed "s|^${signer_prefix}||")
55-
is_signer_release=true
56-
elif [[ "${BRANCH}" =~ ${node_release_regex} ]]; then
57-
node_tag=$(echo "${BRANCH}" | sed "s|^${release_prefix}||")
58-
## Derive the signer tag by appending an extra .0 version component
59-
signer_tag=$(echo "${node_tag}" | sed 's/\(-[^-]*\)*$/.0\1/')
60-
is_node_release=true
61-
is_signer_release=true
45+
## ── Match branch against the release pattern ────────────────────────────────
46+
if [[ "${BRANCH}" =~ ${release_regex} ]]; then
47+
tag=$(echo "${BRANCH}" | sed "s|^${release_prefix}||")
48+
is_release=true
6249
else
6350
# Not a release branch — write empty/false outputs and exit cleanly so that
64-
# downstream jobs can evaluate their own is_node/signer_release conditions.
51+
# downstream jobs can evaluate their own is_release conditions.
6552
warn "Branch $(hl "${BRANCH}") does not match a release pattern. Skipping."
6653
if [[ -n "${GITHUB_OUTPUT:-}" ]]; then
6754
{
68-
echo "node_tag="
69-
echo "signer_tag="
70-
echo "is_node_release=false"
71-
echo "is_signer_release=false"
55+
echo "tag="
56+
echo "is_release=false"
7257
} >> "${GITHUB_OUTPUT}"
7358
else
74-
info "node_tag="
75-
info "signer_tag="
76-
info "is_node_release=false"
77-
info "is_signer_release=false"
59+
info "tag="
60+
info "is_release=false"
7861
fi
7962
exit 0
8063
fi
@@ -85,45 +68,28 @@ if [[ ! -f "${versions_file}" ]]; then
8568
exit 1
8669
fi
8770

88-
node_version=$(grep "^${node_key}" "${versions_file}" | sed -E 's/.*=[[:space:]]*"([^"]+)"/\1/')
89-
signer_version=$(grep "^${signer_key}" "${versions_file}" | sed -E 's/.*=[[:space:]]*"([^"]+)"/\1/')
90-
91-
if [[ -z "${node_version}" ]]; then
92-
error "$(hl "${node_key}") not found in $(hl "${versions_file}")"
93-
exit 1
94-
fi
95-
96-
if [[ -z "${signer_version}" ]]; then
97-
error "$(hl "${signer_key}") not found in $(hl "${versions_file}")"
98-
exit 1
99-
fi
71+
version=$(grep "^${version_key}" "${versions_file}" | sed -E 's/.*=[[:space:]]*"([^"]+)"/\1/')
10072

101-
if [[ "${is_node_release}" == "true" && "${node_version}" != "${node_tag}" ]]; then
102-
error "node version in $(hl "${versions_file}") ($(hl "${node_version}")) does not match branch tag ($(hl "${node_tag}"))"
73+
if [[ -z "${version}" ]]; then
74+
error "$(hl "${version_key}") not found in $(hl "${versions_file}")"
10375
exit 1
10476
fi
10577

106-
if [[ "${signer_version}" != "${signer_tag}" ]]; then
107-
error "signer version in $(hl "${versions_file}") ($(hl "${signer_version}")) does not match branch tag ($(hl "${signer_tag}"))"
78+
if [[ "${version}" != "${tag}" ]]; then
79+
error "version in $(hl "${versions_file}") ($(hl "${version}")) does not match branch tag ($(hl "${tag}"))"
10880
exit 1
10981
fi
11082

111-
info "Node version: $(hl "${node_version}")"
112-
info "Signer version: $(hl "${signer_version}")"
113-
info "Is node release: $(hl "${is_node_release}")"
114-
info "Is signer release:$(hl "${is_signer_release}")"
83+
info "Version: $(hl "${version}")"
84+
info "Is release: $(hl "${is_release}")"
11585

11686
## ── Write outputs ───────────────────────────────────────────────────────────
11787
if [[ -n "${GITHUB_OUTPUT:-}" ]]; then
11888
{
119-
echo "node_tag=${node_tag}"
120-
echo "signer_tag=${signer_tag}"
121-
echo "is_node_release=${is_node_release}"
122-
echo "is_signer_release=${is_signer_release}"
89+
echo "tag=${tag}"
90+
echo "is_release=${is_release}"
12391
} >> "${GITHUB_OUTPUT}"
12492
else
125-
info "node_tag=${node_tag}"
126-
info "signer_tag=${signer_tag}"
127-
info "is_node_release=${is_node_release}"
128-
info "is_signer_release=${is_signer_release}"
93+
info "tag=${tag}"
94+
info "is_release=${is_release}"
12995
fi

0 commit comments

Comments
 (0)