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 15:46:27 +00:00
|
|
|
- name: Prepare for Build
|
2022-08-27 12:18:03 +00:00
|
|
|
commands:
|
2022-08-31 12:53:02 +00:00
|
|
|
# Reset building environment
|
|
|
|
- nixos-container stop isolated
|
|
|
|
- nixos-container start isolated
|
2022-08-31 15:46:27 +00:00
|
|
|
# Prepare SSH keys
|
|
|
|
- eval `ssh-agent -s`
|
|
|
|
- echo "$SSH_PRIVATE_KEY" | ssh-add -
|
2022-08-31 12:53:02 +00:00
|
|
|
# Copy sources to the building environment
|
2022-08-31 15:46:27 +00:00
|
|
|
- scp -r `pwd` builder@isolated:/var/lib/builder
|
2022-08-31 15:49:15 +00:00
|
|
|
environment:
|
|
|
|
SSH_PRIVATE_KEY:
|
|
|
|
from_secret: SSH_PRIVATE_KEY
|
2022-08-31 15:46:27 +00:00
|
|
|
|
|
|
|
- name: Build and Sign Release Artifact for F-Droid Repository
|
|
|
|
commands:
|
|
|
|
# Prepare SSH keys
|
|
|
|
- eval `ssh-agent -s`
|
|
|
|
- echo "$SSH_PRIVATE_KEY" | ssh-add -
|
|
|
|
# Build release artifact
|
|
|
|
- ssh builder@isolated "cd src && flutter build apk --release"
|
|
|
|
# Fetch the release artifact
|
|
|
|
- scp builder@isolated:/var/lib/builder/src/build/app/outputs/flutter-apk/app-release.apk `pwd`
|
|
|
|
# Rename the artifact in a more informative way
|
2022-08-31 14:13:59 +00:00
|
|
|
- export APP_BUILD_ID=`yq '.version' pubspec.yaml | cut -d "+" -f2`
|
|
|
|
- mv app-release.apk "pro.kherel.selfprivacy_$APP_BUILD_ID.apk"
|
2022-08-31 15:46:27 +00:00
|
|
|
# Upload and sign the artifact
|
|
|
|
- scp "pro.kherel.selfprivacy_$APP_BUILD_ID.apk" fdroid@isolated:/var/lib/fdroid/unsigned
|
|
|
|
- ssh fdroid@isolated "fdroid publish && fdroid update"
|
|
|
|
- scp -r fdroid@isolated:/var/lib/fdroid/repo `pwd`
|
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
|
2022-08-31 15:46:27 +00:00
|
|
|
- ls repo/
|
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
|