Update build.yml
This commit is contained in:
+36
-19
@@ -1,4 +1,4 @@
|
||||
name: Build
|
||||
name: Build preview APK
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -13,25 +13,30 @@ concurrency:
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
CI: 'true'
|
||||
EXPO_NO_TELEMETRY: '1'
|
||||
|
||||
jobs:
|
||||
build-android:
|
||||
name: Build Android pre-release APK
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 60
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
uses: pnpm/action-setup@v6
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v6
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: "24"
|
||||
node-version: '22'
|
||||
cache: pnpm
|
||||
cache-dependency-path: pnpm-lock.yaml
|
||||
|
||||
@@ -39,40 +44,52 @@ jobs:
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "17"
|
||||
|
||||
- name: Set up Gradle cache
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
cache-read-only: ${{ github.ref != 'refs/heads/master' }}
|
||||
gradle-home-cache-cleanup: true
|
||||
java-version: '17'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: pnpm install --frozen-lockfile --prefer-offline
|
||||
|
||||
- name: Generate release environment
|
||||
env:
|
||||
MYANIMELIST_CLIENT_ID: ${{ vars.MYANIMELIST_CLIENT_ID }}
|
||||
ANILIST_CLIENT_ID: ${{ vars.ANILIST_CLIENT_ID }}
|
||||
run: |
|
||||
pnpm generate:env:release \
|
||||
--build-type "GitHub Action" \
|
||||
--node-env "production" \
|
||||
--myanimelist-client-id "${{ vars.MYANIMELIST_CLIENT_ID }}" \
|
||||
--anilist-client-id "${{ vars.ANILIST_CLIENT_ID }}"
|
||||
--myanimelist-client-id "$MYANIMELIST_CLIENT_ID" \
|
||||
--anilist-client-id "$ANILIST_CLIENT_ID"
|
||||
|
||||
- name: Generate Android project
|
||||
run: |
|
||||
pnpm expo prebuild \
|
||||
pnpm exec expo prebuild \
|
||||
--platform android \
|
||||
--clean \
|
||||
--no-install \
|
||||
--non-interactive
|
||||
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@v6
|
||||
with:
|
||||
cache-provider: enhanced
|
||||
cache-read-only: >-
|
||||
${{ github.ref_name != github.event.repository.default_branch }}
|
||||
cache-cleanup: on-success
|
||||
add-job-summary: always
|
||||
|
||||
- name: Build pre-release APK
|
||||
working-directory: android
|
||||
run: ./gradlew :app:assemblePreRelease --build-cache
|
||||
run: |
|
||||
./gradlew :app:assemblePreRelease \
|
||||
--build-cache \
|
||||
--parallel \
|
||||
--stacktrace
|
||||
|
||||
- name: Upload APK artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: LNReader-preRelease-${{ github.sha }}
|
||||
path: android/app/build/outputs/apk/preRelease/app-preRelease.apk
|
||||
path: android/app/build/outputs/apk/preRelease/*.apk
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
compression-level: 0
|
||||
|
||||
Reference in New Issue
Block a user