60 lines
2.3 KiB
YAML
60 lines
2.3 KiB
YAML
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"
|
|
- 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 --layers --network host --format docker --platform linux/amd64 --tag "$image" --file server/Dockerfile .
|
|
- buildah push --tls-verify=false "$image" "docker://$image"
|