Skip to content

Monthly alpha

Monthly alpha #300

Workflow file for this run

name: Monthly debug
on:
workflow_dispatch: # to be able to run it manually
schedule:
- cron: '53 21 27 * *' # on 27 every month
jobs:
evaluateChanges:
name: Evaluate changes
runs-on: ubuntu-latest
outputs:
SHOULD_BUILD: ${{ steps.check.outputs.shouldBuild }}
steps:
- name: Check
id: check
run: |
echo shouldBuild=true >> $GITHUB_OUTPUT
build:
name: Monthlies
runs-on: ubuntu-latest
needs: evaluateChanges
if: needs.evaluateChanges.outputs.SHOULD_BUILD == 'true'
env:
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHANNEL_ID }}
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
SCHEDULED_BUILD_VARIANT: "assembleWebsiteFullDebug"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: JDK17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Build & notify
if: env.TELEGRAM_CHAT_ID && env.SCHEDULED_BUILD_VARIANT && env.TELEGRAM_TOKEN
run: |
# for now, support just one build variant
for TASK in $SCHEDULED_BUILD_VARIANT; do
./gradlew $TASK
apk_path="$(find . -type f -iname '*.apk' | head -n1)"
echo $apk_path
echo "APKFILE=${apk_path}" >> $GITHUB_ENV
curl https://api.telegram.org/bot$TELEGRAM_TOKEN/sendDocument \
-F chat_id="$TELEGRAM_CHAT_ID" \
-F "caption=Size: $(ls -l --block-size=K "$apk_path" | awk '{ print $5 }')" \
-F parse_mode=HTML \
-F document=@"$apk_path" || true
done
# github.com/actions/upload-artifact
- name: Upload
uses: actions/upload-artifact@v3
if: success()
with:
name: rdns-${{ github.sha }}
path: ${{ env.APKFILE }}
if-no-files-found: error
# github.com/softprops/action-gh-release
- name: Release
uses: softprops/action-gh-release@v1
with:
prerelease: true
files: |
${{ env. APKFILE }}