+1 link #7865
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: Build debug APK | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - develop | |
| pull_request: | |
| jobs: | |
| check-paths: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| skip_steps: ${{ steps.filter.outputs.workflows && !steps.nofilter.outputs.workflows }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: true | |
| - name: Check for ignored paths | |
| uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| workflows: | |
| - '**.md' | |
| - 'LICENSE' | |
| - '.idea/**' | |
| - 'docs/**' | |
| - '.github/ISSUE_TEMPLATE/**' | |
| - '.gitignore' | |
| - '.gitattributes' | |
| - '.github/labeler.yml' | |
| - '.github/release.yml' | |
| - name: Check for non ignored paths | |
| uses: dorny/paths-filter@v3 | |
| id: nofilter | |
| with: | |
| filters: | | |
| workflows: | |
| - '!**.md' | |
| - '!LICENSE' | |
| - '!.idea/**' | |
| - '!docs/**' | |
| - '!.github/ISSUE_TEMPLATE/**' | |
| - '!.gitignore' | |
| - '!.gitattributes' | |
| - '!.github/labeler.yml' | |
| - '!.github/release.yml' | |
| build-debug-apk: | |
| runs-on: ubuntu-latest | |
| needs: check-paths | |
| if: needs.check-paths.outputs.skip_steps != 'true' | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: true | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version: 21 | |
| - uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| cache-encryption-key: Da25KUVSE5jbGds2zXmfXw== | |
| - name: Write sign info | |
| if: github.event.repository.fork == false | |
| run: | | |
| if [ ! -z "${{ secrets.KEYSTORE }}" ]; then | |
| echo storePassword='${{ secrets.KEYSTORE_PASSWORD }}' >> keystore.properties | |
| echo keyAlias='${{ secrets.KEY_ALIAS }}' >> keystore.properties | |
| echo keyPassword='${{ secrets.KEY_PASSWORD }}' >> keystore.properties | |
| echo storeFile='${{ github.workspace }}/key.jks' >> keystore.properties | |
| echo ${{ secrets.KEYSTORE }} | base64 --decode > ${{ github.workspace }}/key.jks | |
| fi | |
| - name: Build debug APK | |
| run: ./gradlew app:assembleDebug | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: Debug APK | |
| path: app/build/outputs/apk/app/debug/*.apk | |
| check-style: | |
| runs-on: ubuntu-latest | |
| needs: check-paths | |
| if: needs.check-paths.outputs.skip_steps != 'true' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: true | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version: 21 | |
| - uses: gradle/actions/setup-gradle@v5 | |
| - run: ./gradlew spotlessCheck | |
| send-notifications: | |
| runs-on: ubuntu-latest | |
| needs: [ build-debug-apk, check-style, check-paths ] | |
| if: needs.check-paths.outputs.skip_steps != 'true' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| submodules: true | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.x' | |
| - name: Install Python packages | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install gitpython requests | |
| - name: Download artifact | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: Debug APK | |
| path: artifacts/debug-apk | |
| - name: Send notifications | |
| run: python send_notifications.py | |
| env: | |
| GITHUB_EVENT_BEFORE: ${{ github.event.before }} | |
| TELEGRAM_CI_BOT_TOKEN: ${{ secrets.TELEGRAM_CI_BOT_TOKEN }} | |
| TELEGRAM_CI_CHANNEL_ID: ${{ secrets.TELEGRAM_CI_CHANNEL_ID }} | |
| ARTIFACT_DIRECTORY: artifacts/debug-apk | |
| GITHUB_REF: ${{ github.ref }} | |
| DISCORD_CI_BOT_TOKEN: ${{ secrets.DISCORD_CI_BOT_TOKEN }} | |
| nightly-release: | |
| runs-on: ubuntu-latest | |
| if: github.event.repository.fork == false && github.event_name == 'push' && needs.check-paths.outputs.skip_steps != 'true' | |
| needs: build-debug-apk | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/download-artifact@v6 | |
| with: | |
| name: Debug APK | |
| path: artifacts/debug-apk | |
| - name: Export APK_NAME for later use | |
| run: echo "APK_NAME=Lawnicons.Nightly.$(echo ${{ github.sha }} | cut -c1-7).apk" >> $GITHUB_ENV | |
| - name: Rename .apk file | |
| run: | | |
| mv artifacts/debug-apk/*.apk $APK_NAME | |
| - name: Delete release if exist then create release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release view "nightly" && gh release delete "nightly" -y --cleanup-tag | |
| gh release create "nightly" "$APK_NAME" -p -t "Lawnicons Nightly" --generate-notes |