54 lines
1.6 KiB
YAML
54 lines
1.6 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"
|
|
- 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: zot.oeo.one
|
|
commands:
|
|
- set -euo pipefail
|
|
- release_tag="${CI_COMMIT_TAG:-${RELEASE_TAG:-}}"
|
|
- test -n "$release_tag"
|
|
- printf '%s' "$ZOT_PASSWORD" | buildah login "$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 --format docker --platform linux/amd64 --tag "$image" --file server/Dockerfile .
|
|
- buildah push "$image" "docker://$image"
|