worldhopper/.woodpecker/release.yml
Felipe M. 3123028f89
refactor: split Woodpecker CI into separate release and PR pipelines
Move from a single .woodpecker.yml to a .woodpecker/ directory with
two pipelines: release.yml (existing tag-based build/release flow) and
pr.yml (lint and static analysis for pull requests).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 19:14:19 +01:00

64 lines
2.1 KiB
YAML

---
# Woodpecker CI configuration for Worldhopper releases
# Builds Android APK and creates Forgejo releases on version tags
when:
event: tag
tag: v*.*.*
steps:
# Step 1: Build Flutter APK
build:
image: ghcr.io/cirruslabs/flutter:stable
environment:
SIGNING_KEYSTORE:
from_secret: signing_keystore
SIGNING_KEY_ALIAS:
from_secret: signing_key_alias
SIGNING_STORE_PASSWORD:
from_secret: signing_store_password
SIGNING_KEY_PASSWORD:
from_secret: signing_key_password
commands:
- echo "Building Worldhopper APK for tag ${CI_COMMIT_TAG}"
# Set up release signing
- echo "$SIGNING_KEYSTORE" | base64 -d > android/app/upload-keystore.jks
- |
cat > android/key.properties << EOF
storePassword=$SIGNING_STORE_PASSWORD
keyPassword=$SIGNING_KEY_PASSWORD
keyAlias=$SIGNING_KEY_ALIAS
storeFile=upload-keystore.jks
EOF
- flutter doctor -v
- flutter pub get
- flutter pub run build_runner build --delete-conflicting-outputs
- |
VERSION_NAME=$(sh scripts/version.sh | head -1)
VERSION_CODE=$(sh scripts/version.sh | tail -1)
echo "Building version ${VERSION_NAME} (code ${VERSION_CODE})"
flutter build apk --release --build-name="$VERSION_NAME" --build-number="$VERSION_CODE"
- ls -lh build/app/outputs/flutter-apk/
# Rename APK to include version tag
- cp build/app/outputs/flutter-apk/app-release.apk worldhopper-${CI_COMMIT_TAG}.apk
- ls -lh worldhopper-${CI_COMMIT_TAG}.apk
- echo "APK built successfully"
# Step 2: Generate changelog from git history
changelog:
image: alpine/git:latest
commands:
- apk add --no-cache bash
- bash scripts/generate-changelog.sh "${CI_COMMIT_TAG}" CHANGELOG.md
# Step 3: Create Forgejo release with tea CLI
release:
image: gitea/tea:latest
environment:
FORGEJO_TOKEN:
from_secret: forgejo_token
commands:
- ./scripts/create-release.sh "${CI_COMMIT_TAG}" "worldhopper-${CI_COMMIT_TAG}.apk" CHANGELOG.md
depends_on:
- build
- changelog