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
46 changes: 46 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish to NPM
on:
push:
branches: ["main"]
workflow_dispatch:

env:
AWS_REGION: us-east-1

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: install-aws-cli
uses: unfor19/install-aws-cli-action@v1
with:
version: 2 # default
verbose: false # default
arch: amd64 # allowed values: amd64, arm64
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- uses: actions/setup-node@v3
with:
node-version: 18
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
- run: |
npm run co:login
latest_published_version=$(npm show @roo-dev/roo-cline version)
current_package_version=$(node -p "require('./package.json').version")
echo "Latest published version: $latest_published_version"
echo "Current package version: $current_package_version"
if [ "$latest_published_version" == "$current_package_version" ]; then
echo "Latest version is already published to NPM"
else
npm install
npm run vsix
npm publish
echo "Successfully published to NPM"
fi
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ node_modules
.vscode-test/

.DS_Store

.npmrc
Binary file added assets/icons/icon_Roo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "roo-cline",
"displayName": "Roo Cline",
"description": "Autonomous coding agent right in your IDE, capable of creating/editing files, running commands, using the browser, and more with your permission every step of the way.",
"version": "2.0.1",
"icon": "assets/icons/icon.png",
"version": "2.0.2",
"icon": "assets/icons/icon_Roo.png",
"galleryBanner": {
"color": "#617A91",
"theme": "dark"
Expand All @@ -12,7 +12,7 @@
"vscode": "1.93.1"
},
"author": {
"name": "Cline Bot Inc."
"name": "Roo Vet"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -131,7 +131,9 @@
"start:webview": "cd webview-ui && npm run start",
"build:webview": "cd webview-ui && npm run build",
"test:webview": "cd webview-ui && npm run test",
"publish:marketplace": "vsce publish && ovsx publish"
"publish:marketplace": "vsce publish && ovsx publish",
"co:login": "scripts/codeartifact-login.sh",
"install:cline": "scripts/install-cline-latest.sh"
},
"devDependencies": {
"@types/diff": "^5.2.1",
Expand Down Expand Up @@ -181,5 +183,9 @@
"tree-sitter-wasms": "^0.1.11",
"turndown": "^7.2.0",
"web-tree-sitter": "^0.22.6"
}
},
"files": [
"bin/roo-cline-2.0.2.vsix",
"assets/icons/icon_Roo.png"
]
}
15 changes: 15 additions & 0 deletions scripts/codeartifact-login.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
AWS_VERSION=$(aws --version 2>&1 | cut -d/ -f2 | cut -d. -f1)
echo "aws-cli/$AWS_VERSION"

if [ "$AWS_VERSION" -lt 2 ]; then
echo "Skipping .npmrc generation because AWS CLI version is less than 2"
else
echo "Generating .npmrc"
REPO_ENDPOINT=$(aws codeartifact get-repository-endpoint --domain roo --repository roo-dev --format npm | jq -r '.repositoryEndpoint')
echo "registry=$REPO_ENDPOINT" > .npmrc

CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token --domain roo --query authorizationToken --output text)

REPO_PATH=$(echo $REPO_ENDPOINT | sed 's/https://g')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sed command is incorrect. It should replace 'https://' with an empty string, not 'https'.

Suggested change
REPO_PATH=$(echo $REPO_ENDPOINT | sed 's/https://g')
REPO_PATH=$(echo $REPO_ENDPOINT | sed 's/https:\/\///g')

echo "$REPO_PATH:_authToken=$CODEARTIFACT_AUTH_TOKEN" >> .npmrc
fi
20 changes: 20 additions & 0 deletions scripts/install-cline-latest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# Install roo-cline
echo "Installing roo-cline..."
npm install roo-cline

# Get version of installed roo-cline
VERSION=$(npm list roo-cline | grep roo-cline@ | cut -d'@' -f2 | tail -n1)
echo "Installed version: $VERSION"

# Install extension in Cursor
echo "Installing Cursor extension..."
echo $VERSION
cursor --install-extension "node_modules/roo-cline/bin/roo-cline-$VERSION.vsix"

# Uninstall roo-cline
echo "Cleaning up..."
npm uninstall roo-cline

echo "Done!"