genlayer 0.39.2 → 0.40.0-clarke.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/scripts/validate-branch-policy.sh +107 -0
- package/.github/workflows/branch-policy.yml +24 -0
- package/.github/workflows/fast-forward-main.yaml +57 -0
- package/.github/workflows/npm-dist-tag.yml +81 -0
- package/.github/workflows/publish.yml +49 -4
- package/.github/workflows/retarget-main-prs.yaml +53 -0
- package/.github/workflows/smoke.yml +3 -1
- package/.github/workflows/sync-docs.yml +0 -24
- package/.github/workflows/validate-code.yml +6 -1
- package/CHANGELOG.md +24 -2
- package/CONTRIBUTING.md +6 -14
- package/README.md +48 -11
- package/dist/index.js +4572 -350
- package/docs/BRANCHING.md +58 -0
- package/docs/api-references/_meta.json +6 -1
- package/docs/api-references/accounts/account/send.mdx +1 -1
- package/docs/api-references/configuration/network/add.mdx +32 -0
- package/docs/api-references/configuration/network/remove.mdx +21 -0
- package/docs/api-references/configuration/network.mdx +3 -1
- package/docs/api-references/contracts/call.mdx +1 -0
- package/docs/api-references/contracts/deploy.mdx +7 -0
- package/docs/api-references/contracts/write.mdx +7 -0
- package/docs/api-references/estimate-fees.mdx +29 -0
- package/docs/api-references/finalize-batch.mdx +20 -0
- package/docs/api-references/finalize.mdx +20 -0
- package/docs/api-references/index.mdx +5 -1
- package/docs/api-references/localnet/localnet/validators/create-random.mdx +3 -1
- package/docs/api-references/staking/staking/active-validators.mdx +1 -1
- package/docs/api-references/staking/staking/banned-validators.mdx +1 -1
- package/docs/api-references/staking/staking/delegation-info.mdx +1 -1
- package/docs/api-references/staking/staking/delegator-claim.mdx +1 -1
- package/docs/api-references/staking/staking/delegator-exit.mdx +1 -1
- package/docs/api-references/staking/staking/delegator-join.mdx +1 -1
- package/docs/api-references/staking/staking/epoch-info.mdx +1 -1
- package/docs/api-references/staking/staking/prime-all.mdx +1 -1
- package/docs/api-references/staking/staking/quarantined-validators.mdx +1 -1
- package/docs/api-references/staking/staking/set-identity.mdx +1 -1
- package/docs/api-references/staking/staking/set-operator.mdx +1 -1
- package/docs/api-references/staking/staking/validator-claim.mdx +1 -1
- package/docs/api-references/staking/staking/validator-deposit.mdx +1 -1
- package/docs/api-references/staking/staking/validator-exit.mdx +1 -1
- package/docs/api-references/staking/staking/validator-history.mdx +1 -1
- package/docs/api-references/staking/staking/validator-info.mdx +1 -1
- package/docs/api-references/staking/staking/validator-join.mdx +1 -1
- package/docs/api-references/staking/staking/validator-prime.mdx +1 -1
- package/docs/api-references/staking/staking/validators.mdx +5 -2
- package/docs/api-references/staking/staking.mdx +1 -1
- package/docs/api-references/transactions/receipt.mdx +1 -1
- package/docs/api-references/vesting/claim.mdx +27 -0
- package/docs/api-references/vesting/delegate.mdx +28 -0
- package/docs/api-references/vesting/list.mdx +21 -0
- package/docs/api-references/vesting/undelegate.mdx +27 -0
- package/docs/api-references/vesting/validator/claim.mdx +27 -0
- package/docs/api-references/vesting/validator/create.mdx +28 -0
- package/docs/api-references/vesting/validator/deposit.mdx +28 -0
- package/docs/api-references/vesting/validator/exit.mdx +28 -0
- package/docs/api-references/vesting/validator/join.mdx +28 -0
- package/docs/api-references/vesting/validator/list.mdx +22 -0
- package/docs/api-references/vesting/validator/operator-transfer/cancel.mdx +27 -0
- package/docs/api-references/vesting/validator/operator-transfer/complete.mdx +27 -0
- package/docs/api-references/vesting/validator/operator-transfer/initiate.mdx +29 -0
- package/docs/api-references/vesting/validator/operator-transfer.mdx +25 -0
- package/docs/api-references/vesting/validator/set-identity.mdx +36 -0
- package/docs/api-references/vesting/validator/status.mdx +22 -0
- package/docs/api-references/vesting/validator.mdx +31 -0
- package/docs/api-references/vesting/withdraw.mdx +23 -0
- package/docs/api-references/vesting.mdx +28 -0
- package/package.json +9 -6
- package/scripts/generate-cli-docs.mjs +10 -2
- package/scripts/run-esbuild.mjs +12 -0
- package/src/commands/account/index.ts +1 -1
- package/src/commands/account/send.ts +3 -7
- package/src/commands/account/show.ts +1 -1
- package/src/commands/contracts/deploy.ts +20 -6
- package/src/commands/contracts/estimateFees.ts +24 -15
- package/src/commands/contracts/execution.ts +145 -0
- package/src/commands/contracts/fees.ts +212 -58
- package/src/commands/contracts/index.ts +29 -23
- package/src/commands/contracts/write.ts +31 -10
- package/src/commands/network/index.ts +25 -0
- package/src/commands/network/setNetwork.ts +238 -28
- package/src/commands/staking/StakingAction.ts +8 -7
- package/src/commands/staking/index.ts +28 -23
- package/src/commands/staking/validatorHistory.ts +34 -12
- package/src/commands/staking/validators.ts +619 -0
- package/src/commands/staking/wizard.ts +4 -6
- package/src/commands/vesting/VestingAction.ts +155 -0
- package/src/commands/vesting/claim.ts +40 -0
- package/src/commands/vesting/delegate.ts +45 -0
- package/src/commands/vesting/index.ts +280 -0
- package/src/commands/vesting/list.ts +157 -0
- package/src/commands/vesting/undelegate.ts +53 -0
- package/src/commands/vesting/validatorClaim.ts +40 -0
- package/src/commands/vesting/validatorCreate.ts +57 -0
- package/src/commands/vesting/validatorDeposit.ts +44 -0
- package/src/commands/vesting/validatorExit.ts +53 -0
- package/src/commands/vesting/validatorList.ts +93 -0
- package/src/commands/vesting/validatorOperatorTransfer.ts +116 -0
- package/src/commands/vesting/validatorSetIdentity.ts +70 -0
- package/src/commands/vesting/vestingTypes.ts +156 -0
- package/src/commands/vesting/withdraw.ts +41 -0
- package/src/index.ts +2 -0
- package/src/lib/actions/BaseAction.ts +22 -3
- package/src/lib/config/simulator.ts +3 -3
- package/src/lib/networks/customNetworks.ts +253 -0
- package/support/ci/ACTIVE_DEV_BRANCH +1 -0
- package/tests/actions/customNetworkProfiles.test.ts +297 -0
- package/tests/actions/deploy.test.ts +230 -6
- package/tests/actions/estimateFees.test.ts +159 -16
- package/tests/actions/write.test.ts +249 -24
- package/tests/commands/deploy.test.ts +34 -14
- package/tests/commands/estimateFees.test.ts +27 -15
- package/tests/commands/network.test.ts +56 -0
- package/tests/commands/staking.test.ts +31 -0
- package/tests/commands/stakingValidators.test.ts +197 -0
- package/tests/commands/vesting.test.ts +493 -0
- package/tests/commands/write.test.ts +25 -0
- package/tests/index.test.ts +4 -0
- package/tests/services/simulator.test.ts +15 -0
- package/tests/smoke.test.ts +13 -8
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
failed=0
|
|
5
|
+
|
|
6
|
+
error() {
|
|
7
|
+
echo "::error::$*"
|
|
8
|
+
failed=1
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
warning() {
|
|
12
|
+
echo "::warning::$*"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
active_branch_file="support/ci/ACTIVE_DEV_BRANCH"
|
|
16
|
+
if [[ ! -f "${active_branch_file}" ]]; then
|
|
17
|
+
error "${active_branch_file} is required."
|
|
18
|
+
active_branch=""
|
|
19
|
+
else
|
|
20
|
+
active_branch="$(tr -d '[:space:]' < "${active_branch_file}")"
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
if [[ -z "${active_branch}" ]]; then
|
|
24
|
+
error "${active_branch_file} must not be empty."
|
|
25
|
+
elif [[ "${active_branch}" == "main" ]]; then
|
|
26
|
+
error "${active_branch_file} must point to a dev branch, not main."
|
|
27
|
+
elif [[ "${active_branch}" != *-dev ]]; then
|
|
28
|
+
warning "${active_branch_file} should normally point to a -dev branch; got ${active_branch}."
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
release_branch="${active_branch%-dev}"
|
|
32
|
+
default_branch="${GITHUB_DEFAULT_BRANCH:-}"
|
|
33
|
+
event_name="${GITHUB_EVENT_NAME:-local}"
|
|
34
|
+
base_ref="${GITHUB_BASE_REF:-}"
|
|
35
|
+
head_ref="${GITHUB_HEAD_REF:-}"
|
|
36
|
+
ref_name="${GITHUB_REF_NAME:-}"
|
|
37
|
+
actor="${GITHUB_ACTOR:-}"
|
|
38
|
+
|
|
39
|
+
if [[ -n "${default_branch}" && "${default_branch}" != "main" ]]; then
|
|
40
|
+
warning "Repository default branch should be main after branch-policy rollout; currently ${default_branch}."
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
if [[ -n "${base_ref}" && "${base_ref}" == "main" ]]; then
|
|
44
|
+
warning "PR targets main; retarget-main-prs should move it to ${active_branch}."
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
if [[ -n "${base_ref}" && -n "${active_branch}" ]]; then
|
|
48
|
+
if [[ "${base_ref}" == "${release_branch}" && "${head_ref}" != "${active_branch}" && "${ALLOW_DIRECT_RELEASE_PR:-false}" != "true" ]]; then
|
|
49
|
+
error "PRs into ${release_branch} must come from ${active_branch}. Merge feature work into ${active_branch}, then promote ${active_branch} -> ${release_branch}."
|
|
50
|
+
fi
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
if [[ "${event_name}" == "push" && "${ref_name}" == "main" ]]; then
|
|
54
|
+
case "${actor}" in
|
|
55
|
+
github-actions[bot]|ci-core-e2e-runner[bot])
|
|
56
|
+
;;
|
|
57
|
+
*)
|
|
58
|
+
error "main should only move by automation from ${active_branch}; direct push actor was ${actor:-unknown}."
|
|
59
|
+
;;
|
|
60
|
+
esac
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
if [[ ! -f ".github/workflows/fast-forward-main.yaml" ]]; then
|
|
64
|
+
error ".github/workflows/fast-forward-main.yaml is required."
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
if [[ ! -f ".github/workflows/retarget-main-prs.yaml" ]]; then
|
|
68
|
+
error ".github/workflows/retarget-main-prs.yaml is required."
|
|
69
|
+
fi
|
|
70
|
+
|
|
71
|
+
if [[ -f ".github/workflows/release-from-main.yml" ]]; then
|
|
72
|
+
error ".github/workflows/release-from-main.yml is forbidden. Releases must be tag/version-branch driven."
|
|
73
|
+
fi
|
|
74
|
+
|
|
75
|
+
if [[ -f "release.config.js" ]]; then
|
|
76
|
+
error "release.config.js is forbidden in versioned tooling branches; semantic-release-on-main must not be restored."
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
if [[ -f ".github/workflows/release-from-tag.yml" ]]; then
|
|
80
|
+
if ! grep -Fq 'v*.*.*' .github/workflows/release-from-tag.yml; then
|
|
81
|
+
error "release-from-tag.yml must trigger only from version tags matching v*.*.*."
|
|
82
|
+
fi
|
|
83
|
+
if ! grep -Fq 'refs/remotes/origin/${version_branch}' .github/workflows/release-from-tag.yml || \
|
|
84
|
+
! grep -Fq 'tag_commit' .github/workflows/release-from-tag.yml || \
|
|
85
|
+
! grep -Fq 'branch_head' .github/workflows/release-from-tag.yml; then
|
|
86
|
+
error "release-from-tag.yml must verify the tag commit is the current matching version branch head."
|
|
87
|
+
fi
|
|
88
|
+
fi
|
|
89
|
+
|
|
90
|
+
if [[ -f ".github/workflows/manual-docker-release.yml" ]]; then
|
|
91
|
+
if ! grep -Fq 'expected_branch=' .github/workflows/manual-docker-release.yml; then
|
|
92
|
+
error "manual-docker-release.yml must derive and enforce the expected version branch from the tag."
|
|
93
|
+
fi
|
|
94
|
+
if ! grep -Fq './.github/workflows/release-from-tag.yml' .github/workflows/manual-docker-release.yml; then
|
|
95
|
+
error "manual-docker-release.yml must delegate image promotion to release-from-tag.yml."
|
|
96
|
+
fi
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
if [[ "${failed}" -ne 0 ]]; then
|
|
100
|
+
exit 1
|
|
101
|
+
fi
|
|
102
|
+
|
|
103
|
+
if [[ -n "${base_ref}" ]]; then
|
|
104
|
+
echo "Branch policy ok for PR ${head_ref} -> ${base_ref}; active dev branch is ${active_branch}."
|
|
105
|
+
else
|
|
106
|
+
echo "Branch policy ok for ${event_name} on ${ref_name:-detached ref}; active dev branch is ${active_branch}."
|
|
107
|
+
fi
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: Branch Policy
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize, reopened, edited, ready_for_review]
|
|
6
|
+
push:
|
|
7
|
+
branches:
|
|
8
|
+
- "**"
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
branch-policy:
|
|
16
|
+
name: Validate branch policy
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Validate branch policy
|
|
22
|
+
env:
|
|
23
|
+
GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
|
|
24
|
+
run: ./.github/scripts/validate-branch-policy.sh
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
name: Fast-forward main
|
|
2
|
+
|
|
3
|
+
# main is the static/default branch for GitHub UX and tools that assume a
|
|
4
|
+
# stable default branch. It is not the integration target. On each push to the
|
|
5
|
+
# configured active dev branch, fast-forward main to that commit.
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
branches: ["**"]
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: write
|
|
14
|
+
|
|
15
|
+
concurrency:
|
|
16
|
+
group: fast-forward-main-${{ github.repository }}
|
|
17
|
+
cancel-in-progress: false
|
|
18
|
+
|
|
19
|
+
defaults:
|
|
20
|
+
run:
|
|
21
|
+
shell: bash
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
fast-forward:
|
|
25
|
+
if: github.ref_type == 'branch'
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v4
|
|
29
|
+
with:
|
|
30
|
+
fetch-depth: 0
|
|
31
|
+
|
|
32
|
+
- name: Fast-forward main to active dev branch
|
|
33
|
+
run: |
|
|
34
|
+
set -euo pipefail
|
|
35
|
+
|
|
36
|
+
active_branch="$(tr -d '[:space:]' < support/ci/ACTIVE_DEV_BRANCH)"
|
|
37
|
+
if [[ -z "${active_branch}" || "${active_branch}" == "main" ]]; then
|
|
38
|
+
echo "::error::support/ci/ACTIVE_DEV_BRANCH must name a non-main dev branch"
|
|
39
|
+
exit 1
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
if [[ "${GITHUB_REF_NAME}" != "${active_branch}" ]]; then
|
|
43
|
+
echo "Push was to ${GITHUB_REF_NAME}; active dev branch is ${active_branch}. Nothing to do."
|
|
44
|
+
exit 0
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
if git ls-remote --exit-code --heads origin main >/dev/null 2>&1; then
|
|
48
|
+
git fetch origin main
|
|
49
|
+
if ! git merge-base --is-ancestor origin/main HEAD; then
|
|
50
|
+
echo "::error::main has diverged from ${active_branch}; refusing non-fast-forward update"
|
|
51
|
+
exit 1
|
|
52
|
+
fi
|
|
53
|
+
else
|
|
54
|
+
echo "main does not exist yet; creating it at ${GITHUB_SHA}."
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
git push origin "HEAD:refs/heads/main"
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
name: Manage npm dist-tag
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
package_version:
|
|
7
|
+
description: "Published genlayer version to point the dist-tag at, e.g. 0.40.0-rc2"
|
|
8
|
+
required: true
|
|
9
|
+
type: string
|
|
10
|
+
dist_tag:
|
|
11
|
+
description: "npm dist-tag to set, e.g. clarke"
|
|
12
|
+
required: true
|
|
13
|
+
type: string
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
set-dist-tag:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
environment: Publish
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/setup-node@v4
|
|
24
|
+
with:
|
|
25
|
+
node-version: "24"
|
|
26
|
+
registry-url: "https://registry.npmjs.org"
|
|
27
|
+
|
|
28
|
+
- name: Validate inputs
|
|
29
|
+
env:
|
|
30
|
+
PACKAGE_VERSION: ${{ inputs.package_version }}
|
|
31
|
+
DIST_TAG: ${{ inputs.dist_tag }}
|
|
32
|
+
run: |
|
|
33
|
+
set -euo pipefail
|
|
34
|
+
|
|
35
|
+
PACKAGE_VERSION="${PACKAGE_VERSION#v}"
|
|
36
|
+
|
|
37
|
+
if [[ ! "$PACKAGE_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z._-]+)?(\+[0-9A-Za-z._-]+)?$ ]]; then
|
|
38
|
+
echo "Invalid package_version: $PACKAGE_VERSION" >&2
|
|
39
|
+
exit 1
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
if [[ ! "$DIST_TAG" =~ ^[A-Za-z][A-Za-z0-9._-]*$ ]]; then
|
|
43
|
+
echo "Invalid dist_tag: $DIST_TAG" >&2
|
|
44
|
+
exit 1
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
if [ "$DIST_TAG" = "latest" ]; then
|
|
48
|
+
echo "This workflow intentionally refuses to move latest." >&2
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
if [[ "$DIST_TAG" =~ ^v?[0-9] ]]; then
|
|
53
|
+
echo "Invalid dist_tag '$DIST_TAG': dist-tags must not look like versions." >&2
|
|
54
|
+
exit 1
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
PUBLISHED_VERSION="$(npm view "genlayer@$PACKAGE_VERSION" version)"
|
|
58
|
+
if [ "$PUBLISHED_VERSION" != "$PACKAGE_VERSION" ]; then
|
|
59
|
+
echo "Published package mismatch: requested $PACKAGE_VERSION, npm returned $PUBLISHED_VERSION" >&2
|
|
60
|
+
exit 1
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
{
|
|
64
|
+
echo "package_version=$PACKAGE_VERSION"
|
|
65
|
+
echo "dist_tag=$DIST_TAG"
|
|
66
|
+
} >> "$GITHUB_ENV"
|
|
67
|
+
|
|
68
|
+
- name: Set npm dist-tag
|
|
69
|
+
run: npm dist-tag add "genlayer@$package_version" "$dist_tag"
|
|
70
|
+
env:
|
|
71
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN || secrets.NPM_TOKEN }}
|
|
72
|
+
|
|
73
|
+
- name: Verify npm dist-tag
|
|
74
|
+
run: |
|
|
75
|
+
set -euo pipefail
|
|
76
|
+
ACTUAL_VERSION="$(npm view "genlayer@$dist_tag" version)"
|
|
77
|
+
if [ "$ACTUAL_VERSION" != "$package_version" ]; then
|
|
78
|
+
echo "dist-tag $dist_tag points at $ACTUAL_VERSION, expected $package_version" >&2
|
|
79
|
+
exit 1
|
|
80
|
+
fi
|
|
81
|
+
echo "genlayer@$dist_tag -> $ACTUAL_VERSION"
|
|
@@ -7,6 +7,11 @@ name: Publish Package to NPM
|
|
|
7
7
|
# workflow fires on the tag push, sanity-checks the tag matches
|
|
8
8
|
# package.json, builds, publishes to npm, and creates the GitHub
|
|
9
9
|
# Release. It never bumps or tags by itself.
|
|
10
|
+
#
|
|
11
|
+
# Stable tags such as v0.39.2 publish to npm's latest dist-tag.
|
|
12
|
+
# Prerelease tags such as v0.40.0-clarke.1 publish to a matching
|
|
13
|
+
# channel dist-tag (clarke) and create a GitHub prerelease.
|
|
14
|
+
# Prereleases must never become latest.
|
|
10
15
|
on:
|
|
11
16
|
workflow_dispatch:
|
|
12
17
|
push:
|
|
@@ -32,8 +37,14 @@ jobs:
|
|
|
32
37
|
|
|
33
38
|
- run: npm ci
|
|
34
39
|
|
|
35
|
-
- name: Verify tag
|
|
40
|
+
- name: Verify tag and resolve npm dist-tag
|
|
41
|
+
id: version
|
|
36
42
|
run: |
|
|
43
|
+
if [ "${GITHUB_REF_TYPE:-}" != "tag" ]; then
|
|
44
|
+
echo "Publish must run from a git tag. Current ref type: ${GITHUB_REF_TYPE:-unknown}" >&2
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
|
|
37
48
|
TAG_VERSION="${GITHUB_REF_NAME#v}"
|
|
38
49
|
PKG_VERSION="$(node -p "require('./package.json').version")"
|
|
39
50
|
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
|
|
@@ -41,14 +52,37 @@ jobs:
|
|
|
41
52
|
echo "Re-cut the release via scripts/release.sh so the tag and the committed version match." >&2
|
|
42
53
|
exit 1
|
|
43
54
|
fi
|
|
55
|
+
|
|
56
|
+
IS_PRERELEASE=false
|
|
57
|
+
NPM_DIST_TAG=latest
|
|
58
|
+
if [[ "$TAG_VERSION" == *-* ]]; then
|
|
59
|
+
IS_PRERELEASE=true
|
|
60
|
+
PRERELEASE_SUFFIX="${TAG_VERSION#*-}"
|
|
61
|
+
PRERELEASE_SUFFIX="${PRERELEASE_SUFFIX%%+*}"
|
|
62
|
+
NPM_DIST_TAG="${PRERELEASE_SUFFIX%%.*}"
|
|
63
|
+
|
|
64
|
+
if [ -z "$NPM_DIST_TAG" ] || [ "$NPM_DIST_TAG" = "latest" ]; then
|
|
65
|
+
echo "Invalid prerelease npm dist-tag: '$NPM_DIST_TAG'" >&2
|
|
66
|
+
exit 1
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
if [[ "$NPM_DIST_TAG" =~ ^v?[0-9] ]]; then
|
|
70
|
+
echo "Invalid prerelease npm dist-tag '$NPM_DIST_TAG': dist-tags must not look like versions." >&2
|
|
71
|
+
exit 1
|
|
72
|
+
fi
|
|
73
|
+
fi
|
|
74
|
+
|
|
44
75
|
echo "Tag $GITHUB_REF_NAME matches package.json $PKG_VERSION."
|
|
76
|
+
echo "npm dist-tag: $NPM_DIST_TAG"
|
|
77
|
+
echo "is_prerelease=$IS_PRERELEASE" >> "$GITHUB_OUTPUT"
|
|
78
|
+
echo "npm_dist_tag=$NPM_DIST_TAG" >> "$GITHUB_OUTPUT"
|
|
45
79
|
|
|
46
80
|
- run: npm run build
|
|
47
81
|
|
|
48
82
|
- name: Publish to npm
|
|
49
|
-
run: npm publish --provenance --access public
|
|
83
|
+
run: npm publish --provenance --access public --tag "${{ steps.version.outputs.npm_dist_tag }}"
|
|
50
84
|
env:
|
|
51
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
85
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN || secrets.NPM_TOKEN }}
|
|
52
86
|
|
|
53
87
|
- name: Create GitHub Release
|
|
54
88
|
env:
|
|
@@ -62,6 +96,17 @@ jobs:
|
|
|
62
96
|
if [ -z "$NOTES" ]; then
|
|
63
97
|
NOTES="Release $GITHUB_REF_NAME"
|
|
64
98
|
fi
|
|
99
|
+
|
|
100
|
+
NOTES="$NOTES
|
|
101
|
+
|
|
102
|
+
npm install -g genlayer@${{ steps.version.outputs.npm_dist_tag }}"
|
|
103
|
+
|
|
104
|
+
RELEASE_FLAGS=()
|
|
105
|
+
if [ "${{ steps.version.outputs.is_prerelease }}" = "true" ]; then
|
|
106
|
+
RELEASE_FLAGS+=(--prerelease)
|
|
107
|
+
fi
|
|
108
|
+
|
|
65
109
|
gh release create "$GITHUB_REF_NAME" \
|
|
66
110
|
--title "$GITHUB_REF_NAME" \
|
|
67
|
-
--notes "$NOTES"
|
|
111
|
+
--notes "$NOTES" \
|
|
112
|
+
"${RELEASE_FLAGS[@]}"
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
name: Retarget main PRs
|
|
2
|
+
|
|
3
|
+
# main is a static/default alias of the active dev branch. Contributions should
|
|
4
|
+
# target the active dev branch directly; PRs opened against main are retargeted
|
|
5
|
+
# automatically so required checks and release-train rules run in the right
|
|
6
|
+
# branch context.
|
|
7
|
+
#
|
|
8
|
+
# pull_request_target is used for the write-scoped token. This workflow never
|
|
9
|
+
# checks out or executes PR head code; it reads only trusted base-branch files.
|
|
10
|
+
|
|
11
|
+
on:
|
|
12
|
+
pull_request_target:
|
|
13
|
+
types: [opened, reopened, synchronize, edited, ready_for_review]
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
pull-requests: write
|
|
18
|
+
issues: write
|
|
19
|
+
|
|
20
|
+
defaults:
|
|
21
|
+
run:
|
|
22
|
+
shell: bash
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
retarget:
|
|
26
|
+
if: github.event.pull_request.base.ref == 'main'
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v4
|
|
30
|
+
with:
|
|
31
|
+
ref: ${{ github.event.pull_request.base.ref }}
|
|
32
|
+
|
|
33
|
+
- name: Retarget PR to active dev branch
|
|
34
|
+
env:
|
|
35
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
36
|
+
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
37
|
+
run: |
|
|
38
|
+
set -euo pipefail
|
|
39
|
+
|
|
40
|
+
active_branch="$(tr -d '[:space:]' < support/ci/ACTIVE_DEV_BRANCH)"
|
|
41
|
+
if [[ -z "${active_branch}" || "${active_branch}" == "main" ]]; then
|
|
42
|
+
echo "::error::support/ci/ACTIVE_DEV_BRANCH must name a non-main dev branch"
|
|
43
|
+
exit 1
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
gh pr edit "${PR_NUMBER}" --repo "${GITHUB_REPOSITORY}" --base "${active_branch}"
|
|
47
|
+
|
|
48
|
+
gh pr comment "${PR_NUMBER}" --repo "${GITHUB_REPOSITORY}" --body "$(cat <<EOF
|
|
49
|
+
This PR targeted \`main\`, which is only the default/static branch.
|
|
50
|
+
|
|
51
|
+
I retargeted it to \`${active_branch}\`, the active development branch. Pushes to \`${active_branch}\` automatically fast-forward \`main\`.
|
|
52
|
+
EOF
|
|
53
|
+
)"
|
|
@@ -10,7 +10,7 @@ jobs:
|
|
|
10
10
|
smoke:
|
|
11
11
|
name: Testnet Smoke Tests
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
|
-
timeout-minutes:
|
|
13
|
+
timeout-minutes: 10
|
|
14
14
|
continue-on-error: true
|
|
15
15
|
|
|
16
16
|
steps:
|
|
@@ -41,3 +41,5 @@ jobs:
|
|
|
41
41
|
|
|
42
42
|
- name: Run smoke tests
|
|
43
43
|
run: npm run test:smoke
|
|
44
|
+
env:
|
|
45
|
+
CLI_SMOKE_TIMEOUT_MS: 240000
|
|
@@ -72,30 +72,6 @@ jobs:
|
|
|
72
72
|
rsync -a "${{ github.workspace }}/docs/api-references/" pages/api-references/genlayer-cli/
|
|
73
73
|
# Copy README as sibling file (strip badges/emojis)
|
|
74
74
|
sed -E '/^\[!\[.*\]\(https:\/\/(img\.shields\.io|dcbadge|badge\.fury)/d' "${{ github.workspace }}/README.md" > pages/api-references/genlayer-cli.mdx
|
|
75
|
-
# Write _meta.json
|
|
76
|
-
cat > pages/api-references/genlayer-cli/_meta.json << 'METAEOF'
|
|
77
|
-
{
|
|
78
|
-
"init": "init",
|
|
79
|
-
"up": "up",
|
|
80
|
-
"stop": "stop",
|
|
81
|
-
"new": "new",
|
|
82
|
-
"config": "config",
|
|
83
|
-
"network": "network",
|
|
84
|
-
"deploy": "deploy",
|
|
85
|
-
"call": "call",
|
|
86
|
-
"write": "write",
|
|
87
|
-
"schema": "schema",
|
|
88
|
-
"code": "code",
|
|
89
|
-
"receipt": "receipt",
|
|
90
|
-
"trace": "trace",
|
|
91
|
-
"appeal": "appeal",
|
|
92
|
-
"appeal-bond": "appeal-bond",
|
|
93
|
-
"account": "account",
|
|
94
|
-
"staking": "staking",
|
|
95
|
-
"localnet": "localnet",
|
|
96
|
-
"update": "update"
|
|
97
|
-
}
|
|
98
|
-
METAEOF
|
|
99
75
|
if [ -z "$(git status --porcelain)" ]; then
|
|
100
76
|
echo "No changes to commit"
|
|
101
77
|
exit 0
|
|
@@ -9,6 +9,8 @@ on:
|
|
|
9
9
|
push:
|
|
10
10
|
branches:
|
|
11
11
|
- v0.39
|
|
12
|
+
- v0.40
|
|
13
|
+
- v0.40-dev
|
|
12
14
|
|
|
13
15
|
jobs:
|
|
14
16
|
build-and-test:
|
|
@@ -47,5 +49,8 @@ jobs:
|
|
|
47
49
|
with:
|
|
48
50
|
verbose: true
|
|
49
51
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
50
|
-
|
|
52
|
+
# Codecov OIDC upload has been failing on ubuntu/windows since
|
|
53
|
+
# before this PR (#345 merged with the same failures) — keep the
|
|
54
|
+
# upload best-effort so coverage flakes don't block test-green PRs.
|
|
55
|
+
fail_ci_if_error: false
|
|
51
56
|
directory: coverage
|
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.
|
|
3
|
+
## [0.40.0-clarke.1](https://github.com/genlayerlabs/genlayer-cli/compare/v0.40.0-rc2...v0.40.0-clarke.1) (2026-07-08)
|
|
4
|
+
|
|
5
|
+
## [0.40.0-rc2](https://github.com/genlayerlabs/genlayer-cli/compare/v0.40.0-rc1...v0.40.0-rc2) (2026-07-08)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* avoid git dependency in npm prerelease install ([#368](https://github.com/genlayerlabs/genlayer-cli/issues/368)) ([3cd1cac](https://github.com/genlayerlabs/genlayer-cli/commit/3cd1cac564932d67e5b1200d4396ca24556d2e46))
|
|
10
|
+
|
|
11
|
+
## [0.40.0-rc1](https://github.com/genlayerlabs/genlayer-cli/compare/v0.39.1...v0.40.0-rc1) (2026-07-08)
|
|
12
|
+
|
|
13
|
+
### ⚠ BREAKING CHANGES
|
|
14
|
+
|
|
15
|
+
* **contracts:** require consensus acceptance for success, not just the leader's execution result (#346)
|
|
4
16
|
|
|
5
17
|
### Features
|
|
6
18
|
|
|
7
19
|
* add v0.6 fee-aware commands ([#340](https://github.com/genlayerlabs/genlayer-cli/issues/340)) ([ca083ab](https://github.com/genlayerlabs/genlayer-cli/commit/ca083abbf854960a6638d5af63096b532a03cc5a))
|
|
8
20
|
* branch-per-major release model ([#311](https://github.com/genlayerlabs/genlayer-cli/issues/311)) ([6fd2f3a](https://github.com/genlayerlabs/genlayer-cli/commit/6fd2f3a678ce348c92470828b03bdfc596afa9cb)), closes [genlayer-js#172](https://github.com/genlayerlabs/genlayer-js/issues/172)
|
|
21
|
+
* **network:** custom network profiles with deployment-file import ([#362](https://github.com/genlayerlabs/genlayer-cli/issues/362)) ([185d22b](https://github.com/genlayerlabs/genlayer-cli/commit/185d22bff86884b330c2037c2875a5d1629ec72b)), closes [#1162](https://github.com/genlayerlabs/genlayer-cli/issues/1162) [#1162](https://github.com/genlayerlabs/genlayer-cli/issues/1162)
|
|
22
|
+
* staking validators discovery ([#357](https://github.com/genlayerlabs/genlayer-cli/issues/357)) ([0e76bce](https://github.com/genlayerlabs/genlayer-cli/commit/0e76bcef4524907f80d1567ad688550e24c7192b))
|
|
23
|
+
* support fee profiles in contract commands ([#355](https://github.com/genlayerlabs/genlayer-cli/issues/355)) ([6edfcfa](https://github.com/genlayerlabs/genlayer-cli/commit/6edfcfa6d1ad2fcbf761c1ed9f3a194d31243624))
|
|
24
|
+
* vesting commands ([#358](https://github.com/genlayerlabs/genlayer-cli/issues/358)) ([7bcc41e](https://github.com/genlayerlabs/genlayer-cli/commit/7bcc41e7a063bd4a628f689bdf4d321b50230aff))
|
|
9
25
|
|
|
10
26
|
### Bug Fixes
|
|
11
27
|
|
|
28
|
+
* **contracts:** require consensus acceptance for success, not just the leader's execution result ([#346](https://github.com/genlayerlabs/genlayer-cli/issues/346)) ([6fadcd7](https://github.com/genlayerlabs/genlayer-cli/commit/6fadcd7c9ef181042c823faeec1b7e7fb4d902b2)), closes [#345](https://github.com/genlayerlabs/genlayer-cli/issues/345)
|
|
29
|
+
* **docs-sync:** stop overwriting the generated root _meta.json ([#352](https://github.com/genlayerlabs/genlayer-cli/issues/352)) ([f1f1304](https://github.com/genlayerlabs/genlayer-cli/commit/f1f130461dc7d719c9f34086aeb40d8426f0602e)), closes [genlayer-docs#426](https://github.com/genlayerlabs/genlayer-docs/issues/426)
|
|
30
|
+
* drop getSlashingAddress from validator-history ([#361](https://github.com/genlayerlabs/genlayer-cli/issues/361)) ([32a0a42](https://github.com/genlayerlabs/genlayer-cli/commit/32a0a42d687a27c633a0ee29b6fbc84842c3cc18)), closes [#344](https://github.com/genlayerlabs/genlayer-cli/issues/344) [#344](https://github.com/genlayerlabs/genlayer-cli/issues/344) [#341](https://github.com/genlayerlabs/genlayer-cli/issues/341)
|
|
31
|
+
* fail CLI writes on execution errors ([#345](https://github.com/genlayerlabs/genlayer-cli/issues/345)) ([5d00884](https://github.com/genlayerlabs/genlayer-cli/commit/5d008844ad0b97760bbd025ed5aac61b41b2b881))
|
|
32
|
+
* **init:** use backend provider id "google" for Gemini ([#359](https://github.com/genlayerlabs/genlayer-cli/issues/359)) ([561370f](https://github.com/genlayerlabs/genlayer-cli/commit/561370f955f23dc2e1952daac2c42aecb3f3431c)), closes [#271](https://github.com/genlayerlabs/genlayer-cli/issues/271)
|
|
12
33
|
* **localnet:** print validator count to stdout ([37519e1](https://github.com/genlayerlabs/genlayer-cli/commit/37519e18b6155bc762fa24ea809a53c3e83ac9a7))
|
|
34
|
+
* make git install build lifecycle robust ([#363](https://github.com/genlayerlabs/genlayer-cli/issues/363)) ([a4f8a63](https://github.com/genlayerlabs/genlayer-cli/commit/a4f8a63ae9c945ecf99a707e700857d6f7729df7))
|
|
13
35
|
* run CI on v0.39 branch ([#322](https://github.com/genlayerlabs/genlayer-cli/issues/322)) ([e129bab](https://github.com/genlayerlabs/genlayer-cli/commit/e129bab0c471c2d59d360b5ca8c1cb3190774ff8))
|
|
14
|
-
* **system:**
|
|
36
|
+
* **system:** propagate command-check and version parse fixes to v0.40-dev ([#350](https://github.com/genlayerlabs/genlayer-cli/issues/350)) ([9ebf9e0](https://github.com/genlayerlabs/genlayer-cli/commit/9ebf9e0d1ab5266c58d2e8a274c0b42acc8ad753)), closes [#349](https://github.com/genlayerlabs/genlayer-cli/issues/349)
|
|
15
37
|
|
|
16
38
|
## 0.39.1 (2026-05-06)
|
|
17
39
|
|
package/CONTRIBUTING.md
CHANGED
|
@@ -33,19 +33,11 @@ Have ideas for new features or use cases? We're eager to hear them! But first:
|
|
|
33
33
|
|
|
34
34
|
## Branch model
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
When you fork or clone, the default branch is `v0.39` today. If you have a `main` branch from a previous checkout, delete it locally:
|
|
43
|
-
|
|
44
|
-
```sh
|
|
45
|
-
git checkout v0.39
|
|
46
|
-
git branch -D main
|
|
47
|
-
git remote prune origin
|
|
48
|
-
```
|
|
36
|
+
See [docs/BRANCHING.md](docs/BRANCHING.md) for the current release-train model.
|
|
37
|
+
In short: independently releasable work may target the stable branch directly;
|
|
38
|
+
multi-feature or cross-repo train work uses the active `*-dev` integration
|
|
39
|
+
branch and is promoted to the matching stable branch when ready. `main` is only
|
|
40
|
+
the default/static GitHub branch.
|
|
49
41
|
|
|
50
42
|
The previous `staging` branch (beta channel) has been retired. Pre-releases now go through the same release script with an explicit version (`scripts/release.sh 0.39.2-beta.0`).
|
|
51
43
|
|
|
@@ -138,4 +130,4 @@ Connect with the GenLayer community to discuss, collaborate, and share insights:
|
|
|
138
130
|
- **[Discord Channel](https://discord.gg/8Jm4v89VAu)**: Our primary hub for discussions, support, and announcements.
|
|
139
131
|
- **[Telegram Group](https://t.me/genlayer)**: For more informal chats and quick updates.
|
|
140
132
|
|
|
141
|
-
Your continuous feedback drives better product development. Please engage with us regularly to test, discuss, and improve the GenLayer CLI.
|
|
133
|
+
Your continuous feedback drives better product development. Please engage with us regularly to test, discuss, and improve the GenLayer CLI.
|