Make release signing conditional on keystore existence #7
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 APK on Push | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| - master | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| - master | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| 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: Build Debug APK | |
| run: ./gradlew assembleDebug --stacktrace --no-daemon | |
| - name: Upload Debug APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: patchwork-debug-${{ github.sha }} | |
| path: app/build/outputs/apk/debug/app-debug.apk | |
| retention-days: 30 | |
| - name: Comment on PR with APK | |
| if: github.event_name == 'pull_request' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: '✅ APK built successfully! Download it from the artifacts section above.' | |
| }) |