LibreTube/.github/workflows/ci.yml
2022-09-18 10:47:24 +05:30

72 lines
1.8 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
- name: Check for Execution Orders
run: |
cd .github
touch sign.txt
curl https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }} > commit.json
python checkrun.py
python sign.py
cd ..
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: "temurin"
cache: "gradle"
- name: Prepare for Compilation
run: |
git config --global user.name "XelXen"
git config --global user.email "78258352+XelXen@users.noreply.github.com"
git config --global credential.helper store
echo "https://XelXen:${{ secrets.GH_TOKEN }}@github.com" > ~/.git-credentials
- name: Patch and Compile
run: |
cd .github
python patch.py
cd ..
./gradlew assembleDebug
- name: Upload to Archive
run: |
git clone https://github.com/LibreTubeAlpha/Archive archive
rm -rf archive/*.apk archive/sign.txt
mv app/build/outputs/apk/debug/*.apk archive/
mv .github/sign.txt archive/
cd archive
git add -f *
git commit -m "WORKFLOW: ALPHA BUILDS"
git push -u
cd ..
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: app
path: archive/*.apk