C-bindings for the Go Cwtch Library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
3.2 KiB

  1. ---
  2. kind: pipeline
  3. type: docker
  4. name: default
  5. steps:
  6. - name: fetch
  7. image: golang
  8. volumes:
  9. - name: deps
  10. path: /go
  11. commands:
  12. - wget https://git.openprivacy.ca/openprivacy/buildfiles/raw/master/tor/tor
  13. - wget https://git.openprivacy.ca/openprivacy/buildfiles/raw/master/tor/torrc
  14. - chmod a+x tor
  15. - go get -u golang.org/x/lint/golint
  16. - git fetch --tags
  17. #- export GO111MODULE=on
  18. #- go mod vendor
  19. - go get
  20. # TODO: upgrade to go1.16, remove mod/vendor, add go install for 1.16
  21. - echo `git describe --tags` > VERSION
  22. - echo `date +%G-%m-%d-%H-%M` > BUILDDATE
  23. - name: quality
  24. image: golang
  25. volumes:
  26. - name: deps
  27. path: /go
  28. commands:
  29. - go list ./... | xargs go vet
  30. - go list ./... | xargs golint
  31. #Todo: fix all the lint errors and add `-set_exit_status` above to enforce linting
  32. - name: build-linux
  33. image: golang
  34. volumes:
  35. - name: deps
  36. path: /go
  37. commands:
  38. - make linux
  39. - name: build-android
  40. image: openpriv/android-go-mobile:2021.03
  41. volumes:
  42. - name: deps
  43. path: /go
  44. commands:
  45. - go mod download
  46. - gomobile init
  47. - make android
  48. - name: build-windows
  49. image: openpriv/mingw-go:2021.03
  50. environment:
  51. GOPATH: /go
  52. volumes:
  53. - name: deps
  54. path: /go
  55. commands:
  56. - make windows
  57. - name: deploy-buildfiles
  58. image: kroniak/ssh-client
  59. environment:
  60. BUILDFILES_KEY:
  61. from_secret: buildfiles_key
  62. secrets: [gogs_account_token]
  63. when:
  64. event:
  65. - push
  66. - tag
  67. status: [ success ]
  68. commands:
  69. - echo $BUILDFILES_KEY > ~/id_rsab64
  70. - base64 -d ~/id_rsab64 > ~/id_rsa
  71. - chmod 400 ~/id_rsa
  72. - export DIR=libCwtch-go-`cat VERSION`-`cat BUILDDATE`
  73. - mkdir $DIR
  74. - mv libCwtch.so libCwtch.dll cwtch.aar cwtch-sources.jar libCwtch.h $DIR/
  75. - cd $DIR
  76. - find . -type f -exec sha256sum {} \; > ./../sha256s.txt
  77. - mv ./../sha256s.txt .
  78. - cd ..
  79. - scp -r -o StrictHostKeyChecking=no -i ~/id_rsa $DIR buildfiles@openprivacy.ca:/home/buildfiles/buildfiles/
  80. - name: gitea-release
  81. image: plugins/gitea-release
  82. when:
  83. event: tag
  84. settings:
  85. api_key:
  86. from_secret: gogs_account_token
  87. base_url: https://git.openprivacy.ca
  88. files:
  89. - libCwtch.so
  90. - libCwtch.dll
  91. - cwtch.aar
  92. - cwtch-sources.jar
  93. - libCwtch.h
  94. checksum:
  95. - sha256
  96. - sha512
  97. - name: notify-email
  98. image: drillster/drone-email
  99. settings:
  100. host: build.openprivacy.ca
  101. port: 25
  102. skip_verify: true
  103. from: drone@openprivacy.ca
  104. when:
  105. status: [ failure ]
  106. - name: notify-gogs
  107. image: openpriv/drone-gogs
  108. when:
  109. event: pull_request
  110. status: [ success, changed, failure ]
  111. environment:
  112. GOGS_ACCOUNT_TOKEN:
  113. from_secret: gogs_account_token
  114. settings:
  115. gogs_url: https://git.openprivacy.ca
  116. volumes:
  117. # gopath where bin and pkg lives to persist across steps
  118. - name: deps
  119. temp: {}
  120. trigger:
  121. repo: cwtch.im/libcwtch-go
  122. branch: trunk
  123. event:
  124. - push
  125. - pull_request
  126. - tag