Nightly Obfuscation #282
This file contains hidden or 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: 'Nightly Obfuscation' | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
build: | |
name: Build obfuscated application | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get latest release tag | |
id: get_latest_release | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const latestRelease = await github.rest.repos.getLatestRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
}); | |
core.setOutput('tag_name', latestRelease.data.tag_name); | |
- name: Checkout latest release | |
uses: actions/checkout@v4 | |
with: | |
ref: "${{ steps.get_latest_release.outputs.tag_name }}" | |
- name: Setup JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '21' | |
- name: set NDK | |
shell: bash | |
run: | | |
set -x | |
echo "ANDROID_NDK=$ANDROID_NDK_LATEST_HOME" >> $GITHUB_ENV | |
echo "ANDROID_NDK_HOME=$ANDROID_NDK_LATEST_HOME" >> $GITHUB_ENV | |
echo "ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME" >> $GITHUB_ENV | |
- name: Restore keystore | |
run: | | |
echo "${{ secrets.RELEASE_KEYSTORE }}" > smartautoclicker.jks.asc | |
gpg -d --passphrase "${{ secrets.RELEASE_KEYSTORE_PASSPHRASE }}" --batch smartautoclicker.jks.asc > smartautoclicker/smartautoclicker.jks | |
- name: Build with Gradle | |
run: | | |
./gradlew \ | |
-PrandomizeAppId="true" \ | |
-PsigningStorePassword="${{ secrets.SIGNING_STORE_PASSWORD }}" \ | |
-PsigningKeyAlias="${{ secrets.SIGNING_KEY_ALIAS }}" \ | |
-PsigningKeyPassword="${{ secrets.SIGNING_KEY_PASSWORD }}" \ | |
assembleFDroidRelease | |
# Upload the file as a release asset to the specified release | |
- name: Upload release asset | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: smartautoclicker/build/outputs/apk/fDroid/release/smartautoclicker-fDroid-release.apk | |
tag_name: 'obfuscation-start' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |