Skip to content

R812: migrate Settings layouts to window width classes (#918) #616

R812: migrate Settings layouts to window width classes (#918)

R812: migrate Settings layouts to window width classes (#918) #616

Workflow file for this run

name: CI
permissions:
contents: write
on:
push:
branches:
- main
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
jobs:
build:
name: Build app
runs-on: ubuntu-latest
# Always run for tag pushes (releases). For main 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: 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: Verify generateBaselineProfile task is wired
run: ./gradlew :app:generateBaselineProfile --dry-run
- name: Verify baseline-prof.txt artifact is committed and non-empty
run: |
ARTIFACT="app/src/main/baseline-prof.txt"
if [ ! -f "$ARTIFACT" ]; then
echo "ERROR: $ARTIFACT not found — run :app:generateBaselineProfile and commit the result"
exit 1
fi
if [ ! -s "$ARTIFACT" ]; then
echo "ERROR: $ARTIFACT is empty — regenerate with :app:generateBaselineProfile"
exit 1
fi
echo "baseline-prof.txt present ($(wc -l < "$ARTIFACT") lines)"
- name: Check format and run unit tests
run: ./gradlew spotlessCheck :app:testDebugUnitTest :data:testDebugUnitTest
- name: Check extension source gateway
run: |
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest scripts.tests.test_source_gateway
PYTHONDONTWRITEBYTECODE=1 python3 scripts/check_source_gateway.py
- name: Build app
run: ./gradlew assembleStableRelease -Penable-updater
- name: Verify 16 KB native alignment
run: ./scripts/verify_16kb_apk.sh app/build/outputs/apk/stable/release/app-stable-arm64-v8a-release-unsigned.apk
- name: Verify extension source ABI
run: |
./scripts/check_release_extension_abi.py \
app/build/outputs/apk/stable/release/app-stable-arm64-v8a-release-unsigned.apk \
--baseline app/extension-abi-baseline.txt
- name: Upload APK
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: arm64-v8a-${{ github.sha }}
path: app/build/outputs/apk/stable/release/app-stable-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/stableRelease
# 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
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
echo "RELEASE_DATE=$(date -u +%F)" >> $GITHUB_ENV
- name: Finalize changelog for release notes
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'ryacub/rayniyomi'
run: |
set -euxo pipefail
python3 scripts/finalize_changelog_release.py "$RELEASE_VERSION" --date "$RELEASE_DATE"
- 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/stable/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/stable/release/app-stable-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/stable/release/app-stable-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/stable/release/app-stable-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/stable/release/app-stable-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/stable/release/app-stable-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 }}
- name: Checkout main for changelog sync
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'ryacub/rayniyomi'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: main
token: ${{ secrets.VERSION_BUMP_TOKEN }}
path: changelog-sync
- name: Persist changelog rollover to main
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'ryacub/rayniyomi'
run: |
set -euxo pipefail
cd changelog-sync
python3 scripts/finalize_changelog_release.py "$RELEASE_VERSION" --date "$RELEASE_DATE"
if git diff --quiet -- CHANGELOG.md; then
echo "No changelog update needed."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add CHANGELOG.md
git commit -m "chore: finalize changelog for v${RELEASE_VERSION}"
git push origin main