ci: cache and prefetch WebDrop dependencies

This commit is contained in:
justme committed 2026-10-02 04:18:48 +00:00
1 parent 3332e7bbcf
commit 11fd0fb752
1 file changed
+56 -54
+56 -54
View File
@@ -1,57 +1,59 @@
when:
- event: tag
ref: refs/tags/v*
- event: manual
labels:
ci: domain-linux-native
platform: linux/amd64
clone:
- name: git
image: woodpeckerci/plugin-git:2.9.3
settings:
remote:
from_secret: gitea_clone_webdrop
lfs: false
steps:
checkout-release-source:
image: bash
commands:
- set -euo pipefail
when:
- event: tag
ref: refs/tags/v*
- event: manual
labels:
ci: domain-linux-native
platform: linux/amd64
clone:
- name: git
image: woodpeckerci/plugin-git:2.9.3
settings:
remote:
from_secret: gitea_clone_webdrop
lfs: false
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:
image: bash
commands:
- 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:
image: bash
commands:
- release_tag="${CI_COMMIT_TAG:-${RELEASE_TAG:-}}"
- test -n "$release_tag"
- node scripts/check-api-contract.mjs "$release_tag"
- dotnet test server/WebDrop.slnx --configuration Release --verbosity minimal
publish-backend:
image: bash
environment:
ZOT_USERNAME:
from_secret: registry_username
ZOT_PASSWORD:
from_secret: registry_password
ZOT_REGISTRY: 192.168.2.162:5000
commands:
- set -euo pipefail
- 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
- image="$ZOT_REGISTRY/justme/webdrop-api:$release_tag"
- buildah bud --network host --format docker --platform linux/amd64 --tag "$image" --file server/Dockerfile .
- buildah push --tls-verify=false "$image" "docker://$image"
- 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:
image: bash
environment:
ZOT_USERNAME:
from_secret: registry_username
ZOT_PASSWORD:
from_secret: registry_password
ZOT_REGISTRY: 192.168.2.162:5000
commands:
- set -euo pipefail
- 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
- image="$ZOT_REGISTRY/justme/webdrop-api:$release_tag"
- buildah bud --network host --format docker --platform linux/amd64 --tag "$image" --file server/Dockerfile .
- buildah push --tls-verify=false "$image" "docker://$image"