Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8c9cb78
feat(tarko): add github release creation to pnpm-toolkit
ulivz Sep 7, 2025
8439750
docs(tarko): update pnpm-toolkit README with github release feature
ulivz Sep 7, 2025
6e74101
feat(tarko): add standalone github-release command to pnpm-toolkit
ulivz Sep 7, 2025
1bd00af
feat(multimodal): add github release scripts to package.json
ulivz Sep 7, 2025
fb04d7b
fix(tarko): improve changelog parsing and repository detection for gi…
ulivz Sep 7, 2025
5afc2ab
chore: format
ulivz Sep 7, 2025
bdf4184
fix(tarko): improve github release with native generation and correct…
ulivz Sep 7, 2025
a4eea19
feat(tarko): add beautiful release notes with conventional changelog …
ulivz Sep 7, 2025
32904d0
fix(tarko): use clean version format for github release title
ulivz Sep 7, 2025
6b25f0e
feat(tarko): preserve conventional commit prefixes in release notes
ulivz Sep 7, 2025
7107997
fix(tarko): resolve version parameter conflict with CAC CLI
ulivz Sep 7, 2025
0fa9710
feat(tarko): fix version parameter conflicts and add historical relea…
ulivz Sep 7, 2025
6fbe2f7
style(tarko): format github.ts and cli.ts with prettier
ulivz Sep 7, 2025
aab3984
feat(tarko): add Full Changelog link to release notes
ulivz Sep 7, 2025
8572937
feat(tarko): show release notes preview in dry-run mode
ulivz Sep 7, 2025
5b5d312
feat(tarko): improve full changelog link format with markdown
ulivz Sep 7, 2025
947edf3
feat(tarko): simplify changelog link text to version-only format
ulivz Sep 7, 2025
7224508
feat(tarko): add username mapping for correct github links
ulivz Sep 7, 2025
30238fe
chore: tweaks
ulivz Sep 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions multimodal/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,35 @@ The `multimodal` directory contains several sub-packages. Here are the most impo
└── agent-tars-web-ui # Level 6. Agent TARS Web UI
```

### 2.2 Starting the Dev Server
### 2.2 Release Management

#### 2.2.1 Publishing Historical Versions

If you need to publish a historical version that was previously missed, you can use the GitHub release command:

```bash
# Publish historical version (dry-run first to preview)
pnpm run github-release:dryrun --release-version 0.3.0-beta.9

# Actually publish the historical version
pnpm run github-release --release-version 0.3.0-beta.9
```

This will:
- Create a GitHub release for the specified version
- Generate beautiful release notes with conventional commit format
- Use the correct tag format (`@[email protected]`)
- Display as clean version title (`v0.3.0-beta.9`)

### 2.3 Starting the Dev Server

From the `multimodal` directory, run the following command to watch for changes and build all sub-packages as needed:

```bash
pnpm dev
```

### 2.3 Debugging Core Packages
### 2.4 Debugging Core Packages

When you're working on lower-level core packages (such as `@tarko/agent`), it's recommended to use the following command:

Expand All @@ -61,7 +81,7 @@ pnpm ptk d --packages @package/name1,@package/name2

Note that package matching is based on the package name in package.json, not the directory name.

### 2.4 Running Agent TARS
### 2.5 Running Agent TARS

Use the following command to run Agent TARS, replacing the path with your local CLI path:

Expand All @@ -75,7 +95,7 @@ Use the following command to run Agent TARS, replacing the path with your local

Make sure to replace `/path/to/UI-TARS-desktop/multimodal/agent-tars-cli/bin/cli.js` with the actual path on your system.

### 2.4 Running Agent TARS in Headless Mode
### 2.6 Running Agent TARS in Headless Mode

To run Agent TARS in headless mode, use the same command with the `serve` option:

Expand Down
4 changes: 4 additions & 0 deletions multimodal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@
"coverage": "vitest run --coverage",
"format": "pnpm prettier --write .",
"release": "ptk release --push-tag --build --ignore-scripts --tag-prefix '@agent-tars@'",
"release:full": "ptk release --push-tag --build --ignore-scripts --tag-prefix '@agent-tars@' --create-github-release",
"release:ai": "ptk release --push-tag --build --ignore-scripts --tag-prefix '@agent-tars@' --use-ai --provider=azure-openai --model=aws_sdk_claude37_sonnet --baseURL=AWS_CLAUDE_API_BASE_URL",
"release:ai:full": "ptk release --push-tag --build --ignore-scripts --tag-prefix '@agent-tars@' --use-ai --provider=azure-openai --model=aws_sdk_claude37_sonnet --baseURL=AWS_CLAUDE_API_BASE_URL --create-github-release",
"release:ai:dryrun": "ptk release --push-tag --build --ignore-scripts --tag-prefix '@agent-tars@' --use-ai --provider=azure-openai --model=aws_sdk_claude37_sonnet --baseURL=AWS_CLAUDE_API_BASE_URL --dry-run",
"github-release": "ptk github-release --tag-prefix '@agent-tars@'",
"github-release:dryrun": "ptk github-release --tag-prefix '@agent-tars@' --dry-run",
"changelog": "ptk changelog --tag-prefix '@agent-tars@' --use-ai --provider=azure-openai --model=aws_sdk_claude37_sonnet --baseURL=AWS_CLAUDE_API_BASE_URL",
"patch": "ptk patch"
},
Expand Down
74 changes: 73 additions & 1 deletion multimodal/tarko/pnpm-toolkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- 🚀 **Release Management**: Automated version bumping and publishing
- 🔧 **Patch System**: Repair failed package publications
- 📝 **Changelog Generation**: Automatic, customizable changelog creation
- 🏷️ **GitHub Release**: Automatic GitHub release creation with changelog extraction

## Install

Expand Down Expand Up @@ -68,6 +69,7 @@ Options:
- `--build`: Execute custom build script before release
- `--ignore-scripts`: Ignore npm scripts during release
- `--push-tag`: Automatically push git tag to remote
- `--create-github-release`: Create GitHub release after successful release

### Patching Failed Releases

Expand All @@ -85,6 +87,51 @@ Create customized changelogs:
ptk changelog --version 1.0.0 --beautify --commit
```

### Creating GitHub Releases

Create GitHub releases independently or as part of the release process:

```bash
# Create GitHub release independently
ptk github-release

# Create GitHub release for specific version
ptk github-release --version 1.0.0

# Preview what would be created (dry run)
ptk github-release --dry-run

# Create GitHub release during package release
ptk release --create-github-release

# Short alias
ptk gh-release --version 1.0.0
```

**Prerequisites**:
- GitHub CLI (`gh`) must be installed and authenticated
- Repository must be hosted on GitHub
- `CHANGELOG.md` file should exist with proper version sections

**Features**:
- Automatically extracts release notes from `CHANGELOG.md`
- Detects prerelease versions (containing `-`) and marks them appropriately
- Uses project's tag prefix (e.g., `@[email protected]`)
- Graceful failure - main release succeeds even if GitHub release fails

**Changelog Format Expected**:
```markdown
## [1.0.0](compare-link) (2025-01-01)

### Features

* **scope:** description ([#123](pr-link)) ([commit](commit-link)) [@author](author-link)

### Bug Fixes

* **scope:** fix description ([#124](pr-link)) ([commit](commit-link)) [@author](author-link)
```

## Advanced Guide

### Integration with package.json
Expand All @@ -95,7 +142,10 @@ Add these scripts to your root package.json:
{
"scripts": {
"dev": "ptk dev",
"release": "ptk release",
"release": "ptk release --push-tag",
"release:full": "ptk release --push-tag --create-github-release",
"release:dry": "ptk release --dry-run --create-github-release",
"github-release": "ptk github-release",
"changelog": "ptk changelog"
}
}
Expand All @@ -117,6 +167,28 @@ Enable custom build processes during release:
ptk release --build "npm run custom-build"
```

### Separating NPM and GitHub Releases

For more control, you can separate npm publishing from GitHub release creation:

```bash
# Step 1: Release packages to npm
ptk release --push-tag

# Step 2: Create GitHub release independently
ptk github-release

# Or in CI/CD pipeline
npm run release # Publishes to npm
npm run github-release # Creates GitHub release
```

This approach allows you to:
- Handle npm publishing failures independently
- Create GitHub releases from different environments
- Customize release timing and conditions
- Integrate with different CI/CD workflows

## License

MIT
43 changes: 39 additions & 4 deletions multimodal/tarko/pnpm-toolkit/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* CLI entry point for PTK
*/
import { cac } from 'cac';
import { dev, release, patch, changelog } from './index';
import { dev, release, patch, changelog, githubRelease } from './index';
import { logger } from './utils/logger';

/**
Expand Down Expand Up @@ -110,6 +110,9 @@ export function bootstrapCli() {
default: 'feat,fix',
},
)
.option('--create-github-release', 'Create GitHub release after successful release', {
default: false,
})
.alias('release')
.action((opts) => {
// Process filter options
Expand All @@ -127,7 +130,7 @@ export function bootstrapCli() {
// Patch command
cli
.command('p', 'Patch the failure of release process')
.option('--version <version>', 'Version (e.g. 1.0.0, 2.0.0-alpha.9)', {
.option('--patch-version <version>', 'Version (e.g. 1.0.0, 2.0.0-alpha.9)', {
// There is no default value here, because the default is read from package.json
})
.option('--tag <tag>', 'Tag (e.g. latest, next, beta)')
Expand All @@ -138,12 +141,18 @@ export function bootstrapCli() {
default: false,
})
.alias('patch')
.action((opts) => wrapCommand(patch, opts));
.action((opts) => {
// Map patch-version to version for compatibility
if (opts.patchVersion) {
opts.version = opts.patchVersion;
}
return wrapCommand(patch, opts);
});

// Changelog command
cli
.command('changelog', 'Create changelog')
.option('--version <version>', 'Version', {
.option('--changelog-version <version>', 'Version', {
// There is no default value here, because the default is read from package.json
})
.option('--tag-prefix <prefix>', 'Prefix for git tags', {
Expand Down Expand Up @@ -182,6 +191,10 @@ export function bootstrapCli() {
},
)
.action((opts) => {
// Map changelog-version to version for compatibility
if (opts.changelogVersion) {
opts.version = opts.changelogVersion;
}
// Process filter options
if (opts.filterScopes) {
opts.filterScopes = opts.filterScopes.split(',').map((s: string) => s.trim());
Expand All @@ -194,6 +207,28 @@ export function bootstrapCli() {
return wrapCommand(changelog, opts);
});

// GitHub Release command
cli
.command('github-release', 'Create GitHub release from changelog')
.option(
'--release-version <version>',
'Version to release (reads from package.json if not provided)',
)
.option('--tag-prefix <prefix>', 'Prefix for git tags', {
default: 'v',
})
.option('--dry-run', 'Preview execution without creating actual release', {
default: false,
})
.alias('gh-release')
.action((opts) => {
// Map release-version to version for compatibility
if (opts.releaseVersion) {
opts.version = opts.releaseVersion;
}
return wrapCommand(githubRelease, opts);
});

cli.version(pkg.version);
cli.help();

Expand Down
Loading