Skip to content

Instantly share code, notes, and snippets.

@Nesh108
Created April 22, 2020 07:40
Show Gist options
  • Save Nesh108/aa8b9888e31041088e290276e37616d9 to your computer and use it in GitHub Desktop.
Save Nesh108/aa8b9888e31041088e290276e37616d9 to your computer and use it in GitHub Desktop.
Unity3D-CI: Running Automated Builds via Script - Discord Message
#!/usr/bin/env bash
set -ex
LICENSE_PATH="<PATH_TO_YOUR_LICENSE_FILE>"
export UNITY_VERSION="2019.3.9f1"
export BUILD_NAME="<YOUR_PROJECT_NAME>"
export UNITY_LICENSE_CONTENT="$(cat $LICENSE_PATH)"
export UNITY_USERNAME="<YOUR_UNITY_USERNAME>"
export UNITY_PASSWORD="<YOUR_UNITY_PASSWORD>"
export IMAGE_NAME="gableroux/unity3d:$UNITY_VERSION"
BUILD_TARGET=StandaloneWindows64 ./ci/build.sh
BUILD_TARGET=StandaloneOSX ./ci/build.sh
BUILD_TARGET=StandaloneLinux64 ./ci/build.sh
# Send message to Discord channel
BOT_USERNAME="<YOUR_BOT_NAME>"
CONTENT="Builds completed!"
WEBHOOK="<YOUR_WEBHOOK>"
curl -H "Content-Type: application/json" -X POST -d '{"username": "'"$BOT_USERNAME"'", "content": "'"$CONTENT"'"}' $WEBHOOK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment