Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Node tests
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm

- name: Install
run: npm ci

- name: Syntax check
run: for f in src/*.js; do node --check "$f"; done

- name: Test
run: npm test
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release image

# 推 release 分支或打 v*.*.* tag 时构建镜像并推送到 GitHub Container Registry。
# 本地拉取:docker pull ghcr.io/wthsama/opencode-codex-bridge:release
on:
push:
branches: [release]
tags: ["v*.*.*"]

permissions:
contents: read
packages: write

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false

env:
IMAGE: ghcr.io/${{ github.repository }}

jobs:
build:
name: Build and push
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm

- name: Install
run: npm ci

- name: Test
run: npm test

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=release,enable=${{ github.ref == 'refs/heads/release' }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/release' }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
106 changes: 28 additions & 78 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
"main": "src/index.js",
"scripts": {
"start": "node src/index.js",
"login": "node src/cli-login.js"
"login": "node src/cli-login.js",
"test": "node test/smoke.js"
},
"engines": {
"node": ">=18"
},
"dependencies": {
"express": "^4.21.0",
"https-proxy-agent": "^9.1.0"
"undici": "^6.21.0"
}
}
Loading
Loading