2021-03-17 19:35:55 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: default
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: fetch
|
|
|
|
image: golang
|
2021-03-17 20:31:16 +00:00
|
|
|
volumes:
|
|
|
|
- name: deps
|
|
|
|
path: /go
|
2021-03-17 19:36: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
|
2021-03-17 20:22:02 +00:00
|
|
|
- go get -u golang.org/x/lint/golint
|
2021-03-25 01:32:00 +00:00
|
|
|
- git fetch --tags
|
2021-03-17 20:31:16 +00:00
|
|
|
#- export GO111MODULE=on
|
|
|
|
#- go mod vendor
|
|
|
|
- go get
|
|
|
|
# TODO: upgrade to go1.16, remove mod/vendor, add go install for 1.16
|
2021-03-25 01:32:00 +00:00
|
|
|
- echo `git describe --tags` > VERSION
|
|
|
|
- echo `date +%G-%m-%d-%H-%M` > BUILDDATE
|
2021-03-25 01:34:03 +00:00
|
|
|
|
2021-03-17 19:36:03 +00:00
|
|
|
- name: quality
|
|
|
|
image: golang
|
2021-03-17 20:31:16 +00:00
|
|
|
volumes:
|
|
|
|
- name: deps
|
|
|
|
path: /go
|
2021-03-17 19:36:03 +00:00
|
|
|
commands:
|
|
|
|
- go list ./... | xargs go vet
|
2021-03-17 20:16:27 +00:00
|
|
|
- go list ./... | xargs golint
|
|
|
|
#Todo: fix all the lint errors and add `-set_exit_status` above to enforce linting
|
2021-03-17 23:56:27 +00:00
|
|
|
|
2021-03-17 20:31:16 +00:00
|
|
|
- name: build-linux
|
2021-03-17 23:56:27 +00:00
|
|
|
image: golang
|
2021-03-17 20:31:16 +00:00
|
|
|
volumes:
|
|
|
|
- name: deps
|
|
|
|
path: /go
|
2021-03-17 19:47:03 +00:00
|
|
|
commands:
|
|
|
|
- make linux
|
2021-03-17 23:56:27 +00:00
|
|
|
|
2021-03-17 20:31:16 +00:00
|
|
|
- name: build-android
|
2021-03-23 18:24:29 +00:00
|
|
|
image: openpriv/android-go-mobile:2021.03
|
2021-03-17 20:31:16 +00:00
|
|
|
volumes:
|
|
|
|
- name: deps
|
|
|
|
path: /go
|
2021-03-17 19:36:03 +00:00
|
|
|
commands:
|
2021-03-19 21:56:02 +00:00
|
|
|
- go mod download
|
2021-03-17 23:53:09 +00:00
|
|
|
- gomobile init
|
2021-03-17 19:36:03 +00:00
|
|
|
- make android
|
2021-03-17 23:56:27 +00:00
|
|
|
|
2021-03-24 23:55:14 +00:00
|
|
|
- name: build-windows
|
|
|
|
image: openpriv/mingw-go:2021.03
|
2021-03-25 01:13:45 +00:00
|
|
|
environment:
|
|
|
|
GOPATH: /go
|
2021-03-24 23:55:14 +00:00
|
|
|
volumes:
|
|
|
|
- name: deps
|
|
|
|
path: /go
|
|
|
|
commands:
|
|
|
|
- make windows
|
|
|
|
|
2021-03-25 21:00:52 +00:00
|
|
|
- name: deploy-buildfiles
|
|
|
|
image: kroniak/ssh-client
|
2021-03-25 21:14:39 +00:00
|
|
|
environment:
|
|
|
|
BUILDFILES_KEY:
|
|
|
|
from_secret: buildfiles_key
|
|
|
|
secrets: [gogs_account_token]
|
2021-03-25 21:00:52 +00:00
|
|
|
when:
|
|
|
|
event: push
|
|
|
|
status: [ success ]
|
|
|
|
commands:
|
|
|
|
- echo $BUILDFILES_KEY > ~/id_rsab64
|
|
|
|
- base64 -d ~/id_rsab64 > ~/id_rsa
|
|
|
|
- chmod 400 ~/id_rsa
|
2021-03-25 22:48:06 +00:00
|
|
|
- export DIR=libCwtch-go-`cat VERSION`-`cat BUILDDATE`
|
2021-03-25 21:00:52 +00:00
|
|
|
- mkdir $DIR
|
2021-03-25 22:48:06 +00:00
|
|
|
- mv libCwtch.so libCwtch.dll cwtch.aar cwtch-sources.jar libCwtch.h $DIR/
|
|
|
|
- cd $DIR
|
2021-03-27 01:01:35 +00:00
|
|
|
- find . -type f -exec sha256sum {} \; > ./../sha256s.txt
|
|
|
|
- mv ./../sha256s.txt .
|
2021-03-25 22:48:06 +00:00
|
|
|
- cd ..
|
2021-03-25 21:00:52 +00:00
|
|
|
- scp -r -o StrictHostKeyChecking=no -i ~/id_rsa $DIR buildfiles@openprivacy.ca:/home/buildfiles/buildfiles/
|
|
|
|
|
2021-03-17 19:36:03 +00:00
|
|
|
- name: notify-email
|
|
|
|
image: drillster/drone-email
|
2021-03-30 21:04:17 +00:00
|
|
|
settings:
|
|
|
|
host: build.openprivacy.ca
|
|
|
|
port: 25
|
|
|
|
skip_verify: true
|
|
|
|
from: drone@openprivacy.ca
|
2021-03-17 19:36:03 +00:00
|
|
|
when:
|
|
|
|
status: [ failure ]
|
2021-03-25 01:34:03 +00:00
|
|
|
|
2021-03-17 19:36:03 +00:00
|
|
|
- name: notify-gogs
|
|
|
|
image: openpriv/drone-gogs
|
|
|
|
when:
|
2021-03-25 21:00:52 +00:00
|
|
|
event: pull_request
|
2021-03-17 19:36:03 +00:00
|
|
|
status: [ success, changed, failure ]
|
2021-03-26 00:40:28 +00:00
|
|
|
environment:
|
|
|
|
GOGS_ACCOUNT_TOKEN:
|
|
|
|
from_secret: gogs_account_token
|
2021-03-29 23:55:42 +00:00
|
|
|
settings:
|
|
|
|
gogs_url: https://git.openprivacy.ca
|
2021-03-17 20:31:16 +00:00
|
|
|
|
|
|
|
volumes:
|
2021-03-17 23:53:09 +00:00
|
|
|
# gopath where bin and pkg lives to persist across steps
|
2021-03-17 20:31:16 +00:00
|
|
|
- name: deps
|
|
|
|
temp: {}
|
2021-03-25 01:32:00 +00:00
|
|
|
|
|
|
|
trigger:
|
|
|
|
repo: flutter/libcwtch-go
|
|
|
|
branch: trunk
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- pull_request
|