Merge pull request #386 from KazumaProject/fix/symbol-keymap-qwerty #328
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: Android Release CI | |
| # Run this workflow when a new tag like 'v1.0.0' is pushed | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| # Although we only have one configuration, the matrix is kept for future flexibility | |
| api-level: [ 35 ] | |
| build-tools: [ '35.0.0' ] | |
| target: [ 'android-35' ] | |
| steps: | |
| # 1. Checkout code with full history | |
| # fetch-depth: 0 is required to get all tags and commit history | |
| # for the automatic release note generation. | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| # 2. Set up JDK 17 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| # 3. Set up Android SDK | |
| - name: Set up Android SDK | |
| uses: android-actions/setup-android@v2 | |
| with: | |
| api-level: ${{ matrix.api-level }} | |
| build-tools: ${{ matrix.build-tools }} | |
| target: ${{ matrix.target }} | |
| # 4. Cache Gradle dependencies | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| # 5. Decode JKS keystore from GitHub Secrets | |
| - name: Decode JKS from Base64 | |
| run: | | |
| echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > my-release-key.jks | |
| # 6. Create local.properties with signing information | |
| - name: Add signing info to local.properties | |
| run: | | |
| # Create the file if it doesn't exist | |
| if [ ! -f local.properties ]; then | |
| touch local.properties | |
| fi | |
| echo "# --- SigningConfig for CI ---" >> local.properties | |
| echo "KEYSTORE_FILE=../my-release-key.jks" >> local.properties | |
| echo "KEYSTORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }}" >> local.properties | |
| echo "KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> local.properties | |
| echo "KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}" >> local.properties | |
| # 7. Build the signed release APK | |
| - name: Build Signed Release APK | |
| run: ./gradlew clean assembleRelease | |
| # 8. Create GitHub Release and upload APK | |
| # This single step replaces the previous 'Create Release' and 'Upload Asset' steps. | |
| # It automatically generates release notes from merged Pull Requests. | |
| - name: Create Release and Upload APK | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| # This option tells the action to automatically create release notes | |
| # based on the Pull Requests merged since the last tag. | |
| generate_release_notes: true | |
| # Specifies the file(s) to upload as release assets. | |
| files: app/build/outputs/apk/release/app-release.apk | |
| env: | |
| # The GITHUB_TOKEN is required to authorize the action to create a release. | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |