All checks were successful
ci/woodpecker/tag/woodpecker Pipeline was successful
72 lines
2.3 KiB
YAML
72 lines
2.3 KiB
YAML
---
|
|
# Woodpecker CI configuration for Worldhopper
|
|
# 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
|
|
|
|
# Optional: Cache Flutter dependencies for faster builds
|
|
# Uncomment if Woodpecker instance supports caching
|
|
# cache:
|
|
# - key: "flutter-deps-{{ checksum 'pubspec.lock' }}"
|
|
# paths:
|
|
# - /root/.pub-cache
|
|
# - .dart_tool
|