selfprivacy.org.app/.drone.yml

64 lines
1.5 KiB
YAML
Raw Normal View History

kind: pipeline
type: exec
2022-08-31 15:43:07 +03:00
name: Continuous Integration
2022-08-31 13:17:35 +03:00
steps:
2022-08-31 15:43:07 +03:00
- name: Build Debug Artifacts
2022-08-31 13:17:35 +03:00
commands:
2022-08-31 14:35:44 +03:00
- 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
2022-08-31 13:17:35 +03:00
2022-08-31 14:55:54 +03:00
trigger:
event:
- push
- pull_request
2022-08-31 13:17:35 +03:00
node:
server: builder
---
2022-08-31 15:43:07 +03:00
2022-08-31 13:17:35 +03:00
kind: pipeline
type: exec
2022-08-31 15:43:07 +03:00
name: Release
steps:
2022-08-31 15:53:02 +03:00
- name: Build Release Artifacts
commands:
2022-08-31 15:53:02 +03:00
# Prepare SSH keys
2022-08-30 21:32:01 +03:00
- eval `ssh-agent -s`
2022-08-30 21:44:37 +03:00
- echo "$SSH_PRIVATE_KEY" | ssh-add -
2022-08-31 15:53:02 +03:00
# Reset building environment
- nixos-container stop isolated
- nixos-container start isolated
# Copy sources to the building environment
- scp -r `pwd` isolated:/var/lib/builder
2022-08-31 15:53:02 +03:00
# Build release artifacts
2022-08-31 13:17:35 +03:00
- ssh isolated "cd src && flutter build apk --release --split-per-abi"
2022-08-31 15:53:02 +03:00
# Fetch the release artifacts
2022-08-31 00:45:50 +03:00
- scp isolated:/var/lib/builder/src/build/app/outputs/flutter-apk/*-release.apk `pwd`
2022-08-31 15:55:04 +03:00
environment:
SSH_PRIVATE_KEY:
from_secret: SSH_PRIVATE_KEY
2022-08-28 00:05:13 +03:00
2022-08-31 15:43:07 +03:00
- name: Deploy on F-Droid Repository
commands:
2022-08-31 15:53:02 +03:00
# Prepare SSH keys
- eval `ssh-agent -s`
- echo "$SSH_PRIVATE_KEY" | ssh-add -
# Rename the artifacts in a more informative way
- rename app pro.kherel.selfprivacy *.apk && rename release "$DRONE_SEMVER" *.apk
2022-08-31 15:43:07 +03:00
- ls *.apk
2022-08-31 15:55:04 +03:00
environment:
SSH_PRIVATE_KEY:
from_secret: SSH_PRIVATE_KEY
2022-08-31 15:43:07 +03:00
2022-08-31 13:17:35 +03:00
trigger:
2022-08-31 14:35:44 +03:00
event:
- tag
2022-08-31 13:17:35 +03:00
2022-08-27 21:05:12 +03:00
node:
2022-08-27 23:59:33 +03:00
server: builder