mirror of
https://github.com/jasonxu114514/opencode2api.git
synced 2026-12-05 08:02:53 +00:00
refactor: strip paid tiers, webui, rotation, and docker; optimize anonymous free concurrency
This commit is contained in:
1 parent
83d623d541
commit
80a8da3195
65 files changed
+648
-11927
No files matched your search
@@ -34,16 +34,13 @@ jobs:
|
||||
run: go build -trimpath ./cmd/opencode2api
|
||||
|
||||
format:
|
||||
name: Formatting and WebUI syntax
|
||||
name: Go formatting
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
- name: Check Go formatting
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -52,11 +49,3 @@ jobs:
|
||||
printf '%s\n' "$unformatted"
|
||||
exit 1
|
||||
fi
|
||||
- name: Check WebUI syntax
|
||||
shell: bash
|
||||
run: |
|
||||
for f in webui/js/*.js webui/js/pages/*.js; do
|
||||
node --input-type=module --check < "$f" || { echo "syntax error: $f" >&2; exit 1; }
|
||||
done
|
||||
- name: Check container entrypoint syntax
|
||||
run: sh -n docker-entrypoint.sh
|
||||
@@ -1,4 +1,4 @@
|
||||
name: Release binaries and GHCR image
|
||||
name: Release binaries
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -24,7 +24,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
release_tag: ${{ steps.metadata.outputs.release_tag }}
|
||||
image_name: ${{ steps.metadata.outputs.image_name }}
|
||||
steps:
|
||||
- name: Resolve release metadata
|
||||
id: metadata
|
||||
@@ -42,7 +41,6 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
echo "release_tag=$release_tag" >> "$GITHUB_OUTPUT"
|
||||
echo "image_name=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
verify:
|
||||
name: Verify source
|
||||
@@ -148,63 +146,9 @@ jobs:
|
||||
dist/${{ steps.metadata.outputs.package_name }}.${{ matrix.archive }}.sha256
|
||||
if-no-files-found: error
|
||||
|
||||
container:
|
||||
name: Publish GHCR image
|
||||
needs: [prepare, verify]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Check out source
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- 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: Generate image metadata
|
||||
id: image_metadata
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ needs.prepare.outputs.image_name }}
|
||||
tags: |
|
||||
type=raw,value=${{ needs.prepare.outputs.release_tag }}
|
||||
type=semver,pattern={{version}},value=${{ needs.prepare.outputs.release_tag }}
|
||||
type=semver,pattern={{major}}.{{minor}},value=${{ needs.prepare.outputs.release_tag }},enable=${{ !contains(needs.prepare.outputs.release_tag, '-') }}
|
||||
type=semver,pattern={{major}},value=${{ needs.prepare.outputs.release_tag }},enable=${{ !contains(needs.prepare.outputs.release_tag, '-') }}
|
||||
labels: |
|
||||
org.opencontainers.image.title=opencode2api
|
||||
org.opencontainers.image.description=OpenAI-compatible API gateway for OpenCode Zen and Go
|
||||
org.opencontainers.image.licenses=GPL-3.0-or-later
|
||||
|
||||
- name: Build and push image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.image_metadata.outputs.tags }}
|
||||
labels: ${{ steps.image_metadata.outputs.labels }}
|
||||
build-args: |
|
||||
VERSION=${{ needs.prepare.outputs.release_tag }}
|
||||
cache-from: type=gha,scope=container
|
||||
cache-to: type=gha,mode=max,scope=container
|
||||
provenance: mode=max
|
||||
sbom: true
|
||||
|
||||
release:
|
||||
name: Publish GitHub Release
|
||||
needs: [prepare, build, container]
|
||||
needs: [prepare, build]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
Reference in new issue
Block a user