ReMe/.github/workflows/release-python.yml
jinliyl 524b1b6908
feat(studio): unify the workbench and proactive runtime (#764)
* fix(proactive): simplify round files and restore failed summaries

* fix(proactive): validate document-relative Markdown links

* feat(proactive_agent): implement v2 daily record workflow with single-file decision

- Add ProactiveAgentStepV2 class to support single daily note decision and reminder
- Introduce RoundOutputs for v2 round file tracking, and keep RoundArtifacts for v1 summary backup
- Refactor AgentOutbox to support both v1 standalone reminder files and v2 daily reminder records
- Add proactive_record utilities to parse and validate v2 daily record frontmatter and metadata
- Enhance proactive_agent to prepare, read, and manage artifacts for both v1 and v2 flows
- Add configuration profile proactive_v2 to enable new workflow with backward compatibility
- Update proactive.yaml and reactive proactive_agent_step configuration comment for easy switching
- Provide extensive schema validation for v2 reminders ensuring priority and message consistency
- Document v2 workflow and usage in English and Chinese runtime docs
- Add unit tests for v2 step verifying single file output and proper decision handling

* refactor(agent/runtime): replace ReminderRef with string keys and simplify reminder handling

- Remove ReminderRef model and switch to using workspace-relative string keys for reminders
- Simplify AgentOutbox to read, write, and manage reminders keyed by strings
- Change file locking and version checking to protect concurrent edits on daily record files
- Replace legacy and v2 reminder file handling with unified ReminderFiles storage
- Adjust ChatNotifications to operate with the new key scheme and update pending/read sets
- Refactor RoundOutputs to RoundRecord for safer round record tracking and rollback
- Remove unused ProactiveRunResult and related references from imports and exports
- Update InboxWakeRequest, AgentReminder, and related models for consistent ID and path validation
- Adjust proactive agent runtime and local runtime to check reminder versions before commit
- Correct language and docs to describe reminders as daily records instead of separate files
- Clean up roles of inbox and outbox for reminder ownership, delivery, and acknowledgments

* fix(proactive): serialize round commits and align desktop reminders

* refactor(proactive): unify task triggers in Proactive Runtime

* fix(proactive): bound reminder payloads and simplify receipts

* refactor(studio): share workbench and simplify proactive delivery

* fix(studio): update and centralize build dependencies

* fix(proactive): guard draft repair and verify Studio deployments

* chore(docs): update source-map-js

* feat(release): support publishing selected artifacts from a tag

* chore(studio): remove the public playground

* refactor: simplify reminders and release workflows

* fix: preserve proactive records and align release provenance

* test(proactive): remove brittle prompt and preset assertions

* fix(proactive): register reminders after input acknowledgement

* feat(notebook): list projects across todos and ideas

* feat(studio): connect mobile apps to configurable ReMe services

* fix(proactive): reserve registered reminder paths

* fix(studio): request Android local network access

* fix(proactive): reserve reminder paths referenced by receipts
2026-11-23 17:19:21 +08:00

259 lines
9.4 KiB
YAML

name: Release / ReMe
# A published GitHub Release builds all distributions from its tag.
# Configure PyPI and npm trusted publishers for this workflow.
run-name: Publish ReMe ${{ github.ref_name }}
on:
workflow_dispatch:
inputs:
publish_pypi:
description: Publish reme-ai and reme-studio to PyPI
default: true
type: boolean
publish_npm:
description: Publish Studio to npm
default: true
type: boolean
publish_desktop:
description: Publish Windows, macOS, and Linux installers to GitHub Releases
default: true
type: boolean
publish_docker:
description: Publish the versioned Docker image to GHCR
default: true
type: boolean
release:
types: [published]
permissions:
contents: read
concurrency:
group: publish-reme
cancel-in-progress: false
jobs:
prepare:
name: Verify release tag and version
if: github.event_name == 'release' || inputs.publish_pypi || inputs.publish_npm || inputs.publish_desktop || inputs.publish_docker
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
tag: ${{ steps.version.outputs.tag }}
sha: ${{ steps.version.outputs.sha }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: ${{ github.sha }}
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
with:
python-version: '3.11'
- name: Validate source version
id: version
run: |
if [[ "$GITHUB_REF_TYPE" != tag || "$(git rev-parse HEAD)" != "$GITHUB_SHA" ]]; then
echo "::error::Run this workflow from the release tag."
exit 1
fi
python -m pip install packaging
python scripts/bump_version.py --check --expected-version "$GITHUB_REF_NAME"
printf 'tag=%s\nsha=%s\n' "$GITHUB_REF_NAME" "$GITHUB_SHA" >> "$GITHUB_OUTPUT"
build:
name: Build and verify distributions
if: github.event_name == 'release' || inputs.publish_pypi || inputs.publish_npm
needs: prepare
uses: ./.github/workflows/_build-python-packages.yml
with:
expected_version: ${{ needs.prepare.outputs.tag }}
source_ref: ${{ needs.prepare.outputs.sha }}
upload_artifacts: true
publish-reme:
needs: publish-studio
runs-on: ubuntu-latest
timeout-minutes: 10
environment: pypi
permissions:
contents: read
id-token: write
steps:
- name: Download ReMe distributions
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: reme-distributions
path: dist/reme
- name: Publish ReMe
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # release/v1
with:
packages-dir: dist/reme
skip-existing: true
desktop:
name: Package Desktop (${{ matrix.os }})
if: github.event_name == 'release' || inputs.publish_desktop
needs: prepare
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: ${{ needs.prepare.outputs.sha }}
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
with:
node-version: '22.22.3'
cache: npm
cache-dependency-path: reme_studio/package-lock.json
- run: npm ci --prefix reme_studio
- name: Package desktop installers
shell: bash
run: |
npm exec --workspace desktop -- install-electron
flags=()
manifest=""
case "$RUNNER_OS" in
macOS)
if [[ -n "$CSC_LINK" && -n "$APPLE_ID" && -n "$APPLE_APP_SPECIFIC_PASSWORD" && -n "$APPLE_TEAM_ID" ]]; then
export CSC_IDENTITY_AUTO_DISCOVERY=true
flags+=(--config.forceCodeSigning=true --config.mac.notarize=true)
manifest=latest-mac.yml
fi
;;
Windows)
if [[ -n "$CSC_LINK" ]]; then
flags+=(--config.forceCodeSigning=true)
manifest=latest.yml
fi
;;
Linux) manifest=latest-linux.yml ;;
esac
if [[ -n "$manifest" ]]; then
flags+=(
--config.publish.provider=github
--config.publish.owner="$GITHUB_REPOSITORY_OWNER"
--config.publish.repo="${GITHUB_REPOSITORY#*/}"
)
fi
npm run dist --workspace desktop -- "${flags[@]}"
if [[ -n "$manifest" ]]; then
test -s "desktop/dist/$manifest"
fi
working-directory: reme_studio
env:
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
CSC_LINK: ${{ (runner.os == 'macOS' && secrets.MAC_CSC_LINK) || (runner.os == 'Windows' && secrets.WIN_CSC_LINK) || '' }}
CSC_KEY_PASSWORD: ${{ (runner.os == 'macOS' && secrets.MAC_CSC_KEY_PASSWORD) || (runner.os == 'Windows' && secrets.WIN_CSC_KEY_PASSWORD) || '' }}
APPLE_ID: ${{ runner.os == 'macOS' && secrets.APPLE_ID || '' }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ runner.os == 'macOS' && secrets.APPLE_APP_SPECIFIC_PASSWORD || '' }}
APPLE_TEAM_ID: ${{ runner.os == 'macOS' && secrets.APPLE_TEAM_ID || '' }}
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: reme-desktop-${{ matrix.os }}
path: |
reme_studio/desktop/dist/*.dmg
reme_studio/desktop/dist/*.zip
reme_studio/desktop/dist/*.exe
reme_studio/desktop/dist/*.AppImage
reme_studio/desktop/dist/*.blockmap
reme_studio/desktop/dist/latest*.yml
if-no-files-found: error
publish-studio:
if: github.event_name == 'release' || inputs.publish_pypi
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
environment: pypi
permissions:
contents: read
id-token: write
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333
with:
name: studio-distributions
path: dist
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086
with:
packages-dir: dist/studio
skip-existing: true
publish-studio-npm:
if: github.event_name == 'release' || inputs.publish_npm
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
environment: npm
permissions:
contents: read
id-token: write
steps:
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
with:
node-version: '24'
registry-url: https://registry.npmjs.org
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333
with:
name: studio-distributions
path: dist
- env:
STUDIO_PACKAGE: '@agentscope-ai/reme_studio'
run: |
package=$(find dist/studio-npm -name '*.tgz' -print -quit)
version=$(tar -xOf "$package" package/package.json | node -p "JSON.parse(require('node:fs').readFileSync(0)).version")
if remote=$(npm view "$STUDIO_PACKAGE@$version" dist.integrity); then
actual=$(node -e "const fs=require('node:fs'); const crypto=require('node:crypto'); console.log('sha512-'+crypto.createHash('sha512').update(fs.readFileSync(process.argv[1])).digest('base64'))" "$package")
test "$remote" = "$actual"
else
npm publish "$package" --access public --provenance
fi
publish-desktop:
if: github.event_name == 'release' || inputs.publish_desktop
needs: [prepare, desktop]
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333
with:
pattern: reme-desktop-*
merge-multiple: true
path: dist/desktop
- env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ needs.prepare.outputs.tag }}
run: |
shopt -s nullglob
installers=(dist/desktop/*.dmg dist/desktop/*.zip dist/desktop/*.exe dist/desktop/*.AppImage dist/desktop/*.blockmap)
manifests=(dist/desktop/latest*.yml)
test "${#installers[@]}" -gt 0
if [[ "$GITHUB_EVENT_NAME" == workflow_dispatch ]] &&
! gh release view "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" --json tagName >/dev/null 2>&1; then
gh release create "$RELEASE_TAG" "${installers[@]}" "${manifests[@]}" \
--repo "$GITHUB_REPOSITORY" --verify-tag --latest=false --title "$RELEASE_TAG"
exit
fi
gh release upload "$RELEASE_TAG" "${installers[@]}" --repo "$GITHUB_REPOSITORY" --clobber
if (( ${#manifests[@]} )); then
gh release upload "$RELEASE_TAG" "${manifests[@]}" --repo "$GITHUB_REPOSITORY" --clobber
fi
publish-docker:
if: github.event_name == 'release' || inputs.publish_docker
needs: prepare
permissions:
contents: read
packages: write
uses: ./.github/workflows/docker.yml
with:
release_tag: ${{ needs.prepare.outputs.tag }}
source_ref: ${{ needs.prepare.outputs.sha }}