How to distribute APK to Slack Automatically.
olulo’s APK has been distributed at Slack for QA.
To distribute it, Github workflows was uploading APK to AWS and linked it into Slack message.
So I registered back log to upload directly long time ago and I resolved it yesterday.
Today I will share how to do.
First, I searched there is workflow to achieve it.
And Found out this workflow slack-file-upload-action
Let’s see
Version
If you tag as app version, you can get the tag like this
${GITHUB_REF/refs\/tags\//}
And you can export it to use in another step
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
Token
We need a slack token to use MeilCli/slack-upload-file@v1
Creates Slack App
copy it and paste to “slack_token”
slack_token: xx
Grants permission
To use this token, you have to grant the file write permission.
Bot
Bot user needs to upload APK.
Creates Bot
Install App to Workspace
Install App to Target Channel
To upload file by Bot, the Bot have to join to target Channel.
But Bot is not user and we can’t invite him.
So we have to install Bot to target Channel.
See your target channel’s integration
Channel
channels: {your channel name}
File
file_path: {Path of file to upload}
file_name: {New file name to use upload}
file_type: ‘apk’
Message
initial_comment: {Chat message to present with uploaded file}
Unfortunately we can’t mention others with this message.
Because Slack’s file.upload api doesn’t support link_names
Title
title: {Title to present instead of uploaded file name}
Workflow
you can now distribute APK to Slack with this Github workflow