2021-03-26 00:44:03 +00:00
---
kind : pipeline
type : docker
2021-04-13 20:23:18 +00:00
name : linux-android-test
2021-03-26 00:44:03 +00:00
steps :
- name : fetch
2021-03-26 23:10:48 +00:00
image : cirrusci/flutter:dev
2021-03-27 00:10:37 +00:00
volumes :
- name : deps
path : /root/.pub-cache
2021-03-26 00:44:03 +00:00
commands :
- wget https://git.openprivacy.ca/openprivacy/buildfiles/raw/master/tor/tor
- wget https://git.openprivacy.ca/openprivacy/buildfiles/raw/master/tor/torrc
- chmod a+x tor
- git fetch --tags
- echo `git describe --tags` > VERSION
- echo `date +%G-%m-%d-%H-%M` > BUILDDATE
2021-03-27 00:02:13 +00:00
- flutter pub get
2021-03-27 01:00:43 +00:00
- mkdir deploy
2021-03-26 00:44:03 +00:00
#- name: quality
# image: golang
# volumes:
# - name: deps
# path: /go
# commands:
# - go list ./... | xargs go vet
# - go list ./... | xargs golint
# #Todo: fix all the lint errors and add `-set_exit_status` above to enforce linting
- name : build-linux
2021-03-30 02:28:58 +00:00
image : openpriv/flutter-desktop:dev
2021-03-27 00:10:37 +00:00
volumes :
- name : deps
path : /root/.pub-cache
2021-03-26 00:44:03 +00:00
commands :
2021-03-26 23:10:48 +00:00
- flutter build linux
2021-03-27 01:00:43 +00:00
- mkdir deploy/linux
- cp -r build/linux/x64/release/bundle/* deploy/linux
- cp /sdks/flutter/bin/cache/artifacts/engine/linux-x64/icudtl.dat deploy/linux
2021-03-26 00:44:03 +00:00
- name : build-android
2021-03-26 23:10:48 +00:00
image : cirrusci/flutter:dev
2021-03-27 00:10:37 +00:00
volumes :
- name : deps
path : /root/.pub-cache
2021-03-26 00:44:03 +00:00
commands :
2021-03-26 19:57:52 +00:00
- flutter build appbundle
# or build apk --split-per-abi ?
2021-03-27 01:00:43 +00:00
- mkdir deploy/android
- cp build/app/outputs/bundle/release/app-release.aab deploy/android
2021-03-26 00:44:03 +00:00
2021-03-30 19:21:54 +00:00
- name : widget-tests
image : cirrusci/flutter:dev
volumes :
- name : deps
path : /root/.pub-cache
commands :
2021-03-30 19:30:17 +00:00
# - flutter config --enable-linux-desktop
2021-03-30 19:21:54 +00:00
- flutter test --coverage
- genhtml coverage/lcov.info -o coverage/html
2021-03-26 20:15:15 +00:00
# Todo: gonna need more work on container
# https://flutter.dev/desktop
# requirements: Visual Studio 2019 (not to be confused with Visual Studio Code) with the “Desktop development with C++” workload installed, including all of its default components
#- name: build-windows
2021-03-26 23:10:48 +00:00
# image: cirrusci/flutter:dev
2021-03-27 00:10:37 +00:00
#- volumes:
# - name: deps
# path: /root/.pub-cache
2021-03-26 20:15:15 +00:00
# commands:
# - flutter config --enable-windows-desktop
# - flutter build windows
2021-03-26 00:44:03 +00:00
- name : deploy-buildfiles
image : kroniak/ssh-client
environment :
BUILDFILES_KEY :
from_secret : buildfiles_key
secrets : [ gogs_account_token]
when :
event : push
status : [ success ]
commands :
- echo $BUILDFILES_KEY > ~/id_rsab64
- base64 -d ~/id_rsab64 > ~/id_rsa
- chmod 400 ~/id_rsa
2021-03-27 01:00:43 +00:00
- export DIR=flwtch-`cat VERSION`-`cat BUILDDATE`
- mv deploy $DIR
2021-03-30 19:21:54 +00:00
- cp -r coverage/html $DIR/coverage-tests
2021-03-30 19:48:00 +00:00
- cp -r test/failures $DIR/test-failures || true
2021-03-26 00:44:03 +00:00
- cd $DIR
2021-03-27 01:00:43 +00:00
- find . -type f -exec sha256sum {} \; > ./../sha256s.txt
- mv ./../sha256s.txt .
2021-03-26 00:44:03 +00:00
- cd ..
# TODO: do deployment once files actaully compile
2021-03-27 01:00:43 +00:00
- scp -r -o StrictHostKeyChecking=no -i ~/id_rsa $DIR buildfiles@openprivacy.ca:/home/buildfiles/buildfiles/
2021-03-26 00:44:03 +00:00
- name : notify-email
image : drillster/drone-email
2021-03-30 21:11:48 +00:00
settings :
host : build.openprivacy.ca
port : 25
skip_verify : true
from : drone@openprivacy.ca
2021-03-26 00:44:03 +00:00
when :
status : [ failure ]
- name : notify-gogs
image : openpriv/drone-gogs
when :
event : pull_request
status : [ success, changed, failure ]
2021-03-26 19:50:26 +00:00
environment :
GOGS_ACCOUNT_TOKEN :
from_secret : gogs_account_token
2021-03-29 23:47:39 +00:00
settings :
gogs_url : https://git.openprivacy.ca
2021-03-26 00:44:03 +00:00
2021-03-27 00:10:37 +00:00
volumes :
- name : deps
temp : {}
2021-03-26 00:44:03 +00:00
trigger :
2021-03-26 19:50:26 +00:00
repo : flutter/flutter_app
2021-03-26 00:44:03 +00:00
branch : trunk
event :
- push
- pull_request
2021-04-13 20:23:18 +00:00
2021-04-21 00:28:22 +00:00
---
kind : pipeline
type : docker
name : delay-windows
clone :
disable : true
2021-04-13 20:23:18 +00:00
2021-04-21 00:28:22 +00:00
steps :
- name : sleep
image : cirrusci/flutter:dev
commands :
- sleep 90
2021-04-13 20:23:18 +00:00
---
kind : pipeline
type : docker
name : windows
platform :
os : windows
version : 1809
steps :
- name : fetch
2021-04-13 20:27:15 +00:00
image : openpriv/flutter-desktop:windows-dev
commands :
- git fetch --tags
2021-04-17 07:05:18 +00:00
- powershell -command "git describe --tags > VERSION"
2021-04-13 23:19:32 +00:00
- powershell -command "Get-Date -Format 'yyyy-MM-dd-HH-mm' >.\BUILDDATE"
2021-04-13 20:23:18 +00:00
- name : build-windows
2021-04-13 20:27:15 +00:00
image : openpriv/flutter-desktop:windows-dev
commands :
- flutter pub get
- flutter build windows
2021-04-20 22:07:37 +00:00
# flwtch-`cat VERSION`-`cat BUILDDATE`
- $Env:builddir = 'deploy\flwtch-win-'
- $Env:builddir += type .\VERSION
- $Env:builddir += '-'
2021-04-20 23:15:34 +00:00
- $Env:builddir += type .\BUILDDATE
2021-04-21 00:46:30 +00:00
- echo $Env:builddir
- dir
2021-04-21 01:00:13 +00:00
- dir build
- dir build\\windows
- dir build\\windows\\runner
- dir build\\windows\\runner\\Release
2021-04-14 00:13:00 +00:00
- mkdir deploy
2021-04-21 01:00:13 +00:00
- move build\\windows\\runner\\Release $Env:builddir
2021-04-21 23:44:49 +00:00
- dir
- dir deploy
2021-04-20 22:07:37 +00:00
- name : deploy-windows
2021-04-21 22:56:53 +00:00
image : appleboy/drone-scp:1.5
2021-04-20 22:07:37 +00:00
when :
event : push
status : [ success ]
settings :
host : openprivacy.ca
username : buildfiles
key :
from_secret : buildfiles_key
port : 22
target : /home/buildfiles/buildfiles/
2021-04-21 23:13:20 +00:00
source :
2021-04-22 00:43:51 +00:00
- deploy
2021-04-13 20:23:18 +00:00
trigger :
repo : flutter/flutter_app
branch : trunk
event :
2021-04-17 07:05:18 +00:00
- push
2021-04-21 00:28:22 +00:00
depends_on :
- delay-windows