Skip to content

Implement Search box for SourcesScreen #4

Implement Search box for SourcesScreen

Implement Search box for SourcesScreen #4

Workflow file for this run

name: Preview Builder
on:
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build preview app
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Prepare build
run: |
set -e
git fetch --tags
prev_release_sha=$(git log --oneline --decorate --tags --no-walk --pretty='%C(auto)%h' | head -n 1)
echo "PREV_RELEASE_SHA=$prev_release_sha" >> $GITHUB_ENV
current_sha=$(git log -1 --pretty='%C(auto)%h' | head -n 1)
echo "CURRENT_SHA=$current_sha" >> $GITHUB_ENV
echo "COMMIT_LOGS<<{delimiter}
$(curl -H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/cuong-tran/komikku/compare/$prev_release_sha...$current_sha" \
| jq '[.commits[]|{message:(.commit.message | split("\n")), username:.author.login}]' \
| jq -r '.[]|"- \(.message | first) (@\(.username))"')
{delimiter}" >> $GITHUB_ENV
- name: Set CHANGELOG
run: |
changelog="$(git log ${{ env.PREV_RELEASE_SHA }}..${{ env.CURRENT_SHA }} --pretty=format:'{{changelogtext}}%s (@%an){{!changelogtext}}')"
changelog="${changelog//$'%'/%25}"
changelog="${changelog//$'\n'/}"
changelog="${changelog//$'\r'/}"
changelog="${changelog//$'<'/}"
changelog="${changelog//$'>'/}"
changelog="${changelog//$'&'/}"
changelog="$(echo $changelog | sed -e 's/{{changelogtext}}/<changelogtext>/g')"
changelog="$(echo $changelog | sed -e 's/{{!changelogtext}}/<\/changelogtext>/g')"
changelog="<?xml version=\"1.0\" encoding=\"utf-8\"?><changelog bulletedList=\"true\"><changelogversion versionName=\"${{ github.run_number }}\" changeDate=\"\">$changelog</changelogversion></changelog>"
echo "CHANGELOG=$changelog" >> $GITHUB_ENV
- name: Setup Android SDK
run: |
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "build-tools;29.0.3"
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: adopt
- name: Write Version.kt
uses: DamianReeves/[email protected]
with:
path: app/src/main/java/exh/Version.kt
contents: 'package exh const val syDebugVersion: String = "${{ github.run_number }}"'
write-mode: overwrite
- name: Write changelog_debug.xml
uses: DamianReeves/[email protected]
with:
path: app/src/main/res/raw/changelog_debug.xml
contents: "${{ env.CHANGELOG }}"
write-mode: overwrite
- name: Write google-services.json
uses: DamianReeves/[email protected]
with:
path: app/google-services.json
contents: ${{ secrets.GOOGLE_SERVICES_TEXT }}
write-mode: overwrite
- name: Build app
if: ${{ ! startsWith(github.ref, 'refs/tags/') && github.repository == 'cuong-tran/komikku' }}
uses: gradle/gradle-command-action@v2
with:
arguments: assembleStandardRelease -x ktlintFormat --stacktrace
- name: Sign Android Release
if: ${{ ! startsWith(github.ref, 'refs/tags/') && github.repository == 'cuong-tran/komikku' }}
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/standard/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Clean up build artifacts
if: ${{ ! startsWith(github.ref, 'refs/tags/') && github.repository == 'cuong-tran/komikku' }}
run: |
set -e
mv app/build/outputs/apk/standard/release/app-standard-universal-release-unsigned-signed.apk Komikku-pre-${{ github.run_number }}.apk
sha=`sha256sum Komikku-pre-${{ github.run_number }}.apk | awk '{ print $1 }'`
echo "APK_UNIVERSAL_SHA=$sha" >> $GITHUB_ENV
cp app/build/outputs/apk/standard/release/app-standard-arm64-v8a-release-unsigned-signed.apk Komikku-arm64-v8a-pre-${{ github.run_number }}.apk
sha=`sha256sum Komikku-arm64-v8a-pre-${{ github.run_number }}.apk | awk '{ print $1 }'`
echo "APK_ARM64_V8A_SHA=$sha" >> $GITHUB_ENV
cp app/build/outputs/apk/standard/release/app-standard-armeabi-v7a-release-unsigned-signed.apk Komikku-armeabi-v7a-pre-${{ github.run_number }}.apk
sha=`sha256sum Komikku-armeabi-v7a-pre-${{ github.run_number }}.apk | awk '{ print $1 }'`
echo "APK_ARMEABI_V7A_SHA=$sha" >> $GITHUB_ENV
cp app/build/outputs/apk/standard/release/app-standard-x86-release-unsigned-signed.apk Komikku-x86-pre-${{ github.run_number }}.apk
sha=`sha256sum Komikku-x86-pre-${{ github.run_number }}.apk | awk '{ print $1 }'`
echo "APK_X86_SHA=$sha" >> $GITHUB_ENV
cp app/build/outputs/apk/standard/release/app-standard-x86_64-release-unsigned-signed.apk Komikku-x86_64-pre-${{ github.run_number }}.apk
sha=`sha256sum Komikku-x86_64-pre-${{ github.run_number }}.apk | awk '{ print $1 }'`
echo "APK_X86_64_SHA=$sha" >> $GITHUB_ENV
- name: Create release
if: ${{ ! startsWith(github.ref, 'refs/tags/') && github.repository == 'cuong-tran/komikku' }}
uses: softprops/action-gh-release@v1
with:
tag_name: pre-release
name: Komikku Preview Build ${{ github.run_number }}
body: |
### Commits
https://github.com/cuongtran/komikku/compare/${{ env.PREV_RELEASE_SHA }}...${{ env.CURRENT_SHA }}
${{ env.COMMIT_LOGS }}
---
### Checksums
| Variant | SHA-256 |
| ------- | ------- |
| Universal | ${{ env.APK_UNIVERSAL_SHA }} |
| arm64-v8a | ${{ env.APK_ARM64_V8A_SHA }} |
| armeabi-v7a | ${{ env.APK_ARMEABI_V7A_SHA }} |
| x86 | ${{ env.APK_X86_SHA }} |
| x86_64 | ${{ env.APK_X86_64_SHA }} |
files: |
Komikku-pre-${{ github.run_number }}.apk
Komikku-arm64-v8a-pre-${{ github.run_number }}.apk
Komikku-armeabi-v7a-pre-${{ github.run_number }}.apk
Komikku-x86-pre-${{ github.run_number }}.apk
Komikku-x86_64-pre-${{ github.run_number }}.apk
draft: false
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}