Skip to content

Commit

Permalink
workflows: Add multiple changes
Browse files Browse the repository at this point in the history
- Link signing environment to CI
- Upload manager when build was finished (https://t.me/rsukrnlprjkt)
- Fix permissions

Signed-off-by: rsuntk <[email protected]>
  • Loading branch information
rsuntk committed Nov 2, 2024
1 parent a7f5b6a commit e261a24
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 104 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:

build-manager:
needs: build-ksud
environment: signing
runs-on: ubuntu-latest
defaults:
run:
Expand Down Expand Up @@ -147,7 +148,6 @@ jobs:
env:
CHAT_ID: ${{ secrets.CHAT_ID }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
MESSAGE_THREAD_ID: ${{ secrets.MESSAGE_THREAD_ID }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
COMMIT_URL: ${{ github.event.head_commit.url }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
Expand All @@ -156,6 +156,5 @@ jobs:
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
export VERSION=$(git rev-list --count HEAD)
APK=$(find ./app/build/outputs/apk/release -name "*.apk")
pip3 install telethon
python3 $GITHUB_WORKSPACE/scripts/ksubot.py $APK
bash $GITHUB_WORKSPACE/scripts/uploadtg_handler.sh $APK
fi
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
- build-wsa-kernel
- build-arcvm-kernel
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
Expand Down
101 changes: 0 additions & 101 deletions scripts/ksubot.py

This file was deleted.

15 changes: 15 additions & 0 deletions scripts/uploadtg_handler.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/env bash
msg="*$TITLE*
\\#ci\\_$VERSION
\`\`\`
$COMMIT_MESSAGE
\`\`\`
[Commit]($COMMIT_URL)
[Workflow run]($RUN_URL)
"
file="$1"
curl -s -F document=@$file "https://api.telegram.org/bot$BOT_TOKEN/sendDocument" \
-F chat_id="$CHAT_ID" \
-F "disable_web_page_preview=true" \
-F "parse_mode=markdownv2" \
-F caption="$msg"

0 comments on commit e261a24

Please sign in to comment.