genlayer 0.39.1 → 0.39.2
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/.claude/skills/release/SKILL.md +89 -0
- package/.github/e2e-track +1 -0
- package/.github/workflows/e2e-housekeeper.yml +84 -0
- package/.github/workflows/e2e.yml +740 -0
- package/.github/workflows/publish.yml +42 -29
- package/.github/workflows/validate-code.yml +1 -1
- package/CHANGELOG.md +13 -0
- package/CONTRIBUTING.md +24 -0
- package/README.md +50 -1
- package/dist/index.js +418 -48
- package/package.json +3 -4
- package/scripts/release.sh +157 -0
- package/src/commands/contracts/deploy.ts +6 -1
- package/src/commands/contracts/estimateFees.ts +133 -0
- package/src/commands/contracts/fees.ts +236 -0
- package/src/commands/contracts/index.ts +43 -0
- package/src/commands/contracts/write.ts +16 -3
- package/src/commands/localnet/validators.ts +4 -5
- package/src/lib/clients/jsonRpcClient.ts +9 -4
- package/src/lib/clients/system.ts +19 -17
- package/tests/actions/deploy.test.ts +49 -0
- package/tests/actions/estimateFees.test.ts +271 -0
- package/tests/actions/validators.test.ts +5 -5
- package/tests/actions/write.test.ts +47 -0
- package/tests/commands/deploy.test.ts +25 -0
- package/tests/commands/estimateFees.test.ts +98 -0
- package/tests/commands/write.test.ts +26 -0
- package/tests/libs/jsonRpcClient.test.ts +18 -0
- package/tests/libs/system.test.ts +36 -3
- package/tsconfig.json +2 -3
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: release
|
|
3
|
+
description: Cut a release of genlayer-cli. Bumps version, updates CHANGELOG, tags, pushes — CI then publishes to npm and creates the GitHub Release. Use when a human asks "release v0.39.x" or "ship a new version".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Release skill — genlayer-cli
|
|
7
|
+
|
|
8
|
+
This repo follows a branch-per-major release model. There is no auto-bump on push. A release happens when a human (or you on their behalf) runs `scripts/release.sh` on the target stable branch.
|
|
9
|
+
|
|
10
|
+
## When to use this skill
|
|
11
|
+
|
|
12
|
+
User asks anything like:
|
|
13
|
+
- "release v0.39.2"
|
|
14
|
+
- "ship a patch"
|
|
15
|
+
- "tag the latest fix as a release"
|
|
16
|
+
|
|
17
|
+
If they ask "publish to npm directly" — refuse and point at this flow. The repo doesn't have an unprotected npm push path; the tag is the only release entry point.
|
|
18
|
+
|
|
19
|
+
## What this repo's release model expects
|
|
20
|
+
|
|
21
|
+
- Branches are named after the major they ship: `v0.39` (current stable). When `v0.40` opens (a major bump in semver-zero terms), the previous `v0.39` stays read-only for back-ports.
|
|
22
|
+
- Tags live within those branches: `v0.39.2`, `v0.39.3`, ...
|
|
23
|
+
- **Semver-zero rule**: this package is on 0.x, so the MINOR component is the breaking-change boundary. `0.39 → 0.40` IS a major bump. `scripts/release.sh` refuses both `minor` and `major` keywords without `--allow-major`.
|
|
24
|
+
- A major (= minor on 0.x) bump means cutting a new branch (`v0.40`) — not tagging on the current one.
|
|
25
|
+
- `CHANGELOG.md` is updated in the release commit (release-it via `@release-it/conventional-changelog`).
|
|
26
|
+
- `publish.yml` fires on the tag push and does the npm publish + GitHub Release.
|
|
27
|
+
|
|
28
|
+
## Steps
|
|
29
|
+
|
|
30
|
+
1. **Confirm intent with the user.**
|
|
31
|
+
- Which version? If unspecified, ask whether it's patch or explicit.
|
|
32
|
+
- If they say "minor" or "major" on 0.x, surface that this means cutting a new branch — confirm.
|
|
33
|
+
|
|
34
|
+
2. **Switch to the target branch + sync.**
|
|
35
|
+
```bash
|
|
36
|
+
git checkout v0.39
|
|
37
|
+
git pull --ff-only origin v0.39
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
3. **Verify the head is shippable.**
|
|
41
|
+
- Latest CI green:
|
|
42
|
+
```bash
|
|
43
|
+
gh run list --branch v0.39 --commit "$(git rev-parse HEAD)" --limit 1
|
|
44
|
+
```
|
|
45
|
+
- Inspect commits since the previous tag:
|
|
46
|
+
```bash
|
|
47
|
+
git log "$(git describe --tags --abbrev=0)..HEAD" --oneline
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
4. **Run the release script.**
|
|
51
|
+
```bash
|
|
52
|
+
scripts/release.sh <X.Y.Z> # or patch
|
|
53
|
+
```
|
|
54
|
+
Bumps `package.json`, prepends `CHANGELOG.md`, commits, tags `vX.Y.Z`, pushes branch + tag. Does NOT publish to npm — CI handles that.
|
|
55
|
+
|
|
56
|
+
5. **Watch the publish workflow.**
|
|
57
|
+
```bash
|
|
58
|
+
gh run watch
|
|
59
|
+
```
|
|
60
|
+
If `publish.yml` fails (typical: tag/package.json mismatch, NPM_TOKEN, provenance), report verbatim and stop.
|
|
61
|
+
|
|
62
|
+
6. **Confirm on npm.**
|
|
63
|
+
```bash
|
|
64
|
+
npm view genlayer dist-tags
|
|
65
|
+
```
|
|
66
|
+
(Yes — the npm package name is `genlayer`, not `@genlayer/cli`.)
|
|
67
|
+
|
|
68
|
+
## Things to refuse
|
|
69
|
+
|
|
70
|
+
- **Minor or major bump on 0.x without `--allow-major`**. Those are major bumps in semver-zero and belong on a new branch.
|
|
71
|
+
- **Releasing from `main`** — `main` is retired.
|
|
72
|
+
- **Pushing to the dead `staging` branch** — the beta-channel flow was retired with the auto-bump. If you need a pre-release, tag `v0.39.2-beta.0` directly via the script with explicit version.
|
|
73
|
+
- **Hand-editing `package.json` to bump the version** — the script keeps everything in lockstep.
|
|
74
|
+
- **Publishing a tag where `publish.yml` failed** — fix the underlying issue, delete the bad tag, re-cut via the script.
|
|
75
|
+
|
|
76
|
+
## Roll-back
|
|
77
|
+
|
|
78
|
+
1. **Don't unpublish from npm** unless someone with elevated permissions has assessed the impact.
|
|
79
|
+
2. **Deprecate the bad version**:
|
|
80
|
+
```bash
|
|
81
|
+
npm deprecate "genlayer@<X.Y.Z>" "broken release; install <X.Y.Z+1> or later"
|
|
82
|
+
```
|
|
83
|
+
3. **Ship a follow-up patch** via the same flow.
|
|
84
|
+
|
|
85
|
+
## Why no auto-bump?
|
|
86
|
+
|
|
87
|
+
The previous flow auto-bumped on every push to `main` (and `staging` for betas). Trade-off:
|
|
88
|
+
- Lost: instant publish on merge.
|
|
89
|
+
- Gained: a human checkpoint between "code lands" and "users get it"; no accidental major bumps from `BREAKING CHANGE` footers in PR bodies.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v0.5
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
name: E2E Housekeeper
|
|
2
|
+
|
|
3
|
+
# ===========================================================================
|
|
4
|
+
# Source-of-truth E2E housekeeper workflow.
|
|
5
|
+
#
|
|
6
|
+
# This file is BOTH:
|
|
7
|
+
# - The workflow that runs in this repo (genlayer-e2e) for genlayer-
|
|
8
|
+
# e2e's own cache pool.
|
|
9
|
+
# - The file synced byte-identically to every consumer repo as
|
|
10
|
+
# `.github/workflows/e2e-housekeeper.yml` (sync-template.yaml owns
|
|
11
|
+
# the fan-out).
|
|
12
|
+
#
|
|
13
|
+
# Mirrors the architecture of e2e-pipeline.yml — one file in the source
|
|
14
|
+
# repo, copied verbatim to consumers, no wrapper layer. Adding a new
|
|
15
|
+
# scheduled upkeep step (artifact pruning, runner sweep, …) only needs
|
|
16
|
+
# editing this file; sync-template.yaml opens a PR in each consumer.
|
|
17
|
+
#
|
|
18
|
+
# Cache storage is per-repo, so the eviction step runs in the CALLER's
|
|
19
|
+
# context: `gh cache list` / `gh cache delete` operate on the caller's
|
|
20
|
+
# pool via the inherited GITHUB_TOKEN. The runner's filesystem starts
|
|
21
|
+
# empty, so step 1 checks out genlayer-e2e to access the extracted
|
|
22
|
+
# `evict-stale-caches.sh` script — github.token in a synced consumer
|
|
23
|
+
# context still has cross-org read access on the org's private repos.
|
|
24
|
+
# ===========================================================================
|
|
25
|
+
|
|
26
|
+
on:
|
|
27
|
+
schedule:
|
|
28
|
+
- cron: '0 6 * * *' # daily 06:00 UTC
|
|
29
|
+
# No inputs: production triggers (schedule today, PR-merged later)
|
|
30
|
+
# don't pass them, and the script's defaults (24h idle / 200 page
|
|
31
|
+
# cap) are stable. workflow_dispatch stays as a no-arg "run the
|
|
32
|
+
# cron now" button — handy in genlayer-e2e while iterating.
|
|
33
|
+
workflow_dispatch:
|
|
34
|
+
|
|
35
|
+
# Least-privilege. `evict-stale-caches.sh` invokes `gh cache list`
|
|
36
|
+
# (read) and `gh cache delete` (write) against the caller's cache pool
|
|
37
|
+
# via secrets.GITHUB_TOKEN. The GHA Cache API lives under the actions:
|
|
38
|
+
# permission namespace, so deletion requires actions:write. `contents:
|
|
39
|
+
# read` covers the checkout that fetches this repo's scripts.
|
|
40
|
+
permissions:
|
|
41
|
+
actions: write
|
|
42
|
+
contents: read
|
|
43
|
+
|
|
44
|
+
# Serialize runs so two overlapping firings (manual dispatch + schedule)
|
|
45
|
+
# don't both try to delete the same entry.
|
|
46
|
+
concurrency:
|
|
47
|
+
group: cache-cleanup
|
|
48
|
+
cancel-in-progress: false
|
|
49
|
+
|
|
50
|
+
jobs:
|
|
51
|
+
evict-stale:
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
timeout-minutes: 10
|
|
54
|
+
steps:
|
|
55
|
+
# Pull the extracted script. Explicit `repository:` because — when
|
|
56
|
+
# this file is synced to a consumer — actions/checkout's default
|
|
57
|
+
# target is the CONSUMER's repo, not genlayer-e2e. github.token
|
|
58
|
+
# in the consumer context has org-wide read on private repos so
|
|
59
|
+
# the clone works without an App token.
|
|
60
|
+
- name: Checkout genlayer-e2e
|
|
61
|
+
uses: actions/checkout@v6
|
|
62
|
+
with:
|
|
63
|
+
repository: genlayerlabs/genlayer-e2e
|
|
64
|
+
token: ${{ github.token }}
|
|
65
|
+
|
|
66
|
+
- name: Delete idle caches
|
|
67
|
+
env:
|
|
68
|
+
# `gh cache delete` consumes GH_TOKEN. github.repository
|
|
69
|
+
# resolves to the caller's repo (where the cron fires + the
|
|
70
|
+
# cache pool lives).
|
|
71
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
72
|
+
GH_REPO: ${{ github.repository }}
|
|
73
|
+
run: ./taskfiles/housekeeper/scripts/evict-stale-caches.sh --age 24 --limit 200
|
|
74
|
+
|
|
75
|
+
# Companion sweep for artifacts (logs, shard outputs, per-component
|
|
76
|
+
# summaries). Same 24h idle window so the two sweeps stay in sync.
|
|
77
|
+
# `if: always()` so an early cache-sweep failure doesn't skip the
|
|
78
|
+
# artifact pass — they're independent.
|
|
79
|
+
- name: Delete idle artifacts
|
|
80
|
+
if: always()
|
|
81
|
+
env:
|
|
82
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
83
|
+
GH_REPO: ${{ github.repository }}
|
|
84
|
+
run: ./taskfiles/housekeeper/scripts/evict-stale-artifacts.sh --age 24 --limit 1000
|