LibreTube/.github/workflows/ci.yml
2022-09-28 18:49:53 +05:30

90 lines
2.7 KiB
YAML

name: CI
on:
workflow_dispatch:
pull_request:
paths-ignore:
- "README*.md"
- "fastlane/**"
- "assets/**"
- ".github/**/*.md"
push:
paths-ignore:
- "README*.md"
- "fastlane/**"
- "assets/**"
- ".github/**/*.md"
jobs:
debug-builds:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-python@v3
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Check for Execution Orders
run: |
cd .github
curl https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }} > commit.json
python checkrun.py
cd ..
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: "temurin"
cache: "gradle"
- name: Git Configuraion
run: |
git config --global user.name "alefvanoon"
git config --global user.email "53198048+alefvanoon@users.noreply.github.com"
git config --global credential.helper store
echo "https://alefvanoon:${{ secrets.GH_TOKEN }}@github.com" > ~/.git-credentials
- name: Patch and Compile
run: |
cd .github
python patch.py
cd ..
./gradlew assembleDebug
- name: Upload to Archive
continue-on-error: true
run: |
mv .github/uploader.py .
echo "GH_REPO = '${{ github.repository }}'" > tgconfig.py
git clone https://github.com/LibreTubeAlpha/Archive archive
rm -rf archive/*.apk
mv app/build/outputs/apk/debug/*.apk archive/
cd archive
python uploader.py
- name: Telegram Bot
continue-on-error: true
run: |
cd archive
curl https://libre-tube.github.io/images/Alpha.png --output alpha.png
chmod 755 ./exec
mv ../tgconfig.py .
echo "TG_TOKEN = '${{ secrets.TG_TOKEN }}'" >> tgconfig.py
echo "TG_API_ID = '${{ secrets.TG_API_ID }}'" >> tgconfig.py
echo "TG_POST_ID = '${{ secrets.TG_POST_ID }}'" >> tgconfig.py
echo "TG_API_HASH = '${{ secrets.TG_API_HASH }}'" >> tgconfig.py
python -m pip install --upgrade pip
pip install python-telegram-bot
mv ../.github/tg.py .
mv ../.github/commit.json .
python tg.py
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: app
path: archive/*.apk