mirror of
https://github.com/cexll/myclaude.git
synced 2026-02-13 03:31:49 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81fa6843d9 |
29
.github/workflows/release.yml
vendored
29
.github/workflows/release.yml
vendored
@@ -91,6 +91,33 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Generate Release Notes
|
||||||
|
id: release_notes
|
||||||
|
run: |
|
||||||
|
# Get previous tag
|
||||||
|
PREVIOUS_TAG=$(git tag --sort=-version:refname | grep -v "^${{ github.ref_name }}$" | head -n 1)
|
||||||
|
|
||||||
|
if [ -z "$PREVIOUS_TAG" ]; then
|
||||||
|
echo "No previous tag found, using all commits"
|
||||||
|
COMMITS=$(git log --pretty=format:"- %s (%h)" --no-merges)
|
||||||
|
else
|
||||||
|
echo "Generating notes from $PREVIOUS_TAG to ${{ github.ref_name }}"
|
||||||
|
COMMITS=$(git log ${PREVIOUS_TAG}..${{ github.ref_name }} --pretty=format:"- %s (%h)" --no-merges)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create release notes
|
||||||
|
cat > release_notes.md <<EOF
|
||||||
|
## What's Changed
|
||||||
|
|
||||||
|
${COMMITS}
|
||||||
|
|
||||||
|
**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREVIOUS_TAG}...${{ github.ref_name }}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat release_notes.md
|
||||||
|
|
||||||
- name: Download all artifacts
|
- name: Download all artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@@ -108,6 +135,6 @@ jobs:
|
|||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
files: release/*
|
files: release/*
|
||||||
generate_release_notes: true
|
body_path: release_notes.md
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|||||||
@@ -78,32 +78,19 @@ def check_state_file(state_file: str, stdin_payload: str) -> str:
|
|||||||
|
|
||||||
phases_done = current_phase >= max_phases
|
phases_done = current_phase >= max_phases
|
||||||
|
|
||||||
promise_met = False
|
if phases_done:
|
||||||
if completion_promise:
|
# 阶段已完成,清理状态文件并允许退出
|
||||||
if stdin_payload and completion_promise in stdin_payload:
|
# promise 检测作为可选确认,不阻止退出
|
||||||
promise_met = True
|
|
||||||
else:
|
|
||||||
body = get_body(state_file)
|
|
||||||
if body and completion_promise in body:
|
|
||||||
promise_met = True
|
|
||||||
|
|
||||||
if phases_done and promise_met:
|
|
||||||
try:
|
try:
|
||||||
os.remove(state_file)
|
os.remove(state_file)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
if not phases_done:
|
return (f"do loop incomplete: current phase {current_phase}/{max_phases} ({phase_name}). "
|
||||||
return (f"do loop incomplete: current phase {current_phase}/{max_phases} ({phase_name}). "
|
f"Continue with remaining phases; update {state_file} current_phase/phase_name after each phase. "
|
||||||
f"Continue with remaining phases; update {state_file} current_phase/phase_name after each phase. "
|
f"Include completion_promise in final output when done: {completion_promise}. "
|
||||||
f"Include completion_promise in final output when done: {completion_promise}. "
|
f"To exit early, set active to false.")
|
||||||
f"To exit early, set active to false.")
|
|
||||||
else:
|
|
||||||
return (f"do reached final phase (current_phase={current_phase} / max_phases={max_phases}, "
|
|
||||||
f"phase_name={phase_name}), but completion_promise not detected: {completion_promise}. "
|
|
||||||
f"Please include this marker in your final output (or write it to {state_file} body), "
|
|
||||||
f"then finish; to force exit, set active to false.")
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
project_dir = os.environ.get("CLAUDE_PROJECT_DIR", os.getcwd())
|
project_dir = os.environ.get("CLAUDE_PROJECT_DIR", os.getcwd())
|
||||||
|
|||||||
Reference in New Issue
Block a user