selfprivacy.org.app/.drone.yml

105 lines
3.3 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 18:46:27 +03:00
- name: Prepare for Build
commands:
2022-08-31 15:53:02 +03:00
# Reset building environment
- nixos-container stop isolated
- nixos-container start isolated
2022-08-31 18:46:27 +03:00
# Prepare SSH keys
- eval `ssh-agent -s`
- echo "$SSH_PRIVATE_KEY" | ssh-add -
2022-08-31 15:53:02 +03:00
# Copy sources to the building environment
2022-08-31 18:46:27 +03:00
- scp -r `pwd` builder@isolated:/var/lib/builder
2022-08-31 18:49:15 +03:00
environment:
SSH_PRIVATE_KEY:
from_secret: SSH_PRIVATE_KEY
2022-08-31 18:46:27 +03:00
2022-09-02 03:24:14 +03:00
- name: Build Intermediate Release Artifact
2022-08-31 18:46:27 +03:00
commands:
# Prepare SSH keys
- eval `ssh-agent -s`
- echo "$SSH_PRIVATE_KEY" | ssh-add -
2022-09-02 03:24:14 +03:00
# Build intermediate release artifact
2022-08-31 18:46:27 +03:00
- 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`
2022-09-02 03:24:14 +03:00
environment:
SSH_PRIVATE_KEY:
from_secret: SSH_PRIVATE_KEY
- name: Sign Release Artifact for Standalone Use
commands:
# Get app build ID
2022-08-31 17:13:59 +03:00
- export APP_BUILD_ID=`yq '.version' pubspec.yaml | cut -d "+" -f2`
2022-09-02 03:24:14 +03:00
# Prepare SSH keys
- eval `ssh-agent -s`
- echo "$SSH_PRIVATE_KEY" | ssh-add -
# Upload and sign the artifact
- scp app-release.apk builder@isolated:/var/lib/builder
- ssh builder@isolated "zipalign -f -v 4 app-release.apk standalone_app-release.apk && apksigner sign --ks /run/secrets/standalone-keystore --ks-key-alias standalone --ks-pass file:/run/secrets/standalone-keystore-pass standalone_app-release.apk"
# Fetch the signed artifact
- scp builder@isolated:/var/lib/builder/standalone_app-release.apk `pwd`/"standalone_pro.kherel.selfprivacy_$APP_BUILD_ID.apk"
- scp builder@isolated:/var/lib/builder/standalone_app-release.apk `pwd`/"standalone_pro.kherel.selfprivacy_$APP_BUILD_ID.apk.idsig"
environment:
SSH_PRIVATE_KEY:
from_secret: SSH_PRIVATE_KEY
- name: Sign Release Artifact for F-Droid Repository
2022-09-02 03:28:03 +03:00
commands:
2022-09-02 03:24:14 +03:00
# Get app build ID
- export APP_BUILD_ID=`yq '.version' pubspec.yaml | cut -d "+" -f2`
# Prepare SSH keys
- eval `ssh-agent -s`
- echo "$SSH_PRIVATE_KEY" | ssh-add -
2022-08-31 18:46:27 +03:00
# Upload and sign the artifact
2022-09-02 04:43:45 +03:00
- scp app-release.apk fdroid@isolated:/var/lib/fdroid/unsigned/"pro.kherel.selfprivacy_$APP_BUILD_ID.apk"
2022-09-02 04:32:57 +03:00
- ssh fdroid@isolated 'FDROID_KEY_STORE_PASS=`cat /run/secrets/fdroid-keystore-pass` fdroid publish && fdroid update'
2022-08-31 18:46:27 +03:00
- scp -r fdroid@isolated:/var/lib/fdroid/repo `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 -
2022-08-31 16:32:08 +03:00
# Copy the artifacts to the F-Droid repository
2022-09-02 03:24:14 +03:00
- ls
2022-08-31 18:46:27 +03:00
- ls repo/
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