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
Unverified
Commit
55858f35
authored
Jul 03, 2026
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add manual Docker image publishing workflow
parent
0977965d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
288 deletions
+75
-288
.github/workflows/docker-image-branch.yml
+75
-84
.github/workflows/docker-image-nightly.yml
+0
-113
.github/workflows/sync-to-gitee.yml
+0
-91
No files found.
.github/workflows/docker-image-
alpha
.yml
→
.github/workflows/docker-image-
branch
.yml
View file @
55858f35
This diff is collapsed.
Click to expand it.
.github/workflows/docker-image-nightly.yml
deleted
100644 → 0
View file @
0977965d
name
:
Publish Docker image (nightly)
on
:
push
:
branches
:
-
nightly
workflow_dispatch
:
inputs
:
name
:
description
:
"
reason"
required
:
false
jobs
:
build_single_arch
:
name
:
Build & push (${{ matrix.arch }}) [native]
strategy
:
fail-fast
:
false
matrix
:
include
:
-
arch
:
amd64
platform
:
linux/amd64
runner
:
ubuntu-latest
-
arch
:
arm64
platform
:
linux/arm64
runner
:
ubuntu-24.04-arm
runs-on
:
${{ matrix.runner }}
permissions
:
contents
:
read
steps
:
-
name
:
Check out (shallow)
uses
:
actions/checkout@v4
with
:
fetch-depth
:
1
-
name
:
Determine nightly version
id
:
version
run
:
|
VERSION="nightly-$(date +'%Y%m%d')-$(git rev-parse --short HEAD)"
echo "$VERSION" > VERSION
echo "value=$VERSION" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Publishing version: $VERSION for ${{ matrix.arch }}"
-
name
:
Set up Docker Buildx
uses
:
docker/setup-buildx-action@v3
-
name
:
Log in to Docker Hub
uses
:
docker/login-action@v3
with
:
username
:
${{ secrets.DOCKERHUB_USERNAME }}
password
:
${{ secrets.DOCKERHUB_TOKEN }}
-
name
:
Extract metadata (labels)
id
:
meta
uses
:
docker/metadata-action@v5
with
:
images
:
|
calciumion/new-api
-
name
:
Build & push single-arch
uses
:
docker/build-push-action@v6
with
:
context
:
.
platforms
:
${{ matrix.platform }}
push
:
true
tags
:
|
calciumion/new-api:nightly-${{ matrix.arch }}
calciumion/new-api:${{ steps.version.outputs.value }}-${{ matrix.arch }}
labels
:
${{ steps.meta.outputs.labels }}
cache-from
:
type=gha
cache-to
:
type=gha,mode=max
provenance
:
false
sbom
:
false
create_manifests
:
name
:
Create multi-arch manifests (Docker Hub)
needs
:
[
build_single_arch
]
runs-on
:
ubuntu-latest
steps
:
-
name
:
Check out (shallow)
uses
:
actions/checkout@v4
with
:
fetch-depth
:
1
-
name
:
Determine nightly version
id
:
version
run
:
|
VERSION="nightly-$(date +'%Y%m%d')-$(git rev-parse --short HEAD)"
echo "value=$VERSION" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_ENV
-
name
:
Log in to Docker Hub
uses
:
docker/login-action@v3
with
:
username
:
${{ secrets.DOCKERHUB_USERNAME }}
password
:
${{ secrets.DOCKERHUB_TOKEN }}
-
name
:
Create & push manifest (Docker Hub - nightly)
run
:
|
docker buildx imagetools create \
-t calciumion/new-api:nightly \
calciumion/new-api:nightly-amd64 \
calciumion/new-api:nightly-arm64
-
name
:
Create & push manifest (Docker Hub - versioned nightly)
run
:
|
docker buildx imagetools create \
-t calciumion/new-api:${VERSION} \
calciumion/new-api:${VERSION}-amd64 \
calciumion/new-api:${VERSION}-arm64
.github/workflows/sync-to-gitee.yml
deleted
100644 → 0
View file @
0977965d
name
:
Sync Release to Gitee
permissions
:
contents
:
read
on
:
workflow_dispatch
:
inputs
:
tag_name
:
description
:
'
Release
Tag
to
sync
(e.g.
v1.0.0)'
required
:
true
type
:
string
# 配置你的 Gitee 仓库信息
env
:
GITEE_OWNER
:
'
QuantumNous'
# 修改为你的 Gitee 用户名
GITEE_REPO
:
'
new-api'
# 修改为你的 Gitee 仓库名
jobs
:
sync-to-gitee
:
runs-on
:
sync
steps
:
-
name
:
Checkout
uses
:
actions/checkout@v3
with
:
fetch-depth
:
0
-
name
:
Get Release Info
id
:
release_info
env
:
GITHUB_TOKEN
:
${{ secrets.GITHUB_TOKEN }}
TAG_NAME
:
${{ github.event.inputs.tag_name }}
run
:
|
# 获取 release 信息
RELEASE_INFO=$(gh release view "$TAG_NAME" --json name,body,tagName,targetCommitish)
RELEASE_NAME=$(echo "$RELEASE_INFO" | jq -r '.name')
TARGET_COMMITISH=$(echo "$RELEASE_INFO" | jq -r '.targetCommitish')
# 使用多行字符串输出
{
echo "release_name=$RELEASE_NAME"
echo "target_commitish=$TARGET_COMMITISH"
echo "release_body<<EOF"
echo "$RELEASE_INFO" | jq -r '.body'
echo "EOF"
} >> $GITHUB_OUTPUT
# 下载 release 的所有附件
gh release download "$TAG_NAME" --dir ./release_assets || echo "No assets to download"
# 列出下载的文件
ls -la ./release_assets/ || echo "No assets directory"
-
name
:
Create Gitee Release
id
:
create_release
uses
:
nICEnnnnnnnLee/action-gitee-release@v2.0.0
with
:
gitee_action
:
create_release
gitee_owner
:
${{ env.GITEE_OWNER }}
gitee_repo
:
${{ env.GITEE_REPO }}
gitee_token
:
${{ secrets.GITEE_TOKEN }}
gitee_tag_name
:
${{ github.event.inputs.tag_name }}
gitee_release_name
:
${{ steps.release_info.outputs.release_name }}
gitee_release_body
:
${{ steps.release_info.outputs.release_body }}
gitee_target_commitish
:
${{ steps.release_info.outputs.target_commitish }}
-
name
:
Upload Assets to Gitee
if
:
hashFiles('release_assets/*') != ''
uses
:
nICEnnnnnnnLee/action-gitee-release@v2.0.0
with
:
gitee_action
:
upload_asset
gitee_owner
:
${{ env.GITEE_OWNER }}
gitee_repo
:
${{ env.GITEE_REPO }}
gitee_token
:
${{ secrets.GITEE_TOKEN }}
gitee_release_id
:
${{ steps.create_release.outputs.release-id }}
gitee_upload_retry_times
:
3
gitee_files
:
|
release_assets/*
-
name
:
Cleanup
if
:
always()
run
:
|
rm -rf release_assets/
-
name
:
Summary
if
:
success()
run
:
|
echo "✅ Successfully synced release ${{ github.event.inputs.tag_name }} to Gitee!"
echo "🔗 Gitee Release URL: https://gitee.com/${{ env.GITEE_OWNER }}/${{ env.GITEE_REPO }}/releases/tag/${{ github.event.inputs.tag_name }}"
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