Update v0.0.6 #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android CI | |
on: | |
push: | |
branches: [ "master" ] | |
paths: | |
- '**' | |
- '!update.json' | |
- '!.github/workflows/*.yml' | |
- '!*.md' | |
jobs: | |
build: | |
permissions: write-all | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Write key to gradle.properties | |
run: | | |
echo ${{ secrets.KEY_STORE }} | base64 --decode > app/key.jks | |
printf "\nRELEASE_FILE=key.jks" >> gradle.properties | |
printf "\nRELEASE_PASSWORD=${{ secrets.PASSWORD }}" >> gradle.properties | |
printf "\nRELEASE_ALIAS=${{ secrets.ALIAS }}" >> gradle.properties | |
- name: Build and test app | |
run: | | |
./gradlew assembleRelease | |
- name: Setup NodeJs | |
uses: actions/[email protected] | |
with: | |
node-version: 22 | |
- name: Write Bot Files and Configure environment variables | |
run: | | |
APKVERSION=$(grep -Po 'versionName\s*=\s*"\K[^"]+' app/build.gradle.kts) | |
APKNEWPATH="app/build/outputs/apk/release/WaRevamp_$APKVERSION.apk" | |
cp app/build/outputs/apk/release/app-release.apk $APKNEWPATH | |
echo ${{ secrets.BOT_INDEX }} | base64 --decode > index.js | |
echo ${{ secrets.BOT_PACKAGE }} | base64 --decode > package.json | |
echo "CHANGE_LOG_PATH=change_log.txt" >> $GITHUB_ENV | |
echo "CHAT_ID=${{ secrets.CHAT_ID }}" >> $GITHUB_ENV | |
echo "FILE_PATH=$APKNEWPATH" >> $GITHUB_ENV | |
echo "BOT_TOKEN=${{ secrets.BOT_TOKEN }}" >> $GITHUB_ENV | |
- name: Install Dependencies | |
run: npm install | |
- name: Run Node.js script | |
run: node index.js | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
id: upload | |
with: | |
name: app-release | |
path: app/build/outputs/apk/release/app-release.apk |