climaybe 1.6.0 → 1.6.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/README.md CHANGED
@@ -185,7 +185,7 @@ Direct pushes to `staging-<store>` or `live-<store>` are automatically synced ba
185
185
 
186
186
  | Workflow | Trigger | What it does |
187
187
  |----------|---------|-------------|
188
- | `main-to-staging-stores.yml` (main-to-staging-&lt;store&gt;) | Push to `main` | Merges main into each `staging-<alias>`; root JSONs ignored (restored from stores/). Skips on hotfix/version/sync commits |
188
+ | `main-to-staging-stores.yml` (main-to-staging-&lt;store&gt;) | Push to `main` | Merges main into each `staging-<alias>`; root JSONs ignored. For hotfix-backport, skips the store that sent the hotfix; other stores get the merge. Skips only on pure store-sync. |
189
189
  | `stores-to-root.yml` | Push to `staging-*` | From main merge: stores→root. From elsewhere (e.g. Shopify): root→stores |
190
190
  | `pr-to-live.yml` | After stores-to-root | Opens PR from `staging-<alias>` to `live-<alias>` |
191
191
  | `root-to-stores.yml` | Push to `live-*` | From main merge: stores→root. From elsewhere: root→stores (same as stores-to-root on staging-*) |
@@ -221,7 +221,8 @@ Enabled via `climaybe init` prompt (`Enable build + Lighthouse workflows?`).
221
221
  - **No tags yet?** The system uses `theme_version` from `config/settings_schema.json` (`theme_info`), creates that tag on main (e.g. `v1.0.0`), and continues from there.
222
222
  - **Staging → main**: On PR, a pre-release patch tag (e.g. v3.1.13) locks the current minor line; on merge, **minor** bump (e.g. v3.1.13 → v3.2.0).
223
223
  - **Non-staging to main** (hotfix backports, direct commits): **Patch** bump only, via **nightly workflow** at 02:00 US Eastern (not at commit time).
224
- - All version bumps update `config/settings_schema.json` automatically.
224
+ - **Version bump runs only on main** (post-merge-tag and nightly-hotfix). Main-to-staging-stores merges main into each `staging-<alias>` on every push (version bumps and hotfixes). When the push is a hotfix from one store (e.g. live-norway), that store’s staging branch is skipped; other stores’ staging branches still get the merge.
225
+ - Version bumps update `config/settings_schema.json` and, when present, `package.json` `version`.
225
226
 
226
227
  **Full specification:** For detailed versioning rules, local dev flow, hotfix behavior, and alignment with the external CI/CD doc, see **[CI/CD Reference](docs/CI_CD_REFERENCE.md)**.
227
228
 
package/bin/version.txt CHANGED
@@ -1 +1 @@
1
- 1.6.0
1
+ 1.6.1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "climaybe",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Shopify CI/CD CLI — scaffolds workflows, branch strategy, and store config for single-store and multi-store theme repos",
5
5
  "type": "module",
6
6
  "bin": {
@@ -39,7 +39,21 @@
39
39
  "main"
40
40
  ],
41
41
  "plugins": [
42
- "@semantic-release/commit-analyzer",
42
+ [
43
+ "@semantic-release/commit-analyzer",
44
+ {
45
+ "releaseRules": [
46
+ {
47
+ "type": "ci",
48
+ "release": "patch"
49
+ },
50
+ {
51
+ "type": "chore",
52
+ "release": "patch"
53
+ }
54
+ ]
55
+ }
56
+ ],
43
57
  "@semantic-release/release-notes-generator",
44
58
  [
45
59
  "@semantic-release/npm",
@@ -2,7 +2,9 @@
2
2
  # When main is pushed (e.g. after staging→main merge), syncs main to each staging-<alias>.
3
3
  # Root JSON files (config/settings_data.json, templates/*.json, sections/*.json) are ignored:
4
4
  # merge brings main in but we immediately restore root from stores/<alias>/ so store-specific data is kept.
5
- # Skips [hotfix-backport], version-bump, and store-sync commits so hotfix syncs do not re-trigger release to stores.
5
+ # Runs on every push to main except pure store-sync commits ([stores-to-root], [root-to-stores]), so that:
6
+ # - Version-bump commits: staging-<alias> get the new version.
7
+ # - Hotfix backports (live or staging-<alias> → main): other staging-<alias> get those changes; the store that sent the hotfix is skipped (no need to merge back to the same branch).
6
8
 
7
9
  name: Main to Staging Stores
8
10
 
@@ -16,29 +18,37 @@ concurrency:
16
18
  cancel-in-progress: false
17
19
 
18
20
  jobs:
19
- # Gate: skip hotfix backports and version bump commits
21
+ # Gate: skip only pure store-sync commits. When hotfix-backport, extract source branch alias so we skip merging back into that same store.
20
22
  gate:
21
23
  runs-on: ubuntu-latest
22
24
  outputs:
23
25
  should_run: ${{ steps.check.outputs.should_run }}
26
+ hotfix_source_alias: ${{ steps.check.outputs.hotfix_source_alias }}
24
27
  steps:
25
- - name: Check commit message
28
+ - name: Check commit message and hotfix source
26
29
  id: check
27
30
  run: |
28
31
  COMMIT_MSG="${{ github.event.head_commit.message }}"
29
32
 
30
- if echo "$COMMIT_MSG" | grep -q "\[hotfix-backport\]"; then
31
- echo "Skipping — hotfix backport commit (do not re-release to stores)"
32
- echo "should_run=false" >> $GITHUB_OUTPUT
33
- elif echo "$COMMIT_MSG" | grep -q "chore(release): bump version"; then
34
- echo "Skipping — version bump commit"
35
- echo "should_run=false" >> $GITHUB_OUTPUT
36
- elif echo "$COMMIT_MSG" | grep -qE "\[skip-store-sync\]|\[stores-to-root\]|\[root-to-stores\]"; then
37
- echo "Skipping — store sync commit"
33
+ if echo "$COMMIT_MSG" | grep -qE "\[skip-store-sync\]|\[stores-to-root\]|\[root-to-stores\]"; then
34
+ echo "Skipping — store sync commit (avoid loop)"
38
35
  echo "should_run=false" >> $GITHUB_OUTPUT
39
- else
40
- echo "should_run=true" >> $GITHUB_OUTPUT
36
+ echo "hotfix_source_alias=" >> $GITHUB_OUTPUT
37
+ exit 0
38
+ fi
39
+
40
+ echo "should_run=true" >> $GITHUB_OUTPUT
41
+
42
+ # If hotfix-backport, extract source branch alias (e.g. staging-norway or live-norway → norway) so we skip that store in sync
43
+ HOTFIX_SOURCE_ALIAS=""
44
+ if echo "$COMMIT_MSG" | grep -q "\[hotfix-backport\]"; then
45
+ SOURCE_BRANCH=$(echo "$COMMIT_MSG" | sed -n 's/.*Merge \([^ ]*\) into main.*/\1/p' | head -1)
46
+ if [ -n "$SOURCE_BRANCH" ]; then
47
+ HOTFIX_SOURCE_ALIAS="${SOURCE_BRANCH#staging-}"
48
+ HOTFIX_SOURCE_ALIAS="${HOTFIX_SOURCE_ALIAS#live-}"
49
+ fi
41
50
  fi
51
+ echo "hotfix_source_alias=$HOTFIX_SOURCE_ALIAS" >> $GITHUB_OUTPUT
42
52
 
43
53
  # Read store list from package.json
44
54
  config:
@@ -61,7 +71,7 @@ jobs:
61
71
  echo "stores=$STORES" >> $GITHUB_OUTPUT
62
72
  echo "Store aliases: $STORES"
63
73
 
64
- # Merge main into each staging-<alias>; root JSONs ignored (restored from stores/<alias>/)
74
+ # Merge main into each staging-<alias>; root JSONs ignored (restored from stores/<alias>/). Skip the store that sent the hotfix (no need to merge back).
65
75
  sync:
66
76
  needs: [gate, config]
67
77
  if: needs.gate.outputs.should_run == 'true'
@@ -76,6 +86,7 @@ jobs:
76
86
  actions: write
77
87
  env:
78
88
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89
+ HOTFIX_SOURCE_ALIAS: ${{ needs.gate.outputs.hotfix_source_alias }}
79
90
  steps:
80
91
  - uses: actions/checkout@v4
81
92
  with:
@@ -87,6 +98,11 @@ jobs:
87
98
  ALIAS="${{ matrix.store }}"
88
99
  STORE_DIR="stores/${ALIAS}"
89
100
 
101
+ if [ -n "$HOTFIX_SOURCE_ALIAS" ] && [ "$HOTFIX_SOURCE_ALIAS" = "$ALIAS" ]; then
102
+ echo "Hotfix came from staging-$ALIAS or live-$ALIAS, skipping (no need to merge back to same store)."
103
+ exit 0
104
+ fi
105
+
90
106
  if ! git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then
91
107
  echo "Branch $BRANCH does not exist on remote, skipping."
92
108
  exit 0
@@ -1,5 +1,6 @@
1
1
  # climaybe — Version Bump (Reusable Workflow)
2
- # Bumps version in settings_schema.json, creates a git tag, and pushes.
2
+ # Bumps version in settings_schema.json and package.json (if present), creates a git tag, and pushes.
3
+ # Only runs on main (called from post-merge-tag and nightly-hotfix). staging / staging-* / live-* do not run version bump.
3
4
 
4
5
  name: Version Bump
5
6
 
@@ -99,20 +100,20 @@ jobs:
99
100
  echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
100
101
  echo "New version: $NEW_VERSION"
101
102
 
102
- - name: Update settings_schema.json
103
+ - name: Update settings_schema.json and package.json
104
+ env:
105
+ NEW_VERSION: ${{ steps.bump.outputs.new_version }}
103
106
  run: |
104
- NEW_VERSION="${{ steps.bump.outputs.new_version }}"
107
+ export VERSION_PLAIN="${NEW_VERSION#v}"
105
108
  SCHEMA_FILE="config/settings_schema.json"
106
109
 
107
110
  if [ -f "$SCHEMA_FILE" ]; then
108
- # Update the theme_info version in settings_schema.json
109
111
  node -e "
110
112
  const fs = require('fs');
113
+ const v = process.env.VERSION_PLAIN;
111
114
  const schema = JSON.parse(fs.readFileSync('$SCHEMA_FILE', 'utf-8'));
112
115
  const themeInfo = schema.find(s => s.name === 'theme_info');
113
- if (themeInfo) {
114
- themeInfo.theme_version = '${NEW_VERSION#v}';
115
- }
116
+ if (themeInfo) themeInfo.theme_version = v;
116
117
  fs.writeFileSync('$SCHEMA_FILE', JSON.stringify(schema, null, 2) + '\n');
117
118
  "
118
119
  echo "Updated $SCHEMA_FILE to ${NEW_VERSION}"
@@ -120,6 +121,18 @@ jobs:
120
121
  echo "No $SCHEMA_FILE found, skipping schema update."
121
122
  fi
122
123
 
124
+ if [ -f "package.json" ]; then
125
+ node -e "
126
+ const fs = require('fs');
127
+ const pkg = JSON.parse(fs.readFileSync('package.json', 'utf-8'));
128
+ pkg.version = process.env.VERSION_PLAIN;
129
+ fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');
130
+ "
131
+ echo "Updated package.json version to ${VERSION_PLAIN}"
132
+ else
133
+ echo "No package.json found, skipping."
134
+ fi
135
+
123
136
  - name: Commit and tag
124
137
  run: |
125
138
  NEW_VERSION="${{ steps.bump.outputs.new_version }}"