forked from osfans/trime
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: split out nightly build ci configuration
- Loading branch information
1 parent
154b053
commit 42efd91
Showing
2 changed files
with
67 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Nightly | ||
on: | ||
schedule: | ||
- cron: '35 9 * * *' # UTC 3:00 daily | ||
|
||
env: | ||
CI_NAME: Nightly CI | ||
jobs: | ||
build: | ||
if: ${{ github.repository == 'WhiredPlanck/trime-new' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "temurin" | ||
java-version: 21 | ||
# will restore cache of dependencies and wrappers | ||
cache: 'gradle' | ||
|
||
- name: Calculate JNI cache hash | ||
id: cache-hash | ||
run: | | ||
./gradlew :app:calculateNativeCacheHash | ||
- name: Fetch JNI cache | ||
uses: actions/cache@v3 | ||
id: jni-cache | ||
with: | ||
path: "app/prebuilt" | ||
key: ${{ runner.os }}-trime-jni-release-${{ steps.cache-hash.outputs.native-cache-hash }} | ||
|
||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v3 | ||
|
||
- name: Setup keystore | ||
run: | | ||
echo ${{ secrets.SIGNING_KEY }} | base64 --decode | cat >> $(pwd)/signingkey.jks | ||
cat << EOF > keystore.properties | ||
storeFile=$(pwd)/signingkey.jks | ||
storePassword=${{ secrets.KEY_STORE_PASSWORD }} | ||
keyAlias=${{ secrets.ALIAS }} | ||
keyPassword=${{ secrets.KEY_PASSWORD }} | ||
EOF | ||
- name: Build Trime | ||
run: make release | ||
|
||
- name: Add JNI cache | ||
if: ${{ !steps.jni-cache.outputs.cache-hit }} | ||
run: cp -R app/build/intermediates/stripped_native_libs/release/out/lib app/prebuilt | ||
|
||
- name: Create Nightly release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
prerelease: true | ||
artifacts: "app/build/outputs/apk/release/*.apk" | ||
removeArtifacts: true | ||
name: "Nightly Build" | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains 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