Update dependency ws to v8.19.0 (#762) #89
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 Android APK | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| cache: "npm" | |
| - name: Setup Java JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: "temurin" | |
| java-version: "21" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build web app | |
| run: npm run build | |
| - name: Sync Capacitor | |
| run: npx cap sync android | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Make gradlew executable | |
| run: chmod +x android/gradlew | |
| # ---- DEBUG BUILD (always runs) ---- | |
| - name: Build Android Debug APK | |
| run: | | |
| cd android | |
| ./gradlew assembleDebug --no-daemon | |
| - name: Upload Debug APK artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-debug | |
| path: android/app/build/outputs/apk/debug/app-debug.apk | |
| retention-days: 30 | |
| # ==== Release-only steps (main branch) ==== | |
| - name: Decode Keystore | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| echo "${{ secrets.ANDROID_KEYSTORE_FILE }}" | tr -d '\n\r\t ' | base64 -d > android/app/release.keystore | |
| ls -lh android/app/release.keystore | |
| - name: Verify Keystore | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| keytool -list -keystore android/app/release.keystore -storepass "${{ secrets.ANDROID_KEYSTORE_PASSWORD }}" | head -5 | |
| - name: Build Android Release APK | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| cd android | |
| ./gradlew assembleRelease --no-daemon --stacktrace | |
| env: | |
| RELEASE_STORE_FILE: ${{ github.workspace }}/android/app/release.keystore | |
| RELEASE_STORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
| RELEASE_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | |
| RELEASE_KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
| - name: Upload Release APK artifact | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-release | |
| path: android/app/build/outputs/apk/release/app-release.apk | |
| retention-days: 90 | |
| - name: Get version from package.json | |
| if: github.ref == 'refs/heads/main' | |
| id: package-version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "Detected version: $VERSION" | |
| - name: Create GitHub Release | |
| if: github.ref == 'refs/heads/main' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: v${{ steps.package-version.outputs.VERSION }} | |
| name: Release v${{ steps.package-version.outputs.VERSION }} | |
| draft: false | |
| prerelease: false | |
| fail_on_unmatched_files: false | |
| files: | | |
| android/app/build/outputs/apk/debug/app-debug.apk | |
| android/app/build/outputs/apk/release/app-release.apk | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |