image: archlinux packages: - rustup - rsync - clang - wget sources: - https://git.sr.ht/~simulacrumparty/bnglws-client secrets: - 61fdfc2d-f964-49ef-8bc6-e7a7286a1270 - 808ed4b8-9e8c-4ec1-9366-582961709fbc tasks: - setup: | rustup default nightly rustup target add x86_64-apple-darwin mkdir bnglws-client/.cargo echo -e '[target.x86_64-apple-darwin]\nlinker = "x86_64-apple-darwin14-clang"\nar = "x86_64-apple-darwin14-ar"' > bnglws-client/.cargo/config git clone https://github.com/tpoechtrager/osxcross wget -nc https://s3.dockerproject.org/darwin/v2/MacOSX10.10.sdk.tar.xz mv MacOSX10.10.sdk.tar.xz osxcross/tarballs/ UNATTENDED=yes OSX_VERSION_MIN=10.7 ./osxcross/build.sh - build: | cd bnglws-client cargo build --target x86_64-unknown-linux-gnu --release PATH="$(pwd)/../osxcross/target/bin:$PATH" cargo build --target x86_64-apple-darwin --release - deploy: | cd bnglws-client tar -czvf x86_64-apple-darwin.tar.gz target/x86_64-apple-darwin/release/bngl tar -czvf x86_64-unknown-linux-gnu.tar.gz target/x86_64-unknown-linux-gnu/release/bngl ssh_target=$(cat /home/build/.ssh_target) sshopts="ssh -o StrictHostKeyChecking=no" rsync --rsh="$sshopts" -rP x86_64-apple-darwin.tar.gz $ssh_target:/var/www/bnglws/static/releases/x86_64-apple-darwin.tar.gz rsync --rsh="$sshopts" -rP x86_64-unknown-linux-gnu.tar.gz $ssh_target:/var/www/bnglws/static/releases/x86_64-unknown-linux-gnu.tar.gz