This repository has been archived on 2023-06-16. You can view files and clone it, but cannot push or open issues or pull requests.
libcwtch-go/.drone.yml

191 lines
4.6 KiB
YAML
Raw Normal View History

2021-06-24 22:30:46 +00:00
---
kind: pipeline
type: docker
2021-11-04 22:03:25 +00:00
name: linux-android-windows-test
2021-06-24 22:30:46 +00:00
steps:
- name: fetch
image: golang:1.17.5
2021-06-24 22:30:46 +00:00
volumes:
- name: deps
path: /go
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
- go get -u golang.org/x/lint/golint
- git fetch --tags
#- export GO111MODULE=on
#- go mod vendor
- go mod download
# mobile is... special
# go get golang.org/x/mobile/bind
2021-06-24 22:30:46 +00:00
# TODO: upgrade to go1.16, remove mod/vendor, add go install for 1.16
- echo `git describe --tags` > VERSION
- echo `date +%G-%m-%d-%H-%M` > BUILDDATE
- name: quality
image: golang:1.17.5
2021-06-24 22:30:46 +00:00
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
image: golang:1.17.5
2021-06-24 22:30:46 +00:00
volumes:
- name: deps
path: /go
commands:
- make linux
- name: build-android
image: openpriv/android-go-mobile:2022.09
2021-06-24 22:30:46 +00:00
volumes:
- name: deps
path: /go
commands:
- go mod download
- gomobile init
- make android
- name: build-windows
image: openpriv/mingw-go:2022.09
2021-06-24 22:30:46 +00:00
environment:
GOPATH: /go
volumes:
- name: deps
path: /go
commands:
- make windows
- name: deploy-buildfiles
image: kroniak/ssh-client
pull: if-not-exists
2021-06-24 22:30:46 +00:00
environment:
BUILDFILES_KEY:
from_secret: buildfiles_key
secrets: [gogs_account_token]
when:
event:
- push
- tag
status: [ success ]
commands:
- echo $BUILDFILES_KEY > ~/id_rsab64
- base64 -d ~/id_rsab64 > ~/id_rsa
- chmod 400 ~/id_rsa
2021-11-04 21:46:05 +00:00
- export DIR=libCwtch-go-`cat BUILDDATE`-`cat VERSION`
2021-06-24 22:30:46 +00:00
- mkdir $DIR
- mv libCwtch.so libCwtch.dll cwtch.aar cwtch-sources.jar libCwtch.h $DIR/
- cd $DIR
- find . -type f -exec sha256sum {} \; > ./../sha256s.txt
- mv ./../sha256s.txt .
- cd ..
2021-08-06 21:48:53 +00:00
- scp -r -o StrictHostKeyChecking=no -i ~/id_rsa $DIR buildfiles@build.openprivacy.ca:/home/buildfiles/buildfiles/
2021-06-24 22:30:46 +00:00
- name: gitea-release
image: plugins/gitea-release
pull: if-not-exists
2021-06-24 22:30:46 +00:00
when:
event: tag
settings:
api_key:
from_secret: gogs_account_token
base_url: https://git.openprivacy.ca
files:
- libCwtch.so
- libCwtch.dll
- cwtch.aar
- cwtch-sources.jar
- libCwtch.h
checksum:
- sha256
- sha512
- name: notify-gogs
image: openpriv/drone-gogs
pull: if-not-exists
2021-06-24 22:30:46 +00:00
when:
event: pull_request
status: [ success, changed, failure ]
environment:
GOGS_ACCOUNT_TOKEN:
from_secret: gogs_account_token
settings:
gogs_url: https://git.openprivacy.ca
volumes:
# gopath where bin and pkg lives to persist across steps
- name: deps
temp: {}
trigger:
2021-06-24 22:47:48 +00:00
repo: cwtch.im/libcwtch-go
2021-06-24 22:30:46 +00:00
branch: trunk
event:
- push
- pull_request
- tag
2021-11-04 21:46:05 +00:00
---
kind: pipeline
type: exec
name: macos
platform:
os: darwin
arch: amd64
steps:
- name: fetch
commands:
- export PATH=$PATH:/usr/local/go/bin/
- git fetch --tags
- go get
# TODO: upgrade to go1.16, remove mod/vendor, add go install for 1.16
- echo `git describe --tags` > VERSION
- echo `date +%G-%m-%d-%H-%M` > BUILDDATE
2022-06-22 16:13:18 +00:00
- name: build-macos-x64
2021-11-04 21:46:05 +00:00
commands:
- export PATH=$PATH:/usr/local/go/bin/
2022-06-22 18:41:51 +00:00
- make libCwtch.x64.dylib
2022-06-22 16:13:18 +00:00
- name: build-macos-arm64
when:
2022-06-22 18:51:04 +00:00
event:
- push
2022-06-22 16:13:18 +00:00
status: [ success ]
commands:
- export PATH=$PATH:/usr/local/go/bin/
2022-06-22 19:34:01 +00:00
- make libCwtch.arm64.dylib
2021-11-04 21:46:05 +00:00
- name: deploy-buildfiles
environment:
BUILDFILES_KEY:
from_secret: buildfiles_key
when:
event:
- push
status: [ success ]
commands:
2021-11-04 22:03:25 +00:00
- echo $BUILDFILES_KEY > ~/id_rsab64
- base64 -d ~/id_rsab64 > ~/id_rsa
- chmod 400 ~/id_rsa
2021-11-04 21:46:05 +00:00
- export DIR=libCwtch-go-macos-`cat BUILDDATE`-`cat VERSION`
- mkdir $DIR
2022-06-22 19:23:41 +00:00
- mv libCwtch.x64.dylib $DIR/
2022-06-22 19:34:01 +00:00
- mv libCwtch.arm64.dylib $DIR/
2021-11-04 21:46:05 +00:00
- cd $DIR
- find . -type f -exec shasum -a 512 {} \; > ./../sha512s.txt
- mv ./../sha512s.txt .
- cd ..
2021-11-04 22:03:25 +00:00
- scp -r -o StrictHostKeyChecking=no -i ~/id_rsa $DIR buildfiles@build.openprivacy.ca:/home/buildfiles/buildfiles/
2021-11-04 21:46:05 +00:00
trigger:
repo: cwtch.im/libcwtch-go
branch: trunk
event:
- push
- pull_request