Skip to content

Commit 8574e94

Browse files
committed
add release for npm-app-legacy
1 parent 533da58 commit 8574e94

File tree

7 files changed

+814
-0
lines changed

7 files changed

+814
-0
lines changed
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
name: Release Legacy (NPM App)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version_type:
7+
description: 'Version bump type'
8+
required: true
9+
default: 'prepatch'
10+
type: choice
11+
options:
12+
- prepatch
13+
- minor
14+
- major
15+
16+
permissions:
17+
contents: write
18+
19+
jobs:
20+
# First job: Prepare production release
21+
prepare-and-commit-prod:
22+
runs-on: ubuntu-latest
23+
outputs:
24+
new_version: ${{ steps.bump_version.outputs.new_version }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
token: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- uses: ./.github/actions/setup-project
31+
32+
- name: Calculate and update production version
33+
id: bump_version
34+
run: |
35+
cd npm-app/release
36+
37+
# Get current version and bump it
38+
CURRENT_VERSION=$(bun -e "console.log(require('./package.json').version)")
39+
echo "Current version: $CURRENT_VERSION"
40+
41+
# Bump version based on input
42+
npm version ${{ inputs.version_type }} --preid=legacy --no-git-tag-version
43+
NEW_VERSION=$(bun -e "console.log(require('./package.json').version)")
44+
45+
echo "New production version: $NEW_VERSION"
46+
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
47+
48+
- name: Configure git
49+
run: |
50+
git config --global user.name "github-actions[bot]"
51+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
52+
53+
- name: Commit and push version bumpAdd commentMore actions
54+
run: |
55+
git stash
56+
git pull --rebase origin main
57+
git stash pop
58+
git add npm-app/release/package.json
59+
git commit -m "Bump version to ${{ steps.bump_version.outputs.new_version }}"
60+
git push
61+
62+
- name: Create and push production tag
63+
run: |
64+
git tag "v${{ steps.bump_version.outputs.new_version }}"
65+
git push origin "v${{ steps.bump_version.outputs.new_version }}"
66+
67+
- name: Upload updated package
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: updated-package
71+
path: npm-app/release/
72+
73+
build-prod-binaries:
74+
needs: prepare-and-commit-prod
75+
uses: ./.github/workflows/npm-app-release-build.yml
76+
with:
77+
binary-name: codebuff
78+
new-version: ${{ needs.prepare-and-commit-prod.outputs.new_version }}
79+
artifact-name: updated-package
80+
checkout-ref: ${{ github.sha }}
81+
env-overrides: '{"NEXT_PUBLIC_CODEBUFF_BACKEND_URL": "manicode-backend.onrender.com", "NEXT_PUBLIC_CB_ENVIRONMENT": "prod"}'
82+
secrets: inherit
83+
84+
# Create GitHub release with all binaries
85+
create-prod-release:
86+
needs: [prepare-and-commit-prod, build-prod-binaries]
87+
runs-on: ubuntu-latest
88+
steps:
89+
- uses: actions/checkout@v4
90+
91+
- name: Download all binary artifacts
92+
uses: actions/download-artifact@v4
93+
with:
94+
path: binaries/
95+
96+
- name: Download updated package
97+
uses: actions/download-artifact@v4
98+
with:
99+
name: updated-package
100+
path: npm-app/release/
101+
102+
- name: Create GitHub Release
103+
uses: softprops/action-gh-release@v1
104+
with:
105+
tag_name: v${{ needs.prepare-and-commit-prod.outputs.new_version }}
106+
name: Release v${{ needs.prepare-and-commit-prod.outputs.new_version }}
107+
prerelease: false
108+
body: |
109+
## Codebuff v${{ needs.prepare-and-commit-prod.outputs.new_version }}
110+
111+
Binary releases for all supported platforms.
112+
113+
### Installation
114+
```bash
115+
npm install -g codebuff
116+
```
117+
118+
### Platform Binaries
119+
- `codebuff-linux-x64.tar.gz` - Linux x64
120+
- `codebuff-linux-arm64.tar.gz` - Linux ARM64
121+
- `codebuff-darwin-x64.tar.gz` - macOS Intel
122+
- `codebuff-darwin-arm64.tar.gz` - macOS Apple Silicon
123+
- `codebuff-win32-x64.tar.gz` - Windows x64
124+
files: |
125+
binaries/*/codebuff-*
126+
repository: CodebuffAI/codebuff-community
127+
token: ${{ secrets.CODEBUFF_GITHUB_TOKEN }}
128+
129+
# Publish npm package
130+
publish-prod-npm:
131+
needs: [prepare-and-commit-prod, create-prod-release]
132+
runs-on: ubuntu-latest
133+
permissions:
134+
contents: read
135+
id-token: write
136+
steps:
137+
- uses: actions/checkout@v4
138+
139+
- name: Download updated package
140+
uses: actions/download-artifact@v4
141+
with:
142+
name: updated-package
143+
path: npm-app/release/
144+
145+
- name: Set up Node.js for npm publishing
146+
uses: actions/setup-node@v4
147+
with:
148+
node-version: 20
149+
registry-url: https://registry.npmjs.org/
150+
151+
- name: Publish to npm
152+
run: |
153+
cd npm-app/release
154+
npm publish --access public --tag legacy
155+
env:
156+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

npm-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"typecheck": "tsc --noEmit -p .",
2525
"build": "bun run scripts/build-binary.js codebuff $(node -p \"require('./release/package.json').version\")",
2626
"release": "bun run scripts/release.js",
27+
"release-legacy": "bun run scripts/release-legacy.js",
2728
"start-bin": "bun run build && ./bin/codebuff",
2829
"start": "bun run src/index.ts --cwd ..",
2930
"format": "prettier --write \"**/*.{ts,tsx,json,md}\"",

npm-app/release-legacy/README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# The most powerful coding agent
2+
3+
Codebuff is a CLI tool that writes code for you.
4+
5+
1. Run `codebuff` from your project directory
6+
2. Tell it what to do
7+
3. It will read and write to files and run commands to produce the code you want
8+
9+
Note: Codebuff will run commands in your terminal as it deems necessary to fulfill your request.
10+
11+
## Installation
12+
13+
To install Codebuff legacy, run:
14+
15+
```bash
16+
npm install -g codebuff@legacy
17+
```
18+
19+
(Use `sudo` if you get a permission error.)
20+
21+
## Usage
22+
23+
After installation, you can start Codebuff by running:
24+
25+
```bash
26+
codebuff [project-directory]
27+
```
28+
29+
If no project directory is specified, Codebuff will use the current directory.
30+
31+
Once running, simply chat with Codebuff to say what coding task you want done.
32+
33+
## Features
34+
35+
- Understands your whole codebase
36+
- Creates and edits multiple files based on your request
37+
- Can run your tests or type checker or linter; can install packages
38+
- It's powerful: ask Codebuff to keep working until it reaches a condition and it will.
39+
40+
Our users regularly use Codebuff to implement new features, write unit tests, refactor code,write scripts, or give advice.
41+
42+
## Knowledge Files
43+
44+
To unlock the full benefits of modern LLMs, we recommend storing knowledge alongside your code. Add a `knowledge.md` file anywhere in your project to provide helpful context, guidance, and tips for the LLM as it performs tasks for you.
45+
46+
Codebuff can fluently read and write files, so it will add knowledge as it goes. You don't need to write knowledge manually!
47+
48+
Some have said every change should be paired with a unit test. In 2024, every change should come with a knowledge update!
49+
50+
## Tips
51+
52+
1. Type '/help' or just '/' to see available commands.
53+
2. Create a `knowledge.md` file and collect specific points of advice. The assistant will use this knowledge to improve its responses.
54+
3. Type `undo` or `redo` to revert or reapply file changes from the conversation.
55+
4. Press `Esc` or `Ctrl+C` while Codebuff is generating a response to stop it.
56+
57+
## Troubleshooting
58+
59+
If you are getting permission errors during installation, try using sudo:
60+
61+
```
62+
sudo npm install -g codebuff
63+
```
64+
65+
If you still have errors, it's a good idea to [reinstall Node](https://nodejs.org/en/download).
66+
67+
## Feedback
68+
69+
We value your input! Please email your feedback to `founders@codebuff.com`. Thank you for using Codebuff!

0 commit comments

Comments
 (0)