Skip to content

Commit a6b2068

Browse files
authored
Merge pull request #2 from Toob-Boot/dev
Dev
2 parents 868fd2e + 443631b commit a6b2068

39 files changed

Lines changed: 6867 additions & 3686 deletions

.github/actions/setup-cli/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ runs:
1717
- name: Setup Go
1818
uses: actions/setup-go@v6
1919
with:
20-
go-version: "1.26.2"
20+
go-version: "1.26.3"
2121

2222
- name: Install System Dependencies
2323
if: ${{ inputs.install-native-deps == 'true' }}

.github/workflows/release-cli.yml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Setup Go
2323
uses: actions/setup-go@v6
2424
with:
25-
go-version: "1.26.2"
25+
go-version: "1.26.3"
2626
cache: true
2727

2828
- name: Install UPX & Minisign
@@ -121,25 +121,6 @@ jobs:
121121
https://api.github.com/repos/Toob-Boot/Toob-Registry/actions/workflows/version-index.yml/dispatches \
122122
-d '{"ref":"main"}'
123123
124-
- name: Propagate to Compiler Container
125-
env:
126-
GITHUB_TOKEN: ${{ secrets.RELEASE_TARGET_TOKEN }}
127-
run: |
128-
CLI_TAG=${{ env.TAG_NAME }}
129-
RAW_CLI=${CLI_TAG#cli/v}
130-
131-
echo ">>> Updating compiler manifest with CLI v${RAW_CLI}..."
132-
jq --arg ver "$RAW_CLI" --arg ref "$CLI_TAG" \
133-
'.cli.version = $ver | .cli.source.ref = $ref' \
134-
compiler/compiler_manifest.json > tmp_manifest.json \
135-
&& mv tmp_manifest.json compiler/compiler_manifest.json
136-
137-
git config user.name "Toob CLI Publisher"
138-
git config user.email "publisher@toob-boot.io"
139-
git add compiler/compiler_manifest.json
140-
git commit -m "chore(compiler): update CLI dependency to ${CLI_TAG}"
141-
142-
# Authenticate using token for act compatibility
143-
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/Toob-Boot/Toob-Loader.git
144-
git push origin HEAD:main
124+
# Compiler manifest update is handled by sync-cli-release.yml,
125+
# triggered when the CLI release is published (moved out of draft).
145126

.github/workflows/semver-enforcer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ jobs:
293293
git config user.name "Toob ABI Oracle"
294294
git config user.email "oracle@toob-boot.io"
295295
git add compiler/compiler_manifest.json
296-
git commit -m "chore(compiler): bump to v${NEW_VERSION}" || true
296+
git commit -m "chore(compiler): bump to v${NEW_VERSION} [skip ci]" || true
297297
git push origin HEAD:main || true
298298
299299
if git rev-parse "$NEW_TAG" >/dev/null 2>&1; then
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Sync CLI Release to Compiler
2+
3+
# Triggered by Toob-CLI-Release when a CLI release is published (moved out of draft).
4+
# Updates the compiler manifest so the Enforcer can tag a new compiler version.
5+
on:
6+
repository_dispatch:
7+
types: [cli_published]
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
update-manifest:
14+
name: Update Compiler Manifest
15+
runs-on: ubuntu-latest
16+
if: ${{ github.event.client_payload.version != '' }}
17+
steps:
18+
- name: Checkout Code
19+
uses: actions/checkout@v6
20+
with:
21+
fetch-depth: 1
22+
# PAT ensures the push triggers the semver-enforcer workflow
23+
token: ${{ secrets.RELEASE_TARGET_TOKEN }}
24+
25+
- name: Validate & Update Manifest
26+
run: |
27+
CLI_TAG="${{ github.event.client_payload.version }}"
28+
29+
if [[ ! "$CLI_TAG" =~ ^cli/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
30+
echo ">>> FATAL: Invalid CLI tag format: '$CLI_TAG'. Expected 'cli/vX.Y.Z'."
31+
exit 1
32+
fi
33+
34+
RAW_CLI=${CLI_TAG#cli/v}
35+
36+
echo ">>> Updating compiler manifest with CLI v${RAW_CLI}..."
37+
jq --arg ver "$RAW_CLI" --arg ref "$CLI_TAG" \
38+
'.cli.version = $ver | .cli.source.ref = $ref' \
39+
compiler/compiler_manifest.json > tmp_manifest.json \
40+
&& mv tmp_manifest.json compiler/compiler_manifest.json
41+
42+
git config user.name "Toob Release Sync"
43+
git config user.email "sync@toob-boot.io"
44+
git add compiler/compiler_manifest.json
45+
46+
# Skip if manifest already matches (idempotent)
47+
if git diff --cached --quiet; then
48+
echo ">>> Manifest already up to date. Nothing to commit."
49+
exit 0
50+
fi
51+
52+
git commit -m "chore(compiler): update CLI dependency to ${CLI_TAG}"
53+
git push origin HEAD:main
54+
55+
echo ">>> [SUCCESS] Manifest updated. Enforcer will tag automatically."

cli/.pipeline-repo

cli/toob-cli/cmd/abi.go

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
"github.com/spf13/cobra"
88
"github.com/toob-boot/toob/internal/abi"
9+
"github.com/toob-boot/toob/internal/ui"
910
)
1011

1112
var abiCmd = &cobra.Command{
@@ -29,32 +30,33 @@ var abiCheckCmd = &cobra.Command{
2930
oldFile := args[0]
3031
newFile := args[1]
3132

32-
fmt.Printf("Analyzing ABI changes...\n")
33-
fmt.Printf(" Baseline: %s\n", oldFile)
34-
fmt.Printf(" New: %s\n\n", newFile)
33+
ui.Step("Analyzing ABI changes...")
34+
ui.KeyValue("Baseline", oldFile)
35+
ui.KeyValue("New", newFile)
36+
ui.Divider()
3537

3638
res, err := abi.Compare(oldFile, newFile)
3739
if err != nil {
3840
return fmt.Errorf("analysis failed: %w", err)
3941
}
4042

4143
if res.BumpType == abi.BumpPatch {
42-
fmt.Printf("\033[32m✔ ABI is perfectly compatible.\033[0m\n")
43-
fmt.Printf("Recommended SemVer bump: \033[1;32mPATCH\033[0m\n")
44+
ui.Success("ABI is perfectly compatible.")
45+
ui.Info("Recommended SemVer bump: %s", ui.BoldGreen("PATCH"))
4446
return nil
4547
}
4648

47-
fmt.Printf("\033[33mABI Changes Detected:\033[0m\n")
48-
fmt.Println(res.Report)
49+
ui.Warn("ABI Changes Detected:")
50+
fmt.Fprintln(os.Stderr, res.Report)
4951

5052
switch res.BumpType {
5153
case abi.BumpMajor:
52-
fmt.Printf("Recommended SemVer bump: \033[1;31mMAJOR\033[0m (Incompatible/Breaking Changes)\n")
53-
os.Exit(1) // Exit with code 1 so CI pipelines can block this if necessary
54+
ui.Error("Recommended SemVer bump: %s (Breaking Changes)", ui.BoldRed("MAJOR"))
55+
os.Exit(1)
5456
case abi.BumpMinor:
55-
fmt.Printf("Recommended SemVer bump: \033[1;33mMINOR\033[0m (Backwards-Compatible Additions)\n")
57+
ui.Info("Recommended SemVer bump: %s (Backwards-Compatible)", ui.Bold("MINOR"))
5658
default:
57-
fmt.Printf("Recommended SemVer bump: \033[1;31mUNKNOWN\033[0m\n")
59+
ui.Warn("Recommended SemVer bump: %s", ui.BoldRed("UNKNOWN"))
5860
}
5961

6062
return nil
@@ -73,12 +75,12 @@ var abiBaselineCmd = &cobra.Command{
7375
outFile = inFile + ".abi.xml"
7476
}
7577

76-
fmt.Printf("Generating baseline for %s...\n", inFile)
78+
ui.Step("Generating baseline for %s", inFile)
7779
if err := abi.GenerateBaseline(inFile, outFile); err != nil {
7880
return err
7981
}
8082

81-
fmt.Printf("\033[32m✔ Baseline successfully generated:\033[0m %s\n", outFile)
83+
ui.Success("Baseline generated: %s", outFile)
8284
return nil
8385
},
8486
}

0 commit comments

Comments
 (0)