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