diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 528dad4..b70bcd4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,35 +12,21 @@ permissions: contents: read env: - PNPM_VERSION: 10.2.1 + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} jobs: ci: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - uses: pnpm/action-setup@v2 + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 with: - version: ${{ env.PNPM_VERSION }} - + version: ${{ vars.PNPM_VERSION }} - uses: actions/setup-node@v4 with: node-version-file: .nvmrc - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Build - run: pnpm build - - - name: Install browsers - run: cd packages/agent && pnpm exec playwright install --with-deps chromium - - - name: Test - env: - ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} - run: pnpm test - - - name: Lint - run: pnpm lint + - run: pnpm install --frozen-lockfile + - run: pnpm build + - run: cd packages/agent && pnpm exec playwright install --with-deps chromium + - run: pnpm test + - run: pnpm lint diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 95dfad8..258667c 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -22,39 +22,19 @@ jobs: id-token: write steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Google Auth - id: auth - uses: google-github-actions/auth@v2 + - uses: actions/checkout@v4 + - uses: google-github-actions/auth@v2 with: credentials_json: ${{ secrets.GCP_SA_KEY }} - - - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@v2 - - - name: Configure Docker for GCP - run: | - gcloud auth configure-docker $GAR_HOSTNAME --quiet - - - name: Set image path - run: echo "IMAGE_PATH=$GAR_HOSTNAME/$PROJECT_ID/shared-docker-registry/$SERVICE_NAME:${{ github.sha }}" >> $GITHUB_ENV - - - name: Build and push Docker container - run: | - cd packages/docs - docker build -t ${{ env.IMAGE_PATH }} . + - uses: google-github-actions/setup-gcloud@v2 + - run: gcloud auth configure-docker $GAR_HOSTNAME --quiet + - run: echo "IMAGE_PATH=$GAR_HOSTNAME/$PROJECT_ID/shared-docker-registry/$SERVICE_NAME:${{ github.sha }}" >> $GITHUB_ENV + - run: | + docker build -t ${{ env.IMAGE_PATH }} -f ./packages/docs/Dockerfile . docker push ${{ env.IMAGE_PATH }} - - - name: Deploy to Cloud Run - id: deploy - uses: google-github-actions/deploy-cloudrun@v2 + - uses: google-github-actions/deploy-cloudrun@v2 with: service: ${{ env.SERVICE_NAME }} region: ${{ env.REGION }} image: ${{ env.IMAGE_PATH }} flags: '--allow-unauthenticated' - - - name: Show Output - run: echo ${{ steps.deploy.outputs.url }} diff --git a/.github/workflows/issue-comment.yml b/.github/workflows/issue-comment.yml index 08d9070..74003ed 100644 --- a/.github/workflows/issue-comment.yml +++ b/.github/workflows/issue-comment.yml @@ -20,7 +20,7 @@ permissions: packages: read # Added in case you need to access GitHub packages env: - PNPM_VERSION: 10.2.1 + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} jobs: process-comment: @@ -30,46 +30,20 @@ jobs: contains(github.event.comment.body, '/mycoder') && github.event.comment.user.login == 'bhouston' steps: - - name: Extract prompt from comment - id: extract-prompt - run: | - echo "comment_url=${{ github.event.comment.html_url }}" >> $GITHUB_OUTPUT - echo "comment_id=${{ github.event.comment.id }}" >> $GITHUB_OUTPUT - - - name: Checkout repository - uses: actions/checkout@v3 - + - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version-file: .nvmrc - - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: - version: ${{ env.PNPM_VERSION }} - - - name: Install dependencies - run: pnpm install - - - name: Install browsers - run: cd packages/agent && pnpm exec playwright install --with-deps chromium - - - name: Configure Git - run: | + version: ${{ vars.PNPM_VERSION }} + - run: pnpm install + - run: cd packages/agent && pnpm exec playwright install --with-deps chromium + - run: | git config --global user.name "Ben Houston (via MyCoder)" git config --global user.email "neuralsoft@gmail.com" - - - run: - pnpm install -g mycoder - - # Auth GitHub CLI with the token - - name: Configure GitHub CLI - run: | + - run: pnpm install -g mycoder + - run: | echo "${{ secrets.GH_PAT }}" | gh auth login --with-token - # Verify auth status gh auth status - - - env: - ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} - run: | - echo "Running MyCoder for issue #${{ github.event.issue.number }} with prompt: ${{ steps.extract-prompt.outputs.prompt }}" - mycoder --upgradeCheck false --githubMode true --userPrompt false "On issue #${{ github.event.issue.number }} in comment ${{ steps.extract-prompt.outputs.comment_url }} the user invoked the mycoder CLI via /mycoder. Can you try to do what they requested or if it is unclear, respond with a comment to that affect to encourage them to be more clear." + - run: mycoder --upgradeCheck false --githubMode true --userPrompt false "On issue #${{ github.event.issue.number }} in comment ${{ steps.extract-prompt.outputs.comment_url }} the user invoked the mycoder CLI via /mycoder. Can you try to do what they requested or if it is unclear, respond with a comment to that affect to encourage them to be more clear." diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 27d3e52..1b329d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,8 +12,6 @@ permissions: packages: write env: - PNPM_VERSION: 10.2.1 - NODE_VERSION: 23 ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} jobs: @@ -21,48 +19,24 @@ jobs: name: Release runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: - fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} - - - name: Setup pnpm - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: - version: ${{ env.PNPM_VERSION }} - - - name: Setup Node.js - uses: actions/setup-node@v4 + version: ${{ vars.PNPM_VERSION }} + - uses: actions/setup-node@v4 with: - node-version: ${{ env.NODE_VERSION }} - cache: 'pnpm' - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Build - run: pnpm build - - - name: Install browsers - run: cd packages/agent && pnpm exec playwright install --with-deps chromium - - - name: Test - run: pnpm test - - - name: Debug - Show recent commits - run: git log -n 10 --pretty=format:"%h %s" --date=short - - - name: Debug - Run verify-release-config - run: pnpm verify-release-config - - - name: Configure Git - run: | + node-version-file: .nvmrc + - run: pnpm install --frozen-lockfile + - run: pnpm build + - run: cd packages/agent && pnpm exec playwright install --with-deps chromium + - run: pnpm test + - run: pnpm verify-release-config + - run: | git config --global user.email "neuralsoft@gmail.com" git config --global user.name "Ben Houston (via GitHub Actions)" - - - name: Release - env: + - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: pnpm release diff --git a/packages/docs/Dockerfile b/packages/docs/Dockerfile index e05f3e4..da56fd8 100644 --- a/packages/docs/Dockerfile +++ b/packages/docs/Dockerfile @@ -11,4 +11,5 @@ RUN pnpm --filter mycoder-docs build ENV PORT=8080 EXPOSE ${PORT} -CMD ["pnpm", "--filter", "mycoder-docs", "start"] \ No newline at end of file +CMD ["pnpm", "--filter", "mycoder-docs", "start", "--port", "8080", "--no-open"] + diff --git a/packages/docs/package.json b/packages/docs/package.json index ac0d019..8088158 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -1,5 +1,5 @@ { - "name": "@mycoder/docs", + "name": "mycoder-docs", "version": "0.10.1", "private": true, "packageManager": "pnpm@10.2.1",