diff --git a/.github/workflows/check-openapi.yml b/.github/workflows/check-openapi.yml new file mode 100644 index 0000000..94a5833 --- /dev/null +++ b/.github/workflows/check-openapi.yml @@ -0,0 +1,37 @@ +name: Check OpenAPI Schema + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + check-openapi: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 'stable' + + - name: Generate OpenAPI schema + run: go run main.go server --print-openapi dummy > generated-openapi.json + + - name: Check OpenAPI schema + run: | + if [ ! -f "openapi.json" ]; then + echo "::warning::openapi.json does not exist" + exit 1 + fi + + # Compare schemas + if ! cmp -s openapi.json generated-openapi.json; then + echo "::error::The openapi.json file is out of sync with the generated schema" + echo "Diff:" + diff -u openapi.json generated-openapi.json || true + exit 1 + fi + echo "OpenAPI schema is up to date" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 980c247..2a8a9e8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,21 +3,34 @@ name: Build Release Binaries on: release: types: [created, published, edited] - push: - branches: [ main ] - workflow_dispatch: - inputs: - create-artifact: - description: 'Create build artifact' - required: true - type: boolean - default: false jobs: build: - name: Build Release Binaries - runs-on: depot-ubuntu-22.04-4 - if: ${{ github.repository_owner == 'coder' }} + name: Build for ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + artifact_name: agentapi + asset_name: agentapi-linux-amd64 + goarch: amd64 + goos: linux + - os: macos-latest + artifact_name: agentapi + asset_name: agentapi-darwin-amd64 + goarch: amd64 + goos: darwin + - os: macos-latest + artifact_name: agentapi + asset_name: agentapi-darwin-arm64 + goarch: arm64 + goos: darwin + - os: windows-latest + artifact_name: agentapi.exe + asset_name: agentapi-windows-amd64.exe + goarch: amd64 + goos: windows steps: - uses: actions/checkout@v4 @@ -27,42 +40,18 @@ jobs: with: go-version: 'stable' - - name: Set up Bun - uses: oven-sh/setup-bun@v2 - - - name: Install Chat Dependencies - run: cd chat && bun install + - name: Build + env: + GOOS: ${{ matrix.goos }} + GOARCH: ${{ matrix.goarch }} + run: go build -v -o ${{ matrix.artifact_name }} . - - name: Build and Upload + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - shell: bash - run: | - build_variants=( - "linux amd64 agentapi-linux-amd64" - "darwin amd64 agentapi-darwin-amd64" - "darwin arm64 agentapi-darwin-arm64" - "windows amd64 agentapi-windows-amd64.exe" - ) - - for variant in "${build_variants[@]}"; do - read -r goos goarch artifact_name <<< "$variant" - - echo "Building for GOOS=$goos GOARCH=$goarch..." - GOOS=$goos GOARCH=$goarch BINPATH="out/$artifact_name" make build - done - - - name: Upload Build Artifact - if: ${{ inputs.create-artifact }} - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: - name: agentapi-build - path: ${{ github.workspace }}/out - retention-days: 7 - - - name: Upload Release Assets - if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/main' }} - run: gh release upload "$RELEASE_TAG" "$GITHUB_WORKSPACE"/out/* --clobber - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RELEASE_TAG: ${{ github.event_name == 'release' && github.event.release.tag_name || 'preview' }} + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./${{ matrix.artifact_name }} + asset_name: ${{ matrix.asset_name }} + asset_content_type: application/octet-stream \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5b47947..566bb3b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,4 @@ output-*.log snapshot-*.log snapshot2-*.log .aider* -schema.yaml -**/.claude/settings.local.json -out +schema.yaml \ No newline at end of file diff --git a/lib/httpapi/chat/marker b/.nojekyll similarity index 100% rename from lib/httpapi/chat/marker rename to .nojekyll diff --git a/.vscode/settings.json b/.vscode/settings.json index 14cb7f6..ebfde9a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,3 @@ { "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode", - "[go]": { - "editor.defaultFormatter": "golang.go" - } } \ No newline at end of file diff --git a/404.html b/404.html new file mode 100644 index 0000000..d2b9ee6 --- /dev/null +++ b/404.html @@ -0,0 +1 @@ +