Skip to content

Commit

Permalink
switch to curl for discord upload
Browse files Browse the repository at this point in the history
  • Loading branch information
brahmkshatriya committed Feb 23, 2024
1 parent 00a3ac1 commit a557e63
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
cache: gradle
cache: 'gradle'

- name: Make gradlew executable
run: chmod +x ./gradlew
Expand All @@ -28,9 +28,13 @@ jobs:
with:
path: app/build/outputs/apk/debug/app-debug.apk

- name: Send file README.md to discord channel
uses: sinshutu/upload-to-discord@master
- name: Upload APK to Discord
shell: bash
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: app/build/outputs/apk/debug/app-debug.apk
VERSION: ${{ github.event.head_commit.id }}
CONTENT: ${{ github.event.head_commit.message }}
ROLE: ${{ secrets.DISCORD_PING_ROLE_ID }}
WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
run: |
contentbody=$( jq -Rsa . <<< "${{ env.CONTENT }}" )
curl -F "payload_json={\"content\":\"<@&${{ env.ROLE }}> **${{ env.VERSION }}**\n\n${contentbody:1:-1}\"}" -F "echo_beta=@app/build/outputs/apk/debug/app-debug.apk" ${{ evn.WEBHOOK }}

0 comments on commit a557e63

Please sign in to comment.