#99 test notification

This commit is contained in:
neil 2022-12-22 09:15:59 +08:00
parent cd95d79214
commit f333deae9f
3 changed files with 31 additions and 5 deletions

27
.github/notify-slack.js vendored Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env node
async function main() {
const message = {
blocks: [
{
type: 'section',
text: {
type: 'mrkdwn',
text: `NEW BUILD FOR ${process.env.PLATFORM} <${process.env.DOWNLOAD_URL}|download>`
}
}
]
}
const res = fetch(process.env.SLACK_WEBHOOK, {
method: 'POST',
body: JSON.stringify(message),
headers: { 'Content-Type': 'application/json' }
})
if (res.ok) {
const data = await res.json();
console.log(data);
}
}
main();

View file

@ -127,9 +127,8 @@ jobs:
aws s3 cp ./modules/gui/src-tauri/target/release/bundle/deb/tea_0.1.0_amd64.deb \
s3://preview.gui.tea.xyz/release/tea_${{ steps.date.outputs.unix_seconds }}.deb
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
run: ./.github/notify-slack.js
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: GH_GUI_BOT
SLACK_TITLE: LATEST BUILD {{matrix.platform}}
SLACK_MESSAGE: download <s3://preview.gui.tea.xyz/release/tea_${{ steps.date.outputs.unix_seconds }}.${{ matrix.platform == 'ubuntu-latest' && 'deb' || 'dmg'}}|here>
PLATFORM: ${{ matrix.platform }}
DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/release/tea_${{ steps.date.outputs.unix_seconds }}.${{ matrix.platform == 'ubuntu-latest' && 'deb' || 'dmg'}}

View file

@ -1,7 +1,7 @@
[package]
name = "app"
version = "0.1.0"
description = "A tea.xyz desktop app to complete the cli"
description = "A tea.xyz desktop app"
authors = ["you"]
license = ""
repository = ""