fix: reduce titlebar status bar padding on Android (#1) #7
Workflow file for this run
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 & Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| workflow_dispatch: | |
| inputs: | |
| version_tag: | |
| description: 'Version tag (e.g. v1.0.1). Used as release tag and for changelog extraction.' | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| actions: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-android: | |
| name: 🤖 Build Android APK | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📂 Checkout code | |
| uses: actions/checkout@v4 | |
| - name: 🥟 Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: ☕️ Setup Java (Temurin 17) | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| cache: gradle | |
| - name: 📥 Install dependencies | |
| run: bun install | |
| - name: 🏗️ Build web app | |
| run: VITE_PLATFORM=android bun run --cwd app build | |
| - name: 🔄 Capacitor sync | |
| working-directory: android | |
| run: bunx --bun cap sync android | |
| - name: 🔐 Generate Android signing files | |
| working-directory: android/android | |
| env: | |
| ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} | |
| ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | |
| ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} | |
| ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }} | |
| run: | | |
| test -n "$ANDROID_KEYSTORE_BASE64" | |
| test -n "$ANDROID_KEY_ALIAS" | |
| test -n "$ANDROID_KEY_PASSWORD" | |
| test -n "$ANDROID_STORE_PASSWORD" | |
| echo "$ANDROID_KEYSTORE_BASE64" | base64 --decode > app/upload-keystore.jks | |
| cat > key.properties <<EOF | |
| storePassword=$ANDROID_STORE_PASSWORD | |
| keyPassword=$ANDROID_KEY_PASSWORD | |
| keyAlias=$ANDROID_KEY_ALIAS | |
| storeFile=upload-keystore.jks | |
| EOF | |
| - name: 🏗️ Build release APK | |
| working-directory: android/android | |
| run: ./gradlew assembleRelease | |
| - name: 📦 Prepare artifacts | |
| run: | | |
| mkdir -p artifacts | |
| cp android/android/app/build/outputs/apk/release/*.apk artifacts/ | |
| - name: 📤 Upload Android artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-apk | |
| path: artifacts/ | |
| retention-days: 1 | |
| release: | |
| name: 🏷️ Create GitHub Release | |
| runs-on: ubuntu-latest | |
| needs: [build-android] | |
| steps: | |
| - name: 📂 Checkout code | |
| uses: actions/checkout@v4 | |
| - name: 🔖 Determine release tag | |
| id: tag | |
| run: | | |
| if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
| echo "value=${{ inputs.version_tag }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "value=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: 📥 Download Android artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: android-apk | |
| path: release-artifacts/ | |
| - name: 📋 List release artifacts | |
| run: ls -lh release-artifacts/ | |
| - name: 📝 Extract release notes from CHANGELOG | |
| env: | |
| TAG: ${{ steps.tag.outputs.value }} | |
| run: | | |
| awk -v tag="$TAG" ' | |
| $0 ~ "^## " tag "([[:space:]]-|$)" { found = 1 } | |
| found && $0 ~ "^## v[0-9]" && $0 !~ "^## " tag "([[:space:]]-|$)" { exit } | |
| found { print } | |
| ' CHANGELOG.md > release_notes.md | |
| if [ ! -s release_notes.md ]; then | |
| echo "::warning::No changelog entry found for ${TAG} in CHANGELOG.md, using default release notes" | |
| echo "Release ${TAG}" > release_notes.md | |
| fi | |
| - name: 🏷️ Create or update Release | |
| uses: ncipollo/release-action@v1.16.0 | |
| with: | |
| tag: ${{ steps.tag.outputs.value }} | |
| name: ${{ steps.tag.outputs.value }} | |
| artifacts: release-artifacts/* | |
| bodyFile: release_notes.md | |
| token: ${{ secrets.GITHUB_TOKEN }} |