Skip to content

Commit

Permalink
ci: Nightly Build
Browse files Browse the repository at this point in the history
  • Loading branch information
null2264 committed Jan 11, 2024
1 parent b519230 commit a790c29
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 11 deletions.
70 changes: 61 additions & 9 deletions .github/workflows/build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:
inputs:
version:
description: 'Version'
description: 'Version (without "v" prefix)'
required: true
type: string

Expand Down Expand Up @@ -41,17 +41,34 @@ jobs:
mkdir -p ~/.gradle
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
- name: Build app
# PROD
- name: Prepare release build
if: github.event.inputs.version != ''
run: |
set -x
echo "VERSION_TAG=v${{github.event.inputs.version}}" >> $GITHUB_ENV
# NIGHTLY
- name: Prepare nightly build
if: github.event.inputs.version == ''
run: |
set -x
echo "VERSION_TAG=r$(git rev-list --count HEAD)" >> $GITHUB_ENV
echo "PREV_TAG=$(git tag -l | grep 'r' | tail -1)" >> $GITHUB_ENV
# PROD
- name: Build release build
if: startsWith(env.VERSION_TAG, 'v')
uses: gradle/gradle-command-action@v2
with:
arguments: assembleStandardRelease

# Sign APK and create release for tags
- name: Get tag name
if: github.event.inputs.version != ''
run: |
set -x
echo "VERSION_TAG=${{github.event.inputs.version}}" >> $GITHUB_ENV
# NIGHTLY
- name: Build nightly build
if: startsWith(env.VERSION_TAG, 'r')
uses: gradle/gradle-command-action@v2
with:
arguments: assembleStandardNightly

- name: Sign APK
if: env.VERSION_TAG != ''
Expand Down Expand Up @@ -89,7 +106,7 @@ jobs:
echo "APK_X86_64_SHA=$sha" >> $GITHUB_ENV
- name: Create Release
if: env.VERSION_TAG != ''
if: startsWith(env.VERSION_TAG, 'v')
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION_TAG }}
Expand All @@ -116,3 +133,38 @@ jobs:
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Delete Old Nightly
if: startsWith(env.VERSION_TAG, 'r') && env.PREV_TAG != ''
run: gh release delete ${{ env.PREV_TAG }} --cleanup-tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Nightly
if: startsWith(env.VERSION_TAG, 'r')
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION_TAG }}
name: Yōkai ${{ env.VERSION_TAG }}
body: |
### Disclaimer:
***This alpha version is for testing only.***
It is not ready for daily use and we do not guarantee its usability.
Please backup your data before using it!
---
### 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 }} |
draft: false
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ android {
isMinifyEnabled = true
proguardFiles("proguard-android-optimize.txt", "proguard-rules.pro")
}
create("nightly") {
initWith(getByName("release"))
buildConfigField("boolean", "BETA", "true")

signingConfig = signingConfigs.getByName("debug")
matchingFallbacks.add("release")
versionNameSuffix = "-b${getCommitCount()}"
applicationIdSuffix = ".nightlyYokai"
}
}

buildFeatures {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class AboutController : SettingsController() {
preference {
key = "pref_version"
titleRes = R.string.version
summary = if (BuildConfig.DEBUG) {
summary = if (BuildConfig.DEBUG || BuildConfig.BETA) {
"r" + BuildConfig.COMMIT_COUNT
} else {
BuildConfig.VERSION_NAME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DebugController : SettingsController() {
preference {
key = "pref_version"
title = "Version"
summary = if (BuildConfig.DEBUG) {
summary = if (BuildConfig.DEBUG || BuildConfig.BETA) {
"r" + BuildConfig.COMMIT_COUNT
} else {
BuildConfig.VERSION_NAME
Expand Down
19 changes: 19 additions & 0 deletions app/src/standard/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,25 @@
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:636318130901:android:388d6d443528368657f85c",
"android_client_info": {
"package_name": "eu.kanade.tachiyomi.nightlyYokai"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyBORypbgpIKGb8s3Si6gaQlY5CLkR804OI"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:636318130901:android:0ae2cb126b21d3a357f85c",
Expand Down

0 comments on commit a790c29

Please sign in to comment.