Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
122 changes: 120 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,127 @@ name: Manual Release

on:
workflow_dispatch:
inputs:
version_bump:
description: 'Select version bump type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major

permissions:
contents: write

jobs:
placeholder:
# Bumps the version, tags it, and creates the baseline GitHub Release
create-release:
name: Cut Release Tag
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.version.outputs.tag }}
steps:
# generate a short-lived token from the CI app
- name: Generate GitHub App Token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

# pass that token to checkout to authorize pushes with protection rule bypass
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.generate-token.outputs.token }}

- name: Configure Git User
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Bump Version & Tag
id: version
working-directory: vscode-extension
run: |
git checkout ${{ github.ref_name }}
NEW_VERSION=$(npm version ${{ inputs.version_bump }} --no-git-tag-version)
echo "tag=$NEW_VERSION" >> $GITHUB_OUTPUT

git add package.json package-lock.json
git commit -m "chore: release $NEW_VERSION"
git tag $NEW_VERSION

- name: Push commit and tag to main
run: |
git push origin ${{ github.ref_name }}
git push origin ${{ steps.version.outputs.tag }}

- name: Create Base GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Create an empty release container marked as latest
gh release create ${{ steps.version.outputs.tag }} \
--title "${{ steps.version.outputs.tag }}" \
--generate-notes \
--latest

# Builds and appends the VS Code Extension asset
package-vscode:
name: Build & Upload VS Code Extension
needs: create-release
runs-on: ubuntu-latest
defaults:
run:
working-directory: vscode-extension
steps:
- run: echo "Placeholder workflow to enable UI button."
- uses: actions/checkout@v4
with:
ref: ${{ needs.create-release.outputs.tag }}

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: vscode-extension/package-lock.json

- run: npm ci
- run: npm run compile
- run: npx vsce package --out vscode-extension.vsix

# Use softprops to cleanly append the asset to the existing tag
- name: Upload VSIX to Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.create-release.outputs.tag }}
files: vscode-extension/vscode-extension.vsix

# Builds and appends the OpenCode Plugin asset
package-opencode:
name: Build & Upload OpenCode Plugin
needs: create-release
runs-on: ubuntu-latest
defaults:
run:
working-directory: opencode-plugin
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.create-release.outputs.tag }}

- uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- run: bun install
- run: bun run build

- name: Upload OpenCode Asset to Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.create-release.outputs.tag }}
files: opencode-plugin/dist/tracybot-oc.js

63 changes: 55 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,67 @@ cd opencode-plugin
bun run deploy
```

### 3. Run the VS Code Extension
### 3. Install the VSCode Extension

There are 2 different ways of using our extension
#### Automated installation (recommended)

Option 1. Run
##### Linux & macOS

In the terminal, run
```bash
bash -c "curl -Ls -o tracy.vsix https://github.com/TracyTeam/tracybot/releases/latest/download/vscode-extension.vsix && code --install-extension tracy.vsix && rm tracy.vsix"
curl -fsSL https://raw.githubusercontent.com/TracyTeam/tracybot/main/vscode-extension/install.sh | bash
```

Option 2. Manual install
1. Download packaged extension
##### Windows

In Powershell, run
```powershell
powershell -Command "irm https://raw.githubusercontent.com/TracyTeam/tracybot/main/install.ps1 | iex"
```

#### Manual installation

Alternatively, the extension can be installed manually.

1. Download the packaged extension from the [latest release](https://github.com/TracyTeam/tracybot/releases/latest)
or with
```bash
bash -c "curl -Ls -o tracy.vsix https://github.com/TracyTeam/tracybot/releases/latest/download/vscode-extension.vsix"
curl -fsSL -o tracy.vsix https://github.com/TracyTeam/tracybot/releases/latest/download/vscode-extension.vsix
```
Then open VSCode and go to EXTENSIONS (left side) --> Click on the 3 dots --> Install from vsix and choose the downloaded .vsix file

2. In VSCode, go to `EXTENSIONS tab --> Click on the 3 dots --> Install from vsix` and choose the downloaded .vsix file

### 4. Install the OpenCode Plugin

If you wish to use the Tracybot OpenCode integration, the OpenCode plugin needs to be installed.

#### From VSCode

If the VSCode extension is installed, you will be prompted to install the plugin if it was not yet installed.
You may choose to install it globally (global OpenCode plugin directory), or per project (.opencode directory in the project).

#### Automated Installation

To install the plugin from the terminal, run:

##### Linux & macOS
```bash
curl -fsSL https://raw.githubusercontent.com/TracyTeam/tracybot/main/opencode-plugin/install.sh | bash
```

##### Windows
```powershell
powershell -Command "irm https://raw.githubusercontent.com/TracyTeam/tracybot/main/opencode-plugin/install.sh | iex"
```

#### Manual Installation

1. Download the built plugin (`tracybot-oc.js`) from the [latest release](https://github.com/TracyTeam/tracybot/releases/latest)
or with
```bash
curl -fsSL -o tracy.vsix https://github.com/TracyTeam/tracybot/releases/latest/download/tracybot-oc.js
```


2. Place the downloaded file into the following directory: `$HOME/.config/opencode/plugin`

28 changes: 28 additions & 0 deletions opencode-plugin/install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
$ErrorActionPreference = "Stop"

$PluginDir = Join-Path $env:USERPROFILE ".config\opencode\plugin"
$DestPath = Join-Path $PluginDir "tracybot-oc.js"
$AssetUrl = "https://github.com/TracyTeam/tracybot/releases/latest/download/tracybot-oc.js"

$TmpFile = Join-Path $env:TEMP "tracybot-oc_$(New-Guid).js"

try {
Write-Host "Downloading latest OpenCode Tracy plugin..."
Invoke-WebRequest -Uri $AssetUrl -OutFile $TmpFile

Write-Host "Ensuring plugin directory exists..."
if (-not (Test-Path $PluginDir)) {
New-Item -ItemType Directory -Path $PluginDir -Force | Out-Null
}

Write-Host "Installing plugin..."
Move-Item -Path $TmpFile -Destination $DestPath -Force

Write-Host "OpenCode Tracy plugin installed successfully!" -ForegroundColor Green
}
finally {
# 3. Guarantee temp file cleanup if execution is interrupted
if (Test-Path $TmpFile) {
Remove-Item -Path $TmpFile -Force
}
}
22 changes: 22 additions & 0 deletions opencode-plugin/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -e

PLUGIN_DIR="$HOME/.config/opencode/plugin"
DEST_PATH="$PLUGIN_DIR/tracybot-oc.js"
ASSET_URL="https://github.com/TracyTeam/tracybot/releases/latest/download/tracybot-oc.js"

TMP_DIR=$(mktemp -d)
TMP_FILE="$TMP_DIR/tracybot-oc.js"

trap 'rm -rf "$TMP_DIR"' EXIT

echo "Downloading latest OpenCode Tracy plugin..."
curl -fsSL -o "$TMP_FILE" "$ASSET_URL"

echo "Ensuring plugin directory exists ($PLUGIN_DIR)..."
mkdir -p "$PLUGIN_DIR"

echo "Installing plugin..."
mv -f "$TMP_FILE" "$DEST_PATH"

echo "OpenCode Tracy plugin installed successfully!"
19 changes: 19 additions & 0 deletions vscode-extension/install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
$ErrorActionPreference = "Stop" # Exit immediately if a command fails

$VsixPath = Join-Path $env:TEMP "tracy_extension_$(New-Guid).vsix"

try {
Write-Host "Downloading latest Tracy extension..."
Invoke-WebRequest -Uri "https://github.com/TracyTeam/tracybot/releases/latest/download/vscode-extension.vsix" -OutFile $VsixPath

Write-Host "Installing extension in VS Code..."
code --install-extension $VsixPath

Write-Host "Tracy extension installed successfully!" -ForegroundColor Green
}
finally {
# 2. Guarantee cleanup happens from the Temp folder
if (Test-Path $VsixPath) {
Remove-Item -Path $VsixPath -Force
}
}
15 changes: 15 additions & 0 deletions vscode-extension/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -e

TMP_DIR=$(mktemp -d)
VSIX_PATH="$TMP_DIR/tracy.vsix"

trap 'rm -rf "$TMP_DIR"' EXIT

echo "Downloading latest Tracy extension..."
curl -fsSL -o "$VSIX_PATH" https://github.com/TracyTeam/tracybot/releases/latest/download/vscode-extension.vsix

echo "Installing extension in VS Code..."
code --install-extension "$VSIX_PATH"

echo "Tracy extension installed successfully!"
4 changes: 2 additions & 2 deletions vscode-extension/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "tracybot-extension",
"displayName": "tracybot-extension",
"description": "",
"version": "0.0.1",
"version": "0.0.2",
"engines": {
"vscode": "^1.110.0"
},
Expand Down
2 changes: 1 addition & 1 deletion vscode-extension/src/pluginCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as path from 'path';
import { homedir } from 'os';

const PLUGIN_FILENAME = 'tracybot-oc.js';
const PLUGIN_URL = 'https://github.com/TracyTeam/tracybot/releases/download/latest/tracybot-oc.js';
const PLUGIN_URL = 'https://github.com/TracyTeam/tracybot/releases/latest/download/tracybot-oc.js';
const SKIP_CHECK_KEY = 'tracybot.skipPluginCheck';

const Actions = {
Expand Down
Loading