7 Commits
Author SHA1 Message Date
justme 46974b120e ci: cache and prefetch WebDrop dependencies
ci/woodpecker/tag/release-backend Pipeline was successful
2026-10-02 04:18:48 +00:00
justme 3332e7bbcf ci: cache and prefetch WebDrop dependencies 2026-10-02 04:18:41 +00:00
justme a182043970 ci: cache native image build dependencies
ci/woodpecker/manual/ci Pipeline failed
ci/woodpecker/manual/release-backend Pipeline was canceled
2026-10-02 11:51:56 +08:00
justme 2150849529 ci: use host network for Buildah image build
ci/woodpecker/manual/ci Pipeline was successful
ci/woodpecker/manual/release-backend Pipeline was successful
2026-10-02 11:39:48 +08:00
justme dde7beee15 ci: publish releases through internal Zot endpoint
ci/woodpecker/manual/ci Pipeline was successful
ci/woodpecker/manual/release-backend Pipeline failed
2026-10-02 11:37:24 +08:00
justme dd6ab78353 ci: checkout tagged source for manual releases
ci/woodpecker/manual/release-backend Pipeline failed
ci/woodpecker/manual/ci Pipeline was successful
2026-10-02 11:34:30 +08:00
justme 9964b4e3ad ci: allow manual semver image publishing 2026-10-02 11:33:34 +08:00
4 changed files with 53 additions and 13 deletions

No files matched your search

+15 -3
View File
@@ -14,6 +14,17 @@ clone:
lfs: false lfs: false
steps: steps:
prefetch-dependencies:
image: bash
commands:
- mkdir -p "$HOME/.cache/woodpecker/webdrop/npm" "$HOME/.cache/woodpecker/webdrop/nuget"
- cd packages/core
- npm ci --cache "$HOME/.cache/woodpecker/webdrop/npm" --prefer-offline --no-audit
- cd ../../web
- npm ci --cache "$HOME/.cache/woodpecker/webdrop/npm" --prefer-offline --no-audit
- cd ..
- NUGET_PACKAGES="$HOME/.cache/woodpecker/webdrop/nuget" dotnet restore server/WebDrop.slnx
api-contract: api-contract:
image: bash image: bash
commands: commands:
@@ -21,9 +32,9 @@ steps:
core-and-web: core-and-web:
image: bash image: bash
depends_on: [prefetch-dependencies]
commands: commands:
- cd packages/core - cd packages/core
- npm ci
- npm run typecheck - npm run typecheck
- npm test - npm test
- npm run vectors:check - npm run vectors:check
@@ -31,9 +42,9 @@ steps:
web: web:
image: bash image: bash
depends_on: [prefetch-dependencies]
commands: commands:
- cd web - cd web
- npm ci
- npm run typecheck - npm run typecheck
- npm run lint:css - npm run lint:css
- npm test - npm test
@@ -41,5 +52,6 @@ steps:
server: server:
image: bash image: bash
depends_on: [prefetch-dependencies]
commands: commands:
- dotnet test server/WebDrop.slnx --configuration Release --verbosity minimal - NUGET_PACKAGES="$HOME/.cache/woodpecker/webdrop/nuget" dotnet test server/WebDrop.slnx --configuration Release --verbosity minimal --no-restore
+28 -7
View File
@@ -1,6 +1,7 @@
when: when:
- event: tag - event: tag
ref: refs/tags/v* ref: refs/tags/v*
- event: manual
labels: labels:
ci: domain-linux-native ci: domain-linux-native
@@ -15,11 +16,25 @@ clone:
lfs: false lfs: false
steps: steps:
checkout-release-source:
image: bash
commands:
- set -euo pipefail
- release_tag="${CI_COMMIT_TAG:-${RELEASE_TAG:-}}"
- test -n "$release_tag"
- node scripts/check-api-contract.mjs "$release_tag"
- git fetch --force origin "refs/tags/$release_tag:refs/tags/$release_tag"
- git checkout --detach "refs/tags/$release_tag"
release-checks: release-checks:
image: bash image: bash
commands: commands:
- node scripts/check-api-contract.mjs "$CI_COMMIT_TAG" - release_tag="${CI_COMMIT_TAG:-${RELEASE_TAG:-}}"
- dotnet test server/WebDrop.slnx --configuration Release --verbosity minimal - test -n "$release_tag"
- node scripts/check-api-contract.mjs "$release_tag"
- mkdir -p "$HOME/.cache/woodpecker/webdrop/nuget"
- NUGET_PACKAGES="$HOME/.cache/woodpecker/webdrop/nuget" dotnet restore server/WebDrop.slnx
- NUGET_PACKAGES="$HOME/.cache/woodpecker/webdrop/nuget" dotnet test server/WebDrop.slnx --configuration Release --verbosity minimal --no-restore
publish-backend: publish-backend:
image: bash image: bash
@@ -28,11 +43,17 @@ steps:
from_secret: registry_username from_secret: registry_username
ZOT_PASSWORD: ZOT_PASSWORD:
from_secret: registry_password from_secret: registry_password
ZOT_REGISTRY: zot.oeo.one ZOT_REGISTRY: 192.168.2.162:5000
commands: commands:
- set -euo pipefail - set -euo pipefail
- printf '%s' "$ZOT_PASSWORD" | buildah login "$ZOT_REGISTRY" --username "$ZOT_USERNAME" --password-stdin - release_tag="${CI_COMMIT_TAG:-${RELEASE_TAG:-}}"
- test -n "$release_tag"
- ': "${WOODPECKER_BACKEND_LOCAL_TEMP_DIR:=$HOME/woodpecker/work}"'
- buildah_store="$(dirname "$WOODPECKER_BACKEND_LOCAL_TEMP_DIR")/buildah-cache/webdrop"
- mkdir -p "$buildah_store/storage" "$buildah_store/run"
- 'buildah() { command buildah --root "$buildah_store/storage" --runroot "$buildah_store/run" "$@"; }'
- printf '%s' "$ZOT_PASSWORD" | buildah login --tls-verify=false "$ZOT_REGISTRY" --username "$ZOT_USERNAME" --password-stdin
- trap 'buildah logout "$ZOT_REGISTRY" >/dev/null 2>&1 || true' EXIT - trap 'buildah logout "$ZOT_REGISTRY" >/dev/null 2>&1 || true' EXIT
- image="$ZOT_REGISTRY/justme/webdrop-api:$CI_COMMIT_TAG" - image="$ZOT_REGISTRY/justme/webdrop-api:$release_tag"
- buildah bud --format docker --platform linux/amd64 --tag "$image" --file server/Dockerfile . - buildah bud --network host --format docker --platform linux/amd64 --tag "$image" --file server/Dockerfile .
- buildah push "$image" "docker://$image" - buildah push --tls-verify=false "$image" "docker://$image"
+3 -3
View File
@@ -34,11 +34,11 @@ CAPTCHA_SECRET=<server-side-secret>
## Woodpecker CI ## Woodpecker CI
`.woodpecker/ci.yml` 在 push 和手动运行时执行 API 契约、Core、Web、服务端检查;每次 push 都会构建前端。`.woodpecker/release-backend.yml` 仅响应 `vMAJOR.MINOR.PATCH` SemVer tag;测试通过后用 Linux native agent 的 Buildah 构建并推送同名后端镜像 tag。两者都通过 Woodpecker secret `gitea_clone_webdrop` 从 `https://git.oeo.one` 克隆私有仓库。 `.woodpecker/ci.yml` 在 push 和手动运行时执行 API 契约、Core、Web、服务端检查;每次 push 都会构建前端。`.woodpecker/release-backend.yml` 响应 `vMAJOR.MINOR.PATCH` SemVer tag;也可手动运行并传入 `RELEASE_TAG`(例如 `v0.1.0`)。测试通过后用 Linux native agent 的 Buildah 构建并推送同名后端镜像 tag。两者都通过 Woodpecker secret `gitea_clone_webdrop` 从 `https://git.oeo.one` 克隆公开仓库。
两条流水线固定到 `ci: domain-linux-native` 的 `linux/amd64` Agent;该主机需要 Node 24、.NET 10 和 Buildah。Gitea webhook 走同 Docker 网络中的 `woodpecker-server:8000`,代码 clone 走公网 Git 域名。 两条流水线固定到 `ci: domain-linux-native` 的 `linux/amd64` Agent;该主机需要 Node 24、.NET 10 和 Buildah。release job 在 `WOODPECKER_BACKEND_LOCAL_TEMP_DIR` 对应的持久目录缓存 Buildah 层,Dockerfile 单独缓存 NuGet restore 层。Gitea webhook 走同 Docker 网络中的 `woodpecker-server:8000`,代码 clone 走公网 Git 域名。
后端镜像发布到 `zot.oeo.one/justme/webdrop-api`。在 Woodpecker 仓库配置 tag 事件可用的 secrets `registry_username`、`registry_password`。发布步骤要求 Linux native agent 安装 Buildah;使用已发布镜像时,在 `.env` 中设置 `WEBDROP_IMAGE_TAG`,仓库名已填入 `.env.example`。 后端镜像发布到 `zot.oeo.one/justme/webdrop-api`。Woodpecker Linux agent 通过内网 `192.168.2.162:5000` 访问同一 Zot 仓库,发布需要 Buildah 与 tag/manual 事件可用的 secrets `registry_username`、`registry_password`。使用已发布镜像时,在 `.env` 中设置 `WEBDROP_IMAGE_TAG`,仓库名已填入 `.env.example`。
API 契约版本以 `contracts/api-contract.json` 为准,并同步到 OpenAPI 与后端 `/api/v1/info`。加字段等向后兼容更新递增 minor,兼容性修复递增 patch,破坏性更新递增 major。前端声明支持的契约主版本;后端主版本变化时,前端 CI 契约检查和运行时连接检查都会失败,直到前端同步支持该主版本。 API 契约版本以 `contracts/api-contract.json` 为准,并同步到 OpenAPI 与后端 `/api/v1/info`。加字段等向后兼容更新递增 minor,兼容性修复递增 patch,破坏性更新递增 major。前端声明支持的契约主版本;后端主版本变化时,前端 CI 契约检查和运行时连接检查都会失败,直到前端同步支持该主版本。
+7
View File
@@ -3,11 +3,18 @@ WORKDIR /src
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y --no-install-recommends clang zlib1g-dev \ && apt-get install -y --no-install-recommends clang zlib1g-dev \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
COPY server/Directory.Build.props ./server/
COPY server/src/WebDrop.Api/WebDrop.Api.csproj ./server/src/WebDrop.Api/
COPY server/src/WebDrop.Core/WebDrop.Core.csproj ./server/src/WebDrop.Core/
COPY server/src/WebDrop.Storage/WebDrop.Storage.csproj ./server/src/WebDrop.Storage/
RUN dotnet restore server/src/WebDrop.Api/WebDrop.Api.csproj \
--runtime linux-x64
COPY server/ ./server/ COPY server/ ./server/
RUN dotnet publish server/src/WebDrop.Api/WebDrop.Api.csproj \ RUN dotnet publish server/src/WebDrop.Api/WebDrop.Api.csproj \
--configuration Release \ --configuration Release \
--runtime linux-x64 \ --runtime linux-x64 \
--self-contained true \ --self-contained true \
--no-restore \
--output /out --output /out
RUN find /root/.nuget/packages/sqlitepclraw.lib.e_sqlite3 -path '*/runtimes/linux-x64/native/libe_sqlite3.so' \ RUN find /root/.nuget/packages/sqlitepclraw.lib.e_sqlite3 -path '*/runtimes/linux-x64/native/libe_sqlite3.so' \
-exec cp {} /out/libe_sqlite3.so \; \ -exec cp {} /out/libe_sqlite3.so \; \