climaybe 1.0.0 → 1.3.0
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/LICENSE +21 -0
- package/README.md +64 -12
- package/package.json +45 -2
- package/src/commands/add-store.js +77 -4
- package/src/commands/init.js +150 -16
- package/src/commands/update-workflows.js +4 -2
- package/src/index.js +15 -3
- package/src/lib/config.js +17 -0
- package/src/lib/git.js +21 -3
- package/src/lib/github-secrets.js +263 -0
- package/src/lib/prompts.js +116 -6
- package/src/lib/workflows.js +23 -3
- package/src/workflows/build/build-pipeline.yml +57 -0
- package/src/workflows/build/create-release.yml +52 -0
- package/src/workflows/build/reusable-build.yml +52 -0
- package/src/workflows/multi/main-to-staging-stores.yml +44 -3
- package/src/workflows/multi/multistore-hotfix-to-main.yml +84 -0
- package/src/workflows/multi/pr-to-live.yml +82 -8
- package/src/workflows/multi/stores-to-root.yml +10 -3
- package/src/workflows/preview/pr-close.yml +63 -0
- package/src/workflows/preview/pr-update.yml +120 -0
- package/src/workflows/preview/reusable-cleanup-themes.yml +71 -0
- package/src/workflows/preview/reusable-comment-on-pr.yml +76 -0
- package/src/workflows/preview/reusable-extract-pr-number.yml +35 -0
- package/src/workflows/preview/reusable-rename-theme.yml +73 -0
- package/src/workflows/preview/reusable-share-theme.yml +94 -0
- package/src/workflows/shared/ai-changelog.yml +82 -24
- package/src/workflows/shared/version-bump.yml +22 -7
- package/src/workflows/single/nightly-hotfix.yml +38 -2
- package/src/workflows/single/post-merge-tag.yml +68 -15
- package/src/workflows/single/release-pr-check.yml +16 -6
- package/src/workflows/multi/hotfix-backport.yml +0 -100
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
# climaybe — Hotfix Backport (Multi-store)
|
|
2
|
-
# After root-to-stores completes on a live-* branch,
|
|
3
|
-
# creates a PR to main with [hotfix-backport] flag.
|
|
4
|
-
# This ensures hotfixes on live stores are propagated back to the dev branch.
|
|
5
|
-
# Triggers a patch version bump on main.
|
|
6
|
-
|
|
7
|
-
name: Hotfix Backport
|
|
8
|
-
|
|
9
|
-
on:
|
|
10
|
-
workflow_run:
|
|
11
|
-
workflows: ["Root to Stores"]
|
|
12
|
-
types: [completed]
|
|
13
|
-
branches:
|
|
14
|
-
- 'live-*'
|
|
15
|
-
|
|
16
|
-
jobs:
|
|
17
|
-
backport:
|
|
18
|
-
if: github.event.workflow_run.conclusion == 'success'
|
|
19
|
-
runs-on: ubuntu-latest
|
|
20
|
-
permissions:
|
|
21
|
-
contents: write
|
|
22
|
-
pull-requests: write
|
|
23
|
-
env:
|
|
24
|
-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
25
|
-
steps:
|
|
26
|
-
- uses: actions/checkout@v4
|
|
27
|
-
with:
|
|
28
|
-
ref: ${{ github.event.workflow_run.head_branch }}
|
|
29
|
-
fetch-depth: 0
|
|
30
|
-
token: ${{ secrets.GITHUB_TOKEN }}
|
|
31
|
-
|
|
32
|
-
- name: Extract store alias
|
|
33
|
-
id: alias
|
|
34
|
-
run: |
|
|
35
|
-
BRANCH="${{ github.event.workflow_run.head_branch }}"
|
|
36
|
-
ALIAS="${BRANCH#live-}"
|
|
37
|
-
echo "alias=$ALIAS" >> $GITHUB_OUTPUT
|
|
38
|
-
echo "live_branch=$BRANCH" >> $GITHUB_OUTPUT
|
|
39
|
-
|
|
40
|
-
- name: Check if backport is needed
|
|
41
|
-
id: check
|
|
42
|
-
run: |
|
|
43
|
-
LIVE="${{ steps.alias.outputs.live_branch }}"
|
|
44
|
-
|
|
45
|
-
# Get the last common ancestor with main
|
|
46
|
-
MERGE_BASE=$(git merge-base origin/main origin/$LIVE 2>/dev/null || echo "")
|
|
47
|
-
|
|
48
|
-
if [ -z "$MERGE_BASE" ]; then
|
|
49
|
-
echo "needs_backport=false" >> $GITHUB_OUTPUT
|
|
50
|
-
exit 0
|
|
51
|
-
fi
|
|
52
|
-
|
|
53
|
-
# Check for commits on live that aren't on main
|
|
54
|
-
COMMITS=$(git log --oneline ${MERGE_BASE}..origin/$LIVE -- . ':!stores/' 2>/dev/null | grep -v "\[stores-to-root\]" | grep -v "\[root-to-stores\]" | grep -v "chore(release)" || true)
|
|
55
|
-
|
|
56
|
-
if [ -n "$COMMITS" ]; then
|
|
57
|
-
echo "needs_backport=true" >> $GITHUB_OUTPUT
|
|
58
|
-
echo "Commits to backport:"
|
|
59
|
-
echo "$COMMITS"
|
|
60
|
-
else
|
|
61
|
-
echo "needs_backport=false" >> $GITHUB_OUTPUT
|
|
62
|
-
echo "No new commits to backport."
|
|
63
|
-
fi
|
|
64
|
-
|
|
65
|
-
- name: Create backport PR
|
|
66
|
-
if: steps.check.outputs.needs_backport == 'true'
|
|
67
|
-
run: |
|
|
68
|
-
LIVE="${{ steps.alias.outputs.live_branch }}"
|
|
69
|
-
ALIAS="${{ steps.alias.outputs.alias }}"
|
|
70
|
-
|
|
71
|
-
# Check for existing open backport PR
|
|
72
|
-
EXISTING_PR=$(gh pr list --base main --head "$LIVE" --state open --json number --jq '.[0].number' 2>/dev/null || echo "")
|
|
73
|
-
|
|
74
|
-
if [ -n "$EXISTING_PR" ]; then
|
|
75
|
-
echo "Backport PR #$EXISTING_PR already exists"
|
|
76
|
-
exit 0
|
|
77
|
-
fi
|
|
78
|
-
|
|
79
|
-
PR_URL=$(gh pr create \
|
|
80
|
-
--base main \
|
|
81
|
-
--head "$LIVE" \
|
|
82
|
-
--title "[hotfix-backport] ${ALIAS}: hotfix from live" \
|
|
83
|
-
--body "Backporting hotfix changes from **${LIVE}** to main.
|
|
84
|
-
|
|
85
|
-
This PR was automatically created because direct commits were detected on the live branch.
|
|
86
|
-
|
|
87
|
-
**Important:** Merging this will trigger a patch version bump on main.
|
|
88
|
-
|
|
89
|
-
*Generated by climaybe*" 2>/dev/null || echo "")
|
|
90
|
-
|
|
91
|
-
if [ -n "$PR_URL" ]; then
|
|
92
|
-
echo "Created backport PR: $PR_URL"
|
|
93
|
-
else
|
|
94
|
-
echo "PR creation failed or no diff between branches."
|
|
95
|
-
fi
|
|
96
|
-
|
|
97
|
-
# Patch version bump after backport merge
|
|
98
|
-
# This is handled by the nightly-hotfix workflow or can be triggered manually.
|
|
99
|
-
# The [hotfix-backport] flag in the commit message ensures main-to-staging-stores
|
|
100
|
-
# does NOT push this back to stores.
|