Skip to content

Commit c6af4aa

Browse files
authored
Merge branch 'main' into bugfix/autodev-2090-20260709093247057
2 parents 64cddbf + 2a12736 commit c6af4aa

4 files changed

Lines changed: 116 additions & 14 deletions

File tree

.github/workflows/memos-local-plugin-publish.yml

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ defaults:
2525

2626
permissions:
2727
contents: write
28+
pull-requests: write
2829

2930
jobs:
3031
build-prebuilds:
@@ -115,18 +116,68 @@ jobs:
115116
run: npm version ${{ inputs.version }} --no-git-tag-version --allow-same-version
116117

117118
- name: Publish to npm
118-
run: npm publish --access public --tag ${{ inputs.tag }}
119119
env:
120120
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
121+
PACKAGE_NAME: "@memtensor/memos-local-plugin"
122+
RELEASE_VERSION: ${{ inputs.version }}
123+
NPM_DIST_TAG: ${{ inputs.tag }}
124+
run: |
125+
if npm view "${PACKAGE_NAME}@${RELEASE_VERSION}" version >/dev/null 2>&1; then
126+
echo "${PACKAGE_NAME}@${RELEASE_VERSION} already exists on npm; skipping publish."
127+
else
128+
npm publish --access public --tag "${NPM_DIST_TAG}"
129+
fi
121130
122-
- name: Create git tag and push
131+
- name: Create release tag and PR
123132
working-directory: .
133+
env:
134+
GH_TOKEN: ${{ github.token }}
135+
RELEASE_VERSION: ${{ inputs.version }}
136+
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
124137
run: |
138+
set -euo pipefail
125139
git config user.name "github-actions[bot]"
126140
git config user.email "github-actions[bot]@users.noreply.github.com"
127-
git add apps/memos-local-plugin/package.json
141+
142+
release_tag="memos-local-plugin-v${RELEASE_VERSION}"
143+
release_branch="release/${release_tag}"
144+
release_title="release: @memtensor/memos-local-plugin v${RELEASE_VERSION}"
145+
146+
git add apps/memos-local-plugin/package.json apps/memos-local-plugin/package-lock.json
147+
created_release_commit=false
128148
if ! git diff --staged --quiet; then
129-
git commit -m "release: @memtensor/memos-local-plugin v${{ inputs.version }}"
149+
git commit -m "${release_title}"
150+
created_release_commit=true
151+
fi
152+
153+
if [ "${created_release_commit}" = "true" ]; then
154+
remote_branch_sha="$(git ls-remote --heads origin "${release_branch}" | awk '{print $1}')"
155+
if [ -n "${remote_branch_sha}" ]; then
156+
git push --force-with-lease="refs/heads/${release_branch}:${remote_branch_sha}" origin "HEAD:refs/heads/${release_branch}"
157+
else
158+
git push origin "HEAD:refs/heads/${release_branch}"
159+
fi
160+
fi
161+
162+
if git ls-remote --exit-code --tags origin "refs/tags/${release_tag}" >/dev/null 2>&1; then
163+
echo "Tag ${release_tag} already exists on origin; leaving it unchanged."
164+
else
165+
git tag "${release_tag}"
166+
git push origin "refs/tags/${release_tag}"
167+
fi
168+
169+
if [ "${created_release_commit}" = "true" ]; then
170+
if gh pr view "${release_branch}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
171+
echo "Release PR already exists for ${release_branch}."
172+
else
173+
gh pr create \
174+
--repo "${GITHUB_REPOSITORY}" \
175+
--base "${DEFAULT_BRANCH}" \
176+
--head "${release_branch}" \
177+
--title "${release_title}" \
178+
--body "Bumps apps/memos-local-plugin/package.json for the published npm release ${RELEASE_VERSION}." \
179+
|| echo "::warning::Failed to create release PR automatically. Open a PR from ${release_branch} to ${DEFAULT_BRANCH}."
180+
fi
181+
else
182+
echo "No version bump changes to open as a PR."
130183
fi
131-
git tag "memos-local-plugin-v${{ inputs.version }}"
132-
git push origin HEAD --tags

.github/workflows/openclaw-plugin-publish.yml

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ defaults:
2525

2626
permissions:
2727
contents: write
28+
pull-requests: write
2829

2930
jobs:
3031
build-prebuilds:
@@ -116,18 +117,68 @@ jobs:
116117
run: npm version ${{ inputs.version }} --no-git-tag-version --allow-same-version
117118

118119
- name: Publish to npm
119-
run: npm publish --access public --tag ${{ inputs.tag }}
120120
env:
121121
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
122+
PACKAGE_NAME: "@memtensor/memos-local-openclaw-plugin"
123+
RELEASE_VERSION: ${{ inputs.version }}
124+
NPM_DIST_TAG: ${{ inputs.tag }}
125+
run: |
126+
if npm view "${PACKAGE_NAME}@${RELEASE_VERSION}" version >/dev/null 2>&1; then
127+
echo "${PACKAGE_NAME}@${RELEASE_VERSION} already exists on npm; skipping publish."
128+
else
129+
npm publish --access public --tag "${NPM_DIST_TAG}"
130+
fi
122131
123-
- name: Create git tag and push
132+
- name: Create release tag and PR
124133
working-directory: .
134+
env:
135+
GH_TOKEN: ${{ github.token }}
136+
RELEASE_VERSION: ${{ inputs.version }}
137+
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
125138
run: |
139+
set -euo pipefail
126140
git config user.name "github-actions[bot]"
127141
git config user.email "github-actions[bot]@users.noreply.github.com"
142+
143+
release_tag="openclaw-plugin-v${RELEASE_VERSION}"
144+
release_branch="release/${release_tag}"
145+
release_title="release: openclaw-plugin v${RELEASE_VERSION}"
146+
128147
git add apps/memos-local-openclaw/package.json
148+
created_release_commit=false
129149
if ! git diff --staged --quiet; then
130-
git commit -m "release: openclaw-plugin v${{ inputs.version }}"
150+
git commit -m "${release_title}"
151+
created_release_commit=true
152+
fi
153+
154+
if [ "${created_release_commit}" = "true" ]; then
155+
remote_branch_sha="$(git ls-remote --heads origin "${release_branch}" | awk '{print $1}')"
156+
if [ -n "${remote_branch_sha}" ]; then
157+
git push --force-with-lease="refs/heads/${release_branch}:${remote_branch_sha}" origin "HEAD:refs/heads/${release_branch}"
158+
else
159+
git push origin "HEAD:refs/heads/${release_branch}"
160+
fi
161+
fi
162+
163+
if git ls-remote --exit-code --tags origin "refs/tags/${release_tag}" >/dev/null 2>&1; then
164+
echo "Tag ${release_tag} already exists on origin; leaving it unchanged."
165+
else
166+
git tag "${release_tag}"
167+
git push origin "refs/tags/${release_tag}"
168+
fi
169+
170+
if [ "${created_release_commit}" = "true" ]; then
171+
if gh pr view "${release_branch}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
172+
echo "Release PR already exists for ${release_branch}."
173+
else
174+
gh pr create \
175+
--repo "${GITHUB_REPOSITORY}" \
176+
--base "${DEFAULT_BRANCH}" \
177+
--head "${release_branch}" \
178+
--title "${release_title}" \
179+
--body "Bumps apps/memos-local-openclaw/package.json for the published npm release ${RELEASE_VERSION}." \
180+
|| echo "::warning::Failed to create release PR automatically. Open a PR from ${release_branch} to ${DEFAULT_BRANCH}."
181+
fi
182+
else
183+
echo "No version bump changes to open as a PR."
131184
fi
132-
git tag "openclaw-plugin-v${{ inputs.version }}"
133-
git push origin HEAD --tags

apps/memos-local-plugin/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/memos-local-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@memtensor/memos-local-plugin",
3-
"version": "2.0.5",
3+
"version": "2.0.10",
44
"description": "Reflect2Evolve memory plugin: layered L1/L2/L3 memory, reflection-weighted value backprop, cross-task policy induction, skill crystallization, three-tier retrieval. Adapters for OpenClaw and Hermes Agent via a shared algorithm core.",
55
"type": "module",
66
"main": "dist/core/index.js",

0 commit comments

Comments
 (0)