fix: use separate pipeline files instead of multi-document YAML

YAML anchors don't work across document boundaries in multi-document
files. Using separate files in .woodpecker/ directory instead, which
is the recommended approach and matches WeightTracker's pattern.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Barry Walker
2026-01-13 14:31:54 -05:00
parent dccb3729aa
commit 0f2a6937c4
2 changed files with 27 additions and 37 deletions
-169
View File
@@ -1,169 +0,0 @@
variables:
- &dotnet_image "mcr.microsoft.com/dotnet/sdk:10.0-preview"
- &kaniko_image "gcr.io/kaniko-project/executor:debug"
# =============================================================================
# PULL REQUESTS - Build and test only
# =============================================================================
when:
- event: pull_request
steps:
- name: restore
image: *dotnet_image
commands:
- dotnet restore
- name: build
image: *dotnet_image
commands:
- dotnet build --no-restore -c Release
depends_on: [restore]
- name: test
image: *dotnet_image
commands:
- dotnet test --no-build -c Release --logger "console;verbosity=detailed"
depends_on: [build]
---
# =============================================================================
# MAIN BRANCH - Build, test, version, release
# =============================================================================
when:
- event: push
branch: main
steps:
- name: restore
image: *dotnet_image
commands:
- dotnet restore
- name: build
image: *dotnet_image
commands:
- dotnet build --no-restore -c Release
depends_on: [restore]
- name: test
image: *dotnet_image
commands:
- dotnet test --no-build -c Release --logger "console;verbosity=detailed"
depends_on: [build]
# Determine next version based on conventional commits
- name: version
image: alpine/git
commands:
- apk add --no-cache bash
- |
# Get the latest tag or default to v0.0.0
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
echo "Latest tag: $LATEST_TAG"
# Parse current version
VERSION=${LATEST_TAG#v}
MAJOR=$(echo $VERSION | cut -d. -f1)
MINOR=$(echo $VERSION | cut -d. -f2)
PATCH=$(echo $VERSION | cut -d. -f3)
# Get commits since last tag
if [ "$LATEST_TAG" = "v0.0.0" ]; then
COMMITS=$(git log --pretty=format:"%s" HEAD)
else
COMMITS=$(git log --pretty=format:"%s" ${LATEST_TAG}..HEAD)
fi
# Determine bump type from conventional commits
BUMP="patch"
if echo "$COMMITS" | grep -qiE "^feat(\(.+\))?!:|BREAKING CHANGE:"; then
BUMP="major"
elif echo "$COMMITS" | grep -qiE "^feat(\(.+\))?:"; then
BUMP="minor"
fi
echo "Bump type: $BUMP"
# Calculate new version
case $BUMP in
major)
MAJOR=$((MAJOR + 1))
MINOR=0
PATCH=0
;;
minor)
MINOR=$((MINOR + 1))
PATCH=0
;;
patch)
PATCH=$((PATCH + 1))
;;
esac
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
echo "New version: $NEW_VERSION"
# Save version for other steps
echo "$NEW_VERSION" > .version
echo "v${NEW_VERSION}" > .tag
depends_on: [test]
# Package NuGet
- name: package
image: *dotnet_image
commands:
- VERSION=$(cat .version)
- echo "Packaging version $VERSION"
- dotnet pack PaperlessMCP/PaperlessMCP.csproj --no-build -c Release -o ./artifacts /p:Version=$VERSION /p:PackageVersion=$VERSION
- ls -la ./artifacts/
depends_on: [version]
# Build and push Docker with Kaniko
- name: docker
image: *kaniko_image
environment:
GHCR_USERNAME:
from_secret: github_username
GHCR_TOKEN:
from_secret: github_token
commands:
- VERSION=$(cat .version)
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"ghcr.io\":{\"username\":\"$GHCR_USERNAME\",\"password\":\"$GHCR_TOKEN\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor
--context=$CI_WORKSPACE/PaperlessMCP
--dockerfile=$CI_WORKSPACE/PaperlessMCP/Dockerfile
--destination=ghcr.io/barryw/paperlessmcp:v${VERSION}
--destination=ghcr.io/barryw/paperlessmcp:latest
--build-arg=VERSION=${VERSION}
depends_on: [version]
# Create git tag and push
- name: git-tag
image: alpine/git
environment:
GITHUB_TOKEN:
from_secret: github_token
commands:
- TAG=$(cat .tag)
- VERSION=$(cat .version)
- echo "Creating tag $TAG"
- |
git config user.email "ci@woodpecker.local"
git config user.name "Woodpecker CI"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/barryw/PaperlessMCP.git
git tag -a "$TAG" -m "Release $VERSION"
git push origin "$TAG"
depends_on: [package, docker]
# Create GitHub release
- name: release
image: woodpeckerci/plugin-github-release
settings:
api_key:
from_secret: github_token
files:
- artifacts/*.nupkg
prerelease: false
depends_on: [git-tag]