selfprivacy.org.app/.drone.yml

67 lines
1.7 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 17:13:59 +03:00
- ssh isolated "cd src && flutter build apk --release"
2022-08-31 15:53:02 +03:00
# Fetch the release artifacts
2022-08-31 17:13:59 +03:00
- scp isolated:/var/lib/builder/src/build/app/outputs/flutter-apk/app-release.apk `pwd`
2022-08-31 16:32:08 +03:00
# Rename the artifacts in a more informative way
2022-08-31 17:13:59 +03: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 16:32:08 +03:00
- ls *.apk
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 -
2022-08-31 16:32:08 +03:00
# Copy the artifacts to the F-Droid repository
- scp *.apk ci:/var/lib/fdroid/unsigned
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