@hafez/claude-code-router 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,85 @@
1
+ name: Build and Publish Docker Image
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*.*.*'
7
+ workflow_dispatch:
8
+
9
+ env:
10
+ DOCKER_IMAGE: musistudio/claude-code-router
11
+
12
+ jobs:
13
+ build-and-push:
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ contents: read
17
+ packages: write
18
+ id-token: write
19
+
20
+ steps:
21
+ - name: Checkout repository
22
+ uses: actions/checkout@v4
23
+
24
+ - name: Setup Node.js
25
+ uses: actions/setup-node@v4
26
+ with:
27
+ node-version: 20
28
+
29
+ - name: Install pnpm
30
+ uses: pnpm/action-setup@v4
31
+ with:
32
+ version: latest
33
+
34
+ - name: Get version
35
+ id: version
36
+ run: |
37
+ if [[ $GITHUB_REF == refs/tags/* ]]; then
38
+ VERSION=${GITHUB_REF#refs/tags/}
39
+ else
40
+ VERSION=$(node -p "require('./package.json').version")
41
+ fi
42
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
43
+ echo "Docker image version: $VERSION"
44
+
45
+ - name: Install dependencies
46
+ run: pnpm install --frozen-lockfile
47
+
48
+ - name: Build packages
49
+ run: |
50
+ pnpm build
51
+
52
+ - name: Set up Docker Buildx
53
+ uses: docker/setup-buildx-action@v3
54
+
55
+ - name: Login to Docker Hub
56
+ uses: docker/login-action@v3
57
+ with:
58
+ username: ${{ secrets.DOCKER_USERNAME }}
59
+ password: ${{ secrets.DOCKER_PASSWORD }}
60
+
61
+ - name: Extract metadata
62
+ id: meta
63
+ uses: docker/metadata-action@v5
64
+ with:
65
+ images: ${{ env.DOCKER_IMAGE }}
66
+ tags: |
67
+ type=semver,pattern={{version}},value=${{ steps.version.outputs.version }}
68
+ type=semver,pattern={{major}}.{{minor}},value=${{ steps.version.outputs.version }}
69
+ type=raw,value=latest
70
+ type=sha
71
+
72
+ - name: Build and push Docker image
73
+ uses: docker/build-push-action@v5
74
+ with:
75
+ context: .
76
+ file: ./packages/server/Dockerfile
77
+ platforms: linux/amd64,linux/arm64
78
+ push: true
79
+ tags: ${{ steps.meta.outputs.tags }}
80
+ labels: ${{ steps.meta.outputs.labels }}
81
+ cache-from: type=gha
82
+ cache-to: type=gha,mode=max
83
+
84
+ - name: Image digest
85
+ run: echo "Image pushed with digest ${{ steps.meta.outputs.digest }}"
@@ -0,0 +1,55 @@
1
+ name: Deploy Docs to GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ paths:
8
+ - 'docs/**'
9
+ - '.github/workflows/docs.yml'
10
+ workflow_dispatch:
11
+
12
+ permissions:
13
+ contents: read
14
+ pages: write
15
+ id-token: write
16
+
17
+ concurrency:
18
+ group: pages
19
+ cancel-in-progress: false
20
+
21
+ jobs:
22
+ build:
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - name: Checkout
26
+ uses: actions/checkout@v4
27
+
28
+ - name: Setup Node.js
29
+ uses: actions/setup-node@v4
30
+ with:
31
+ node-version: 20
32
+
33
+ - name: Install dependencies
34
+ working-directory: ./docs
35
+ run: npm install
36
+
37
+ - name: Build Docusaurus
38
+ working-directory: ./docs
39
+ run: npm run build
40
+
41
+ - name: Upload artifact
42
+ uses: actions/upload-pages-artifact@v3
43
+ with:
44
+ path: ./docs/build
45
+
46
+ deploy:
47
+ environment:
48
+ name: github-pages
49
+ url: ${{ steps.deployment.outputs.page_url }}
50
+ runs-on: ubuntu-latest
51
+ needs: build
52
+ steps:
53
+ - name: Deploy to GitHub Pages
54
+ id: deployment
55
+ uses: actions/deploy-pages@v4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 musistudio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.