selfprivacy.org.app/.drone.yml
2022-08-31 16:32:08 +03:00

66 lines
1.6 KiB
YAML

kind: pipeline
type: exec
name: Continuous Integration
steps:
- name: Build Debug Artifacts
commands:
- flutter build apk --debug --split-per-abi
- mv build/app/outputs/flutter-apk/*-debug.apk `pwd`
- rename app pro.kherel.selfprivacy *.apk && rename debug "$DRONE_COMMIT" *.apk
- ls *.apk
trigger:
event:
- push
- pull_request
node:
server: builder
---
kind: pipeline
type: exec
name: Release
steps:
- name: Build Release Artifacts
commands:
# Prepare SSH keys
- eval `ssh-agent -s`
- echo "$SSH_PRIVATE_KEY" | ssh-add -
# Reset building environment
- nixos-container stop isolated
- nixos-container start isolated
# Copy sources to the building environment
- scp -r `pwd` isolated:/var/lib/builder
# Build release artifacts
- ssh isolated "cd src && flutter build apk --release --split-per-abi"
# Fetch the release artifacts
- scp isolated:/var/lib/builder/src/build/app/outputs/flutter-apk/*-release.apk `pwd`
# Rename the artifacts in a more informative way
- rename app pro.kherel.selfprivacy *.apk && rename release "$DRONE_SEMVER" *.apk
- ls *.apk
environment:
SSH_PRIVATE_KEY:
from_secret: SSH_PRIVATE_KEY
- name: Deploy on F-Droid Repository
commands:
# Prepare SSH keys
- eval `ssh-agent -s`
- echo "$SSH_PRIVATE_KEY" | ssh-add -
# Copy the artifacts to the F-Droid repository
- scp *.apk ci:/var/lib/fdroid/unsigned
environment:
SSH_PRIVATE_KEY:
from_secret: SSH_PRIVATE_KEY
trigger:
event:
- tag
node:
server: builder