Skip to content

Commit 8bbeeb6

Browse files
authored
chore: fund v4-devnet-2 (#20652)
Fund `v4-devnet-2` every night and allow re-running `create-devnet` workflow in case it fails again.
2 parents 9f0ff18 + 16a72af commit 8bbeeb6

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

.github/workflows/ensure-funded-environments.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
include:
4141
- environment: devnet
4242
namespace: v4-devnet-1
43+
- environment: devnet
44+
namespace: v4-devnet-2
4345
uses: ./.github/workflows/ensure-funded-environment.yml
4446
with:
4547
environment: ${{ matrix.environment }}

spartan/scripts/create_devnet_tag.ts

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,31 @@ console.log(`Major: ${major}, Iteration: ${iteration}`);
5050
// 2. Configure git identity in CI
5151
configureGitIdentityInCI();
5252

53-
// 3. Find the latest patch number for this devnet
54-
const tagPattern = `v${major}.0.0-devnet.${iteration}-patch.`;
55-
const existingTags = execSync(`git tag -l "${tagPattern}*"`, {
53+
// 3. Check if HEAD already has a devnet tag for this branch
54+
const devnetTagPrefix = `v${major}.0.0-devnet.${iteration}-patch.`;
55+
const headTags = execSync("git tag --points-at HEAD", { encoding: "utf-8" });
56+
const existingDevnetTag = headTags
57+
.split("\n")
58+
.map((t) => t.trim())
59+
.find((t) => t.startsWith(devnetTagPrefix));
60+
61+
if (existingDevnetTag) {
62+
const existingPatch = existingDevnetTag.split("-patch.").pop()!;
63+
const existingSemver = existingDevnetTag.slice(1);
64+
const existingNamespace = `v${major}-devnet-${iteration}`;
65+
console.log(`HEAD already tagged as ${existingDevnetTag}, nothing to do.`);
66+
writeGithubOutputs({
67+
tag: existingDevnetTag,
68+
semver: existingSemver,
69+
namespace: existingNamespace,
70+
ref: branch,
71+
patch: existingPatch,
72+
});
73+
process.exit(0);
74+
}
75+
76+
// 4. Find the latest patch number for this devnet
77+
const existingTags = execSync(`git tag -l "${devnetTagPrefix}*"`, {
5678
encoding: "utf-8",
5779
});
5880

@@ -77,12 +99,12 @@ if (dryRun) {
7799
console.log(`[dry-run] Would create tag: ${tag}`);
78100
console.log(`[dry-run] Would push tag to origin`);
79101
} else {
80-
// 4. Create and push the tag
102+
// 5. Create and push the tag
81103
execSync(`git tag -a "${tag}" -m "Devnet patch release ${tag}"`);
82104
execSync(`git push origin "${tag}"`);
83105

84106
console.log(`Tag ${tag} created and pushed.`);
85107

86-
// 5. Write outputs for CI
108+
// 6. Write outputs for CI
87109
writeGithubOutputs({ tag, semver, namespace, ref: branch, patch: String(nextPatch) });
88110
}

0 commit comments

Comments
 (0)