flutter_app/.drone.yml

99 lines
2.8 KiB
YAML
Raw Normal View History

2021-03-26 00:44:03 +00:00
---
kind: pipeline
type: docker
name: default
steps:
- name: fetch
2021-03-26 23:10:48 +00:00
image: cirrusci/flutter:dev
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
#- 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-26 23:10:48 +00:00
image: cirrusci/flutter:dev
2021-03-26 00:44:03 +00:00
commands:
- flutter config --enable-linux-desktop
2021-03-26 20:15:15 +00:00
- apt-get update
- apt-get install -y --no-install-recommends cmake ninja-build clang build-essential pkg-config libgtk-3-dev liblzma-dev
2021-03-26 20:15:15 +00:00
# pkg-config
# pkgconf
2021-03-26 23:10:48 +00:00
- flutter build 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-26 00:44:03 +00:00
commands:
- flutter build appbundle
# or build apk --split-per-abi ?
2021-03-26 00:44:03 +00:00
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-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
- export DIR=libCwtch-go-`cat VERSION`-`cat BUILDDATE`
- mkdir $DIR
#- mv libCwtch.so libCwtch.dll cwtch.aar cwtch-sources.jar libCwtch.h $DIR/
- cd $DIR
- find . -type f -exec sha256sum {} \; > sha256s.txt
- cd ..
# TODO: do deployment once files actaully compile
#- scp -r -o StrictHostKeyChecking=no -i ~/id_rsa $DIR buildfiles@openprivacy.ca:/home/buildfiles/buildfiles/
- name: notify-email
image: drillster/drone-email
host: build.openprivacy.ca
port: 25
skip_verify: true
from: drone@openprivacy.ca
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-26 00:44:03 +00:00
gogs_url: https://git.openprivacy.ca
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