feat: context-aware browse reselect search (R537) (#553) #266
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: CI | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| branches: | |
| - '*' | |
| tags: | |
| - v* | |
| workflow_dispatch: | |
| inputs: | |
| ref: | |
| description: 'Tag or branch to build (e.g. v0.18.1.79)' | |
| required: false | |
| default: '' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| # Temporary: remove this bootstrap and mavenLocal wiring once a released SqlDelight version includes AGP 9 compatibility. | |
| SQLDELIGHT_AGP9_FIX_SHA: c8f6011c014368544c71f5e490ef0409bb2f4705 | |
| jobs: | |
| build: | |
| name: Build app | |
| runs-on: ubuntu-latest | |
| # Always run for tag pushes (releases). For branch pushes, skip when the actor is the | |
| # auto-version-bump bot to avoid infinite CI loops without relying on [skip ci] in commit | |
| # messages (which also suppresses tag-triggered runs). | |
| if: startsWith(github.ref, 'refs/tags/') || github.actor != 'github-actions[bot]' | |
| steps: | |
| - name: Clone repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Restore SqlDelight local Maven cache | |
| id: sqldelight-cache | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.2.3 | |
| with: | |
| path: ~/.m2/repository/app/cash | |
| key: sqldelight-m2-${{ env.SQLDELIGHT_AGP9_FIX_SHA }} | |
| - name: Set up JDK | |
| uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 | |
| with: | |
| java-version: 17 | |
| distribution: temurin | |
| - name: Set up gradle | |
| uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0 | |
| - name: Build SqlDelight AGP 9 fix | |
| if: steps.sqldelight-cache.outputs.cache-hit != 'true' | |
| run: | | |
| set -euxo pipefail | |
| git clone --filter=blob:none https://github.com/cashapp/sqldelight.git /tmp/sqldelight | |
| cd /tmp/sqldelight | |
| git checkout --detach "$SQLDELIGHT_AGP9_FIX_SHA" | |
| ./gradlew publishToMavenLocal -x test --no-daemon | |
| - name: Check format and run unit tests | |
| run: ./gradlew spotlessCheck :app:testDebugUnitTest | |
| - name: Build app | |
| run: ./gradlew assembleRelease -Penable-updater | |
| - name: Upload APK | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: arm64-v8a-${{ github.sha }} | |
| path: app/build/outputs/apk/release/app-arm64-v8a-release-unsigned.apk | |
| - name: Upload mapping | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: mapping-${{ github.sha }} | |
| path: app/build/outputs/mapping/release | |
| # Sign APK and create release for tags | |
| - name: Get tag name | |
| if: startsWith(github.ref, 'refs/tags/') && github.repository == 'ryacub/rayniyomi' | |
| run: | | |
| set -ex | |
| echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | |
| - name: Sign APK | |
| if: startsWith(github.ref, 'refs/tags/') && github.repository == 'ryacub/rayniyomi' | |
| uses: r0adkll/sign-android-release@f30bdd30588842ac76044ecdbd4b6d0e3e813478 | |
| with: | |
| releaseDirectory: app/build/outputs/apk/release | |
| signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
| alias: ${{ secrets.ALIAS }} | |
| keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
| keyPassword: ${{ secrets.KEY_PASSWORD }} | |
| env: | |
| BUILD_TOOLS_VERSION: '35.0.1' | |
| - name: Clean up build artifacts | |
| if: startsWith(github.ref, 'refs/tags/') && github.repository == 'ryacub/rayniyomi' | |
| run: | | |
| set -ex | |
| mv app/build/outputs/apk/release/app-universal-release-unsigned-signed.apk rayniyomi-${{ env.VERSION_TAG }}.apk | |
| sha=`sha256sum rayniyomi-${{ env.VERSION_TAG }}.apk | awk '{ print $1 }'` | |
| echo "APK_UNIVERSAL_SHA=$sha" >> $GITHUB_ENV | |
| mv app/build/outputs/apk/release/app-arm64-v8a-release-unsigned-signed.apk rayniyomi-arm64-v8a-${{ env.VERSION_TAG }}.apk | |
| sha=`sha256sum rayniyomi-arm64-v8a-${{ env.VERSION_TAG }}.apk | awk '{ print $1 }'` | |
| echo "APK_ARM64_V8A_SHA=$sha" >> $GITHUB_ENV | |
| mv app/build/outputs/apk/release/app-armeabi-v7a-release-unsigned-signed.apk rayniyomi-armeabi-v7a-${{ env.VERSION_TAG }}.apk | |
| sha=`sha256sum rayniyomi-armeabi-v7a-${{ env.VERSION_TAG }}.apk | awk '{ print $1 }'` | |
| echo "APK_ARMEABI_V7A_SHA=$sha" >> $GITHUB_ENV | |
| mv app/build/outputs/apk/release/app-x86-release-unsigned-signed.apk rayniyomi-x86-${{ env.VERSION_TAG }}.apk | |
| sha=`sha256sum rayniyomi-x86-${{ env.VERSION_TAG }}.apk | awk '{ print $1 }'` | |
| echo "APK_X86_SHA=$sha" >> $GITHUB_ENV | |
| mv app/build/outputs/apk/release/app-x86_64-release-unsigned-signed.apk rayniyomi-x86_64-${{ env.VERSION_TAG }}.apk | |
| sha=`sha256sum rayniyomi-x86_64-${{ env.VERSION_TAG }}.apk | awk '{ print $1 }'` | |
| echo "APK_X86_64_SHA=$sha" >> $GITHUB_ENV | |
| - name: Extract changelog for release | |
| if: startsWith(github.ref, 'refs/tags/') && github.repository == 'ryacub/rayniyomi' | |
| run: | | |
| set -ex | |
| version="${VERSION_TAG#v}" | |
| # Extract the section for this version from CHANGELOG.md | |
| awk "/^## \[${version}\]/{found=1; next} found && /^## /{exit} found{print}" CHANGELOG.md > /tmp/changelog_section.md | |
| # Append checksums table | |
| cat >> /tmp/changelog_section.md << EOF | |
| --- | |
| ### Checksums | |
| | Variant | SHA-256 | | |
| | ------- | ------- | | |
| | Universal | ${APK_UNIVERSAL_SHA} | |
| | arm64-v8a | ${APK_ARM64_V8A_SHA} | |
| | armeabi-v7a | ${APK_ARMEABI_V7A_SHA} | |
| | x86 | ${APK_X86_SHA} | |
| | x86_64 | ${APK_X86_64_SHA} | | |
| EOF | |
| - name: Create Release | |
| if: startsWith(github.ref, 'refs/tags/') && github.repository == 'ryacub/rayniyomi' | |
| uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1 | |
| with: | |
| tag_name: ${{ env.VERSION_TAG }} | |
| name: Rayniyomi ${{ env.VERSION_TAG }} | |
| body_path: /tmp/changelog_section.md | |
| files: | | |
| rayniyomi-${{ env.VERSION_TAG }}.apk | |
| rayniyomi-arm64-v8a-${{ env.VERSION_TAG }}.apk | |
| rayniyomi-armeabi-v7a-${{ env.VERSION_TAG }}.apk | |
| rayniyomi-x86-${{ env.VERSION_TAG }}.apk | |
| rayniyomi-x86_64-${{ env.VERSION_TAG }}.apk | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |