Skip to content

disable connected devices from actionflows #3

disable connected devices from actionflows

disable connected devices from actionflows #3

Workflow file for this run

name: Android CI
on:
push:
branches: [ "master", "dev" ]
pull_request:
branches: [ "master", "dev" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Clear older runs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh run list -L400 --json databaseId -q '.[].databaseId' | tail -n+10 | xargs -IID gh api "repos/$GITHUB_REPOSITORY/actions/runs/ID" -X DELETE || :
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build and test app
run: |
./gradlew assembleDebug
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: debug-app ${{ steps.version.outputs.builddate }}
path: app/build/outputs/apk/debug/app-debug.apk
- name: Post to channel
if: ${{ success() && github.ref == 'refs/heads/master' && github.ref_type != 'tag' }}
env:
CHANNEL_ID: ${{ secrets.CHANNEL_ID }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
COMMIT_URL: ${{ github.event.head_commit.url }}
run: |
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
GITHUB_SHA_SHORT=$(git rev-parse --short HEAD)
export output=app/WaEnhancer_debug_$GITHUB_SHA_SHORT.apk
mv app/build/outputs/apk/debug/app-debug.apk $output
ESCAPED=`python3 -c 'import json,os,urllib.parse; msg = json.dumps(os.environ["COMMIT_MESSAGE"]); print(urllib.parse.quote(msg if len(msg) <= 1024 else json.dumps(os.environ["COMMIT_URL"])))'`
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%2Foutput%22%2C%22caption%22:${ESCAPED}%7D%5D" -F output="@$output"
fi