Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
25aaefc6
authored
Mar 13, 2025
by
1808837298@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: Update GitHub Actions workflows and refactor adaptor logic for Docker image builds
parent
b5d644d5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
22 deletions
+21
-22
.github/workflows/docker-image-amd64.yml
+5
-5
.github/workflows/docker-image-arm64.yml
+7
-8
relay/channel/dify/adaptor.go
+9
-9
No files found.
.github/workflows/docker-image-amd64.yml
View file @
25aaefc6
...
@@ -18,20 +18,20 @@ jobs:
...
@@ -18,20 +18,20 @@ jobs:
contents
:
read
contents
:
read
steps
:
steps
:
-
name
:
Check out the repo
-
name
:
Check out the repo
uses
:
actions/checkout@v
3
uses
:
actions/checkout@v
4
-
name
:
Save version info
-
name
:
Save version info
run
:
|
run
:
|
git describe --tags > VERSION
git describe --tags > VERSION
-
name
:
Log in to Docker Hub
-
name
:
Log in to Docker Hub
uses
:
docker/login-action@v
2
uses
:
docker/login-action@v
3
with
:
with
:
username
:
${{ secrets.DOCKERHUB_USERNAME }}
username
:
${{ secrets.DOCKERHUB_USERNAME }}
password
:
${{ secrets.DOCKERHUB_TOKEN }}
password
:
${{ secrets.DOCKERHUB_TOKEN }}
-
name
:
Log in to the Container registry
-
name
:
Log in to the Container registry
uses
:
docker/login-action@v
2
uses
:
docker/login-action@v
3
with
:
with
:
registry
:
ghcr.io
registry
:
ghcr.io
username
:
${{ github.actor }}
username
:
${{ github.actor }}
...
@@ -39,14 +39,14 @@ jobs:
...
@@ -39,14 +39,14 @@ jobs:
-
name
:
Extract metadata (tags, labels) for Docker
-
name
:
Extract metadata (tags, labels) for Docker
id
:
meta
id
:
meta
uses
:
docker/metadata-action@v
4
uses
:
docker/metadata-action@v
5
with
:
with
:
images
:
|
images
:
|
calciumion/new-api
calciumion/new-api
ghcr.io/${{ github.repository }}
ghcr.io/${{ github.repository }}
-
name
:
Build and push Docker images
-
name
:
Build and push Docker images
uses
:
docker/build-push-action@v
3
uses
:
docker/build-push-action@v
5
with
:
with
:
context
:
.
context
:
.
push
:
true
push
:
true
...
...
.github/workflows/docker-image-arm64.yml
View file @
25aaefc6
...
@@ -4,7 +4,6 @@ on:
...
@@ -4,7 +4,6 @@ on:
push
:
push
:
tags
:
tags
:
-
'
*'
-
'
*'
-
'
!*-alpha*'
workflow_dispatch
:
workflow_dispatch
:
inputs
:
inputs
:
name
:
name
:
...
@@ -19,26 +18,26 @@ jobs:
...
@@ -19,26 +18,26 @@ jobs:
contents
:
read
contents
:
read
steps
:
steps
:
-
name
:
Check out the repo
-
name
:
Check out the repo
uses
:
actions/checkout@v
3
uses
:
actions/checkout@v
4
-
name
:
Save version info
-
name
:
Save version info
run
:
|
run
:
|
git describe --tags > VERSION
git describe --tags > VERSION
-
name
:
Set up QEMU
-
name
:
Set up QEMU
uses
:
docker/setup-qemu-action@v
2
uses
:
docker/setup-qemu-action@v
3
-
name
:
Set up Docker Buildx
-
name
:
Set up Docker Buildx
uses
:
docker/setup-buildx-action@v
2
uses
:
docker/setup-buildx-action@v
3
-
name
:
Log in to Docker Hub
-
name
:
Log in to Docker Hub
uses
:
docker/login-action@v
2
uses
:
docker/login-action@v
3
with
:
with
:
username
:
${{ secrets.DOCKERHUB_USERNAME }}
username
:
${{ secrets.DOCKERHUB_USERNAME }}
password
:
${{ secrets.DOCKERHUB_TOKEN }}
password
:
${{ secrets.DOCKERHUB_TOKEN }}
-
name
:
Log in to the Container registry
-
name
:
Log in to the Container registry
uses
:
docker/login-action@v
2
uses
:
docker/login-action@v
3
with
:
with
:
registry
:
ghcr.io
registry
:
ghcr.io
username
:
${{ github.actor }}
username
:
${{ github.actor }}
...
@@ -46,14 +45,14 @@ jobs:
...
@@ -46,14 +45,14 @@ jobs:
-
name
:
Extract metadata (tags, labels) for Docker
-
name
:
Extract metadata (tags, labels) for Docker
id
:
meta
id
:
meta
uses
:
docker/metadata-action@v
4
uses
:
docker/metadata-action@v
5
with
:
with
:
images
:
|
images
:
|
calciumion/new-api
calciumion/new-api
ghcr.io/${{ github.repository }}
ghcr.io/${{ github.repository }}
-
name
:
Build and push Docker images
-
name
:
Build and push Docker images
uses
:
docker/build-push-action@v
3
uses
:
docker/build-push-action@v
5
with
:
with
:
context
:
.
context
:
.
platforms
:
linux/amd64,linux/arm64
platforms
:
linux/amd64,linux/arm64
...
...
relay/channel/dify/adaptor.go
View file @
25aaefc6
...
@@ -9,7 +9,6 @@ import (
...
@@ -9,7 +9,6 @@ import (
"one-api/dto"
"one-api/dto"
"one-api/relay/channel"
"one-api/relay/channel"
relaycommon
"one-api/relay/common"
relaycommon
"one-api/relay/common"
"strings"
)
)
const
(
const
(
...
@@ -40,15 +39,16 @@ func (a *Adaptor) ConvertImageRequest(c *gin.Context, info *relaycommon.RelayInf
...
@@ -40,15 +39,16 @@ func (a *Adaptor) ConvertImageRequest(c *gin.Context, info *relaycommon.RelayInf
}
}
func
(
a
*
Adaptor
)
Init
(
info
*
relaycommon
.
RelayInfo
)
{
func
(
a
*
Adaptor
)
Init
(
info
*
relaycommon
.
RelayInfo
)
{
if
strings
.
HasPrefix
(
info
.
UpstreamModelName
,
"agent"
)
{
//if strings.HasPrefix(info.UpstreamModelName, "agent") {
a
.
BotType
=
BotTypeAgent
// a.BotType = BotTypeAgent
}
else
if
strings
.
HasPrefix
(
info
.
UpstreamModelName
,
"workflow"
)
{
//} else if strings.HasPrefix(info.UpstreamModelName, "workflow") {
a
.
BotType
=
BotTypeWorkFlow
// a.BotType = BotTypeWorkFlow
}
else
if
strings
.
HasPrefix
(
info
.
UpstreamModelName
,
"chat"
)
{
//} else if strings.HasPrefix(info.UpstreamModelName, "chat") {
a
.
BotType
=
BotTypeCompletion
// a.BotType = BotTypeCompletion
}
else
{
//} else {
//}
a
.
BotType
=
BotTypeChatFlow
a
.
BotType
=
BotTypeChatFlow
}
}
}
func
(
a
*
Adaptor
)
GetRequestURL
(
info
*
relaycommon
.
RelayInfo
)
(
string
,
error
)
{
func
(
a
*
Adaptor
)
GetRequestURL
(
info
*
relaycommon
.
RelayInfo
)
(
string
,
error
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment