--- kind: pipeline type: docker name: linux-android-test clone: disable: true steps: - name: clone image: cirrusci/flutter:3.0.1 environment: buildbot_key_b64: from_secret: buildbot_key_b64 commands: - mkdir ~/.ssh - echo $buildbot_key_b64 > ~/.ssh/id_rsa.b64 - base64 -d ~/.ssh/id_rsa.b64 > ~/.ssh/id_rsa - chmod 400 ~/.ssh/id_rsa # force by pass of ssh host key check, less secure - ssh-keyscan -H git.openprivacy.ca >> ~/.ssh/known_hosts # use Drone ssh var instead of hardcode to allow forks to build (gogs@git.openprivacy.ca:cwtch.im/cwtch-ui.git) - git clone gogs@git.openprivacy.ca:$DRONE_REPO.git . - git checkout $DRONE_COMMIT - name: fetch image: cirrusci/flutter:3.0.1 volumes: - name: deps path: /root/.pub-cache commands: - ./fetch-tor.sh - echo `git describe --tags --abbrev=1` > VERSION - echo `date +%G-%m-%d-%H-%M` > BUILDDATE - flutter pub get - mkdir deploy - ./fetch-libcwtch-go.sh #- 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 image: openpriv/flutter-desktop:linux-fstable-3.0.1 volumes: - name: deps path: /root/.pub-cache commands: - flutter build linux --dart-define BUILD_VER=`cat VERSION` --dart-define BUILD_DATE=`cat BUILDDATE` - linux/package-release.sh - mkdir -p deploy/cwtch - cp -r build/linux/x64/release/bundle/* deploy/cwtch - cd deploy - tar -czf cwtch-`cat ../VERSION`.tar.gz cwtch - rm -r cwtch - name: test-build-android image: cirrusci/flutter:3.0.1 when: event: pull_request volumes: - name: deps path: /root/.pub-cache commands: - flutter build apk --debug - name: build-android image: cirrusci/flutter:3.0.1 when: event: push environment: upload_jks_file_b64: from_secret: upload_jks_file_b64 upload_jks_pass: from_secret: upload_jks_pass volumes: - name: deps path: /root/.pub-cache commands: - echo $upload_jks_file_b64 > upload-keystore.jks.b64 - base64 -i --decode upload-keystore.jks.b64 > android/app/upload-keystore.jks - sed -i "s/%jks-password%/$upload_jks_pass/g" android/key.properties - flutter build appbundle --dart-define BUILD_VER=`cat VERSION` --dart-define BUILD_DATE=`cat BUILDDATE` # cant do debug for final release, this is just a stop gap - flutter build apk --dart-define BUILD_VER=`cat VERSION` --dart-define BUILD_DATE=`cat BUILDDATE` # or build apk --split-per-abi ? - cp build/app/outputs/bundle/release/app-release.aab deploy/ - cp build/app/outputs/apk/release/app-release.apk deploy/ #- cp build/app/outputs/flutter-apk/app-debug.apk deploy/android - name: widget-tests image: cirrusci/flutter:3.0.1 volumes: - name: deps path: /root/.pub-cache commands: # - flutter config --enable-linux-desktop - flutter test --coverage - genhtml coverage/lcov.info -o coverage/html - name: deploy-buildfiles image: kroniak/ssh-client pull: if-not-exists 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=flwtch-`cat BUILDDATE`-`cat VERSION` - mv deploy $DIR - cp -r coverage/html $DIR/coverage-tests - cp -r test/failures $DIR/test-failures || true - cd $DIR - find . -type f -exec sha256sum {} \; > ./../sha256s.txt - mv ./../sha256s.txt . - cd .. - scp -r -o StrictHostKeyChecking=no -i ~/id_rsa $DIR buildfiles@build.openprivacy.ca:/home/buildfiles/buildfiles/ - name: notify-email image: drillster/drone-email pull: if-not-exists settings: host: build.openprivacy.ca port: 25 skip_verify: true from: drone@openprivacy.ca when: status: [ failure ] - name: notify-gogs image: openpriv/drone-gogs pull: if-not-exists 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: - name: deps temp: {} trigger: #repo: cwtch.im/cwtch-ui # allow forks to build? branch: trunk event: - push - pull_request --- kind: pipeline type: docker name: windows platform: os: windows #arch: amd64 version: 1809 clone: disable: true steps: - name: clone image: openpriv/flutter-desktop:windows-sdk30-fstable-3.0.1 environment: buildbot_key_b64: from_secret: buildbot_key_b64 commands: #- # force by pass of ssh host key check, less secure #- ssh-keyscan -H git.openprivacy.ca >> ..\known_hosts - echo $Env:buildbot_key_b64 > ..\id_rsa.b64 - certutil -decode ..\id_rsa.b64 ..\id_rsa - git init # -o UserKnownHostsFile=../known_hosts - git config core.sshCommand 'ssh -o StrictHostKeyChecking=no -i ../id_rsa' - git remote add origin gogs@git.openprivacy.ca:$Env:DRONE_REPO.git - git pull origin trunk - git fetch --tags - git checkout $Env:DRONE_COMMIT - name: fetch image: openpriv/flutter-desktop:windows-sdk30-fstable-3.0.1 commands: - git describe --tags --abbrev=1 > VERSION - powershell -command "Get-Date -Format 'yyyy-MM-dd-HH-mm'" > BUILDDATE - .\fetch-tor-win.ps1 - .\fetch-libcwtch-go.ps1 - name: build-windows image: openpriv/flutter-desktop:windows-sdk30-fstable-3.0.1 commands: - flutter pub get - $Env:version += type .\VERSION - $Env:builddate += type .\BUILDDATE - $Env:releasedir = "build\\windows\\runner\\Release\\" - flutter build windows --dart-define BUILD_VER=$Env:version --dart-define BUILD_DATE=$Env:builddate - copy windows\libCwtch.dll $Env:releasedir # flutter hasn't worked out it's packaging of required dll's so we have to resort to this manual nonsense # https://github.com/google/flutter-desktop-embedding/issues/587 # https://github.com/flutter/flutter/issues/53167 - copy C:\BuildTools\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT\vcruntime140.dll $Env:releasedir - copy C:\BuildTools\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT\vcruntime140_1.dll $Env:releasedir - copy C:\BuildTools\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT\msvcp140.dll $Env:releasedir - copy README.md $Env:releasedir\ - copy windows\*.bat $Env:releasedir\ - powershell -command "Expand-Archive -Path tor.zip -DestinationPath $Env:releasedir\Tor" - name: package-windows image: openpriv/nsis pull: if-not-exists when: event: push status: [ success ] environment: pfx: from_secret: pfx pfx_pass: from_secret: pfx_pass commands: - $Env:version += type .\VERSION - $Env:builddate += type .\BUILDDATE - $Env:releasedir = "build\\windows\\runner\\Release\\" - $Env:zip = 'cwtch-' + $Env:version + '.zip' - $Env:zipsha = $Env:zip + '.sha512' - $Env:msix = 'cwtch-install-' + $Env:version + '.msix' - $Env:msixsha = $Env:msix + '.sha512' - $Env:buildname = 'flwtch-win-' + $Env:builddate + '-' + $Env:version - $Env:builddir = $Env:buildname - echo $Env:pfx > codesign.pfx.b64 - certutil -decode codesign.pfx.b64 codesign.pfx - signtool sign /v /fd sha256 /a /f codesign.pfx /p $Env:pfx_pass /tr http://timestamp.digicert.com $Env:releasedir\cwtch.exe - copy windows\runner\resources\knot_128.ico $Env:releasedir\cwtch.ico - makensis windows\nsis\cwtch-installer.nsi - move windows\nsis\cwtch-installer.exe cwtch-installer.exe - signtool sign /v /fd sha256 /a /f codesign.pfx /p $Env:pfx_pass /tr http://timestamp.digicert.com cwtch-installer.exe - powershell -command "(Get-FileHash cwtch-installer.exe -Algorithm sha512).Hash" > cwtch-installer.sha512 - mkdir deploy - mkdir deploy\$Env:builddir - move $Env:releasedir $Env:builddir - powershell -command "Compress-Archive -Path $Env:builddir -DestinationPath cwtch.zip" - powershell -command "(Get-FileHash cwtch.zip -Algorithm sha512).Hash" > $Env:zipsha - move cwtch-installer.exe deploy\$Env:builddir\cwtch-installer.exe - move cwtch.zip deploy\$Env:builddir\$Env:zip - move *.sha512 deploy\$Env:builddir - name: deploy-windows image: openpriv/flutter-desktop:windows-sdk30-fstable-3.0.1 when: event: push status: [ success ] environment: BUILDFILES_KEY: from_secret: buildfiles_key commands: - echo $Env:BUILDFILES_KEY > id_rsab64 - certutil -decode id_rsab64 id_rsa - scp -r -o StrictHostKeyChecking=no -i id_rsa deploy\\* buildfiles@build.openprivacy.ca:/home/buildfiles/buildfiles/ trigger: # repo: cwtch.im/cwtch-ui # allow forks to build? branch: trunk event: - push - pull_request --- kind: pipeline type: exec name: macos platform: os: darwin arch: amd64 clone: disable: true steps: - name: clone environment: buildbot_key_b64: from_secret: buildbot_key_b64 commands: - mkdir ~/.ssh - echo $buildbot_key_b64 > ~/.ssh/id_rsa.b64 - base64 -d ~/.ssh/id_rsa.b64 > ~/.ssh/id_rsa - chmod 400 ~/.ssh/id_rsa # force by pass of ssh host key check, less secure - ssh-keyscan -H git.openprivacy.ca >> ~/.ssh/known_hosts - git init - git config core.sshCommand 'ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa' - git remote add origin gogs@git.openprivacy.ca:$DRONE_REPO.git - git pull origin trunk - git fetch --tags - git checkout $DRONE_COMMIT # use Drone ssh var instead of hardcode to allow forks to build (gogs@git.openprivacy.ca:cwtch.im/cwtch-ui.git) #- git clone gogs@git.openprivacy.ca:$DRONE_REPO.git . #- git checkout $DRONE_COMMIT - name: fetch commands: - ./fetch-tor-macos.sh - echo `git describe --tags --abbrev=1` > VERSION - echo `date +%G-%m-%d-%H-%M` > BUILDDATE - export PATH=$PATH:/Users/Dan/development/flutter/bin - flutter pub get - mkdir deploy - ./fetch-libcwtch-go-macos.sh - gem install --user-install cocoapods - name: build-macos commands: - export PATH=$PATH:/Users/Dan/development/flutter/bin - export GEM_HOME=$HOME/.gem - export PATH=$GEM_HOME/ruby/2.6.0/bin:$PATH - flutter config --enable-macos-desktop - flutter build macos --dart-define BUILD_VER=`cat VERSION` --dart-define BUILD_DATE=`cat BUILDDATE` - export PATH=$PATH:/usr/local/bin #create-dmg - macos/package-release.sh - mkdir -p deploy - mv Cwtch.dmg deploy - name: deploy-buildfiles environment: BUILDFILES_KEY: from_secret: buildfiles_key when: event: push status: [ success ] commands: - echo $BUILDFILES_KEY > ~/id_rsab64 - base64 -d ~/id_rsab64 > ~/id_rsa - chmod 400 ~/id_rsa - export DIR=flwtch-macos-`cat BUILDDATE`-`cat VERSION` - mv deploy $DIR - cd $DIR - find . -type f -exec shasum -a 512 {} \; > ./../sha512s.txt - mv ./../sha512s.txt . - cd .. - scp -r -o StrictHostKeyChecking=no -i ~/id_rsa $DIR buildfiles@build.openprivacy.ca:/home/buildfiles/buildfiles/ trigger: #repo: cwtch.im/cwtch-ui # allow forks to build? branch: trunk event: - push - pull_request