Add workflows

This commit is contained in:
Onur Solmaz 2025-06-05 17:28:12 +02:00
parent f815760d73
commit 2ad995874a
4 changed files with 91 additions and 1 deletions

32
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,32 @@
name: Build and Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm test

52
.github/workflows/publish.yml vendored Normal file
View file

@ -0,0 +1,52 @@
name: Publish Package
on:
push:
tags:
- "v*" # Version tags: v1.0.0, v1.0.1, etc.
permissions:
contents: read
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Extract version from tag and update package.json
run: |
# Get the version from the tag (remove 'v' prefix)
TAG_VERSION=${GITHUB_REF#refs/tags/v}
echo "Tag version: $TAG_VERSION"
# Update package.json with the version from the tag
npm version $TAG_VERSION --no-git-tag-version
echo "Version updated in package.json to: $TAG_VERSION"
# Verify the change
cat package.json | grep '"version"'
- name: Build
run: npm run build
- name: Test
run: npm test
- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

View file

@ -1,5 +1,5 @@
{
"name": "claude-code-sandbox",
"name": "@textcortex/claude-code-sandbox",
"version": "0.1.0",
"description": "Run Claude Code as an autonomous agent in Docker containers with git integration",
"main": "dist/index.js",
@ -51,6 +51,7 @@
"@types/dockerode": "^3.3.23",
"@types/fs-extra": "^11.0.4",
"@types/inquirer": "^9.0.8",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.5",
"@types/puppeteer": "^5.4.7",
"@types/socket.io-client": "^1.4.36",

5
test/dummy.test.js Normal file
View file

@ -0,0 +1,5 @@
describe("Dummy Test", () => {
it("should pass", () => {
expect(true).toBe(true);
});
});