Skip to content

Commit 1751371

Browse files
committed
add slack notification
1 parent 80e8bd1 commit 1751371

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

.github/workflows/generate_assets.yml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ jobs:
122122
V8_FILE_ID="${{ secrets.ASSETS_V8_FILE_ID }}"
123123
V7_FILE_ID="${{ secrets.ASSETS_V7_FILE_ID }}"
124124
125-
V8_PATH="app/build/outputs/assets/assets-arm64-v8a.zip"
126-
V7_PATH="app/build/outputs/assets/assets-armeabi-v7a.zip"
125+
V8_PATH="${{ steps.assets_v8.outputs.ASSETS_PATH }}"
126+
V7_PATH="${{ steps.assets_v7.outputs.ASSETS_PATH }}"
127127
128128
# Upload v8
129129
response=$(curl -s -o /dev/null -w "%{http_code}" --fail -X PATCH \
@@ -149,6 +149,46 @@ jobs:
149149
150150
echo "Upload complete."
151151
152+
- name: Send Rich Slack Notification
153+
env:
154+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
155+
run: |
156+
V8_PATH="${{ steps.assets_v8.outputs.ASSETS_PATH }}"
157+
V7_PATH="${{ steps.assets_v7.outputs.ASSETS_PATH }}"
158+
159+
jq -n \
160+
--arg v8_path "$V8_PATH" \
161+
--arg v7_path "$V7_PATH" \
162+
'{
163+
blocks: [
164+
{
165+
type: "header",
166+
text: {
167+
type: "plain_text",
168+
text: ":rocket: [Updated] New Assets Zips Available",
169+
emoji: true
170+
}
171+
},
172+
{
173+
type: "section",
174+
text: {
175+
type: "mrkdwn",
176+
text: "*V8 Path:* `$v8_path`"
177+
}
178+
},
179+
{
180+
type: "section",
181+
text: {
182+
type: "mrkdwn",
183+
text: "*V7 Path:* `$v7_path`"
184+
}
185+
}
186+
]
187+
}' > payload.json
188+
189+
# curl -X POST -H "Content-type: application/json" --data @payload.json "$SLACK_WEBHOOK"
190+
191+
rm -f payload.json
152192
- name: Cleanup google-services.json
153193
if: always()
154194
run: |

0 commit comments

Comments
 (0)