fix: 修复高图缩放限制过小 #443
Workflow file for this run
This file contains hidden or 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
| name: Build Check | |
| on: | |
| push: | |
| branches-ignore: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| build_pr: | |
| name: Build PR | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Set Current Date As Env Variable | |
| - name: Set current date as env variable | |
| run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
| # Set Repository Name As Env Variable | |
| - name: Set repository name as env variable | |
| run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV | |
| - name: Set Up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' # See 'Supported distributions' for available options | |
| java-version: '17' | |
| cache: 'gradle' | |
| - name: Change wrapper permissions | |
| run: chmod +x ./gradlew | |
| - name: Cache Gradle | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| ~/.m2/repository | |
| ./.gradle | |
| ./**/.gradle | |
| ./apk-recompress/target | |
| # dont invalidate cache if only gradle.properties is changed -- they | |
| key: gradle-cache-${{ hashFiles('**/*.gradle.kts', '**/gradle-wrapper.properties') }} | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Setup rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| override: true | |
| - name: Install cargo-ndk | |
| run: cargo install cargo-ndk || true | |
| - name: Add Android Rust targets | |
| run: | | |
| rustup target add aarch64-linux-android | |
| rustup target add armv7-linux-androideabi | |
| rustup target add i686-linux-android | |
| rustup target add x86_64-linux-android | |
| # Run Tests Build | |
| - name: Run KtLint | |
| run: ./gradlew ktlintCheck | |
| - name: Run gradle tests | |
| run: ./gradlew test | |
| - name: Build App | |
| # Build .apk | |
| run: | | |
| bash ./gradlew assembleFullDebug | |
| bash ./gradlew assembleLiteDebug | |
| env: | |
| CI_BUILD_MINIFY: false | |
| - name: Move files | |
| run: | | |
| mkdir -p app/build/upload | |
| mkdir -p app/build/upload-lite | |
| mv app/build/outputs/apk/full/debug/app-full-debug.apk app/build/upload/zhihu++-full-debug.apk | |
| cp app/build/outputs/apk/lite/debug/app-lite-debug.apk app/build/upload/zhihu++-lite-debug.apk | |
| mv app/build/outputs/apk/lite/debug/app-lite-debug.apk app/build/upload-lite/zhihu++-lite-debug.apk | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: PR Debug artifacts | |
| path: app/build/upload/ | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: PR Debug artifacts (Lite) | |
| path: app/build/upload-lite/ |