Skip to content

Commit 9e1be7c

Browse files
committed
ci: Update post message
* test 8
1 parent 84159c5 commit 9e1be7c

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

.github/workflows/simple.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,21 @@ jobs:
3333
with:
3434
name: AndroidExampleApp
3535
path: composeApp/build/outputs/apk/release
36-
- name: Find apk
37-
run: |
38-
echo "RELEASE=$(find 'composeApp/build/outputs/apk/release' -name '*.apk')" >> $GITHUB_ENV
39-
echo "DEBUG=$(find 'composeApp/build/outputs/apk/debug' -name '*.apk')" >> $GITHUB_ENV
4036
- name: Post to Telegram ci channel
4137
if: ${{ success() && github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && github.ref_type != 'tag' }}
4238
env:
4339
CHANNEL_ID: ${{ secrets.CHANNEL_ID }}
4440
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
45-
RELEASE: ${{ env.RELEASE }}
46-
DEBUG: ${{ env.DEBUG }}
41+
COMMIT_MESSAGE: |+
42+
New CI from miuix\-kotlin\-multiplatform
43+
44+
```
45+
${{ github.event.head_commit.message }}
46+
```
4747
run: |
4848
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
49-
event_path=$GITHUB_EVENT_PATH
50-
commit_count=$(jq -r '.commits | length' $event_path)
51-
{ echo -e 'New CI from miuix-kotlin-multiplatform\n'; git log -$commit_count --pretty=format:"%h %s"; } > ${{ github.workspace }}/git_log
52-
ESCAPED="$(cat ${{ github.workspace }}/git_log | gawk '{gsub(/[_*[\]()~`>#+=\|{}.!-]/,"\\\\\\\\&")}1' | sed -e 's|"|\\"|g' -e 's|^[0-9a-z]\+|__&__|' | hexdump -v -e '/1 "%02X"' | sed 's/\(..\)/%\1/g')"
53-
cd ${{ github.workspace }}
54-
curl -v "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${CHANNEL_ID}&media=%5B%7B%22type%22%3A%22document%22%2C%22media%22%3A%22attach%3A%2F%2Frelease%22%7D%2C%7B%22type%22%3A%22document%22%2C%22media%22%3A%22attach%3A%2F%2Fdebug%22%2C%22caption%22%3A%22${ESCAPED}%22%2C%22parse_mode%22%3A%22MarkdownV2%22%7D%5D" -F release="@$RELEASE" -F debug="@$DEBUG"
49+
export RELEASE=$(find ./composeApp/build/outputs/apk/release -name "*.apk")
50+
export DEBUG=$(find ./composeApp/build/outputs/apk/debug -name "*.apk")
51+
ESCAPED=`python3 -c 'import json,os,urllib.parse; print(urllib.parse.quote(json.dumps(os.environ["COMMIT_MESSAGE"])))'`
52+
curl -v "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${CHANNEL_ID}&media=%5B%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2Frelease%22%7D%2C%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2Fdebug%22%2C%22parse_mode%22%3A%22MarkdownV2%22%2C%22caption%22%3A${ESCAPED}%7D%5D" -F release="@$RELEASE" -F debug="@$DEBUG"
5553
fi

composeApp/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ kotlin {
6161
}
6262
binaries.executable()
6363
}
64+
6465
js(IR) {
6566
moduleName = "uitest"
6667
browser {
@@ -71,7 +72,6 @@ kotlin {
7172
binaries.executable()
7273
}
7374

74-
7575
sourceSets {
7676
val desktopMain by getting
7777

0 commit comments

Comments
 (0)