-
-
Save Sanaebadi97/04632452ba99eb3594d507dea05b86fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defualt_platforom(:android) | |
platform : android do | |
before_all do | |
ENV["SLACK_URL] ="web hook url" | |
end | |
lane :slack_build do | |
gradle(task: "assembleRelease") | |
slack(message: "Build Successful!") | |
upload_to_slack() | |
end | |
# Add this to your Fastfile | |
desc "Upload the APK to Slack channel" | |
private_lane :upload_to_slack do |options| | |
file_path = lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH] | |
file_name = file_path.gsub(/\/.*\//,"") | |
access_token = "xoxb-962620921426-966094105233-AMDOy1xTlIufyHyL1z8jmVeF" | |
channel_name = "android" | |
sh "echo Uploading " + file_name + " to Slack" | |
sh "curl https://slack.com/api/files.upload -F token=\"" + access_token + "\" -F channels=\"" + channel_name + "\" -F title=\"" + file_name + "\" -F filename=\"" + file_name + "\" -F file=@" + file_path | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment