Initial commit: Android题库APP - Jetpack Compose + Retrofit
Some checks failed
Build and Release APK / build (push) Has been cancelled
Build and Release APK / release (push) Has been cancelled

This commit is contained in:
爱喝水的木子
2026-04-01 18:32:18 +08:00
commit 98fc3ff879
43 changed files with 3116 additions and 0 deletions

View File

@@ -0,0 +1,91 @@
name: Build and Release APK
on:
push:
tags:
- 'v*'
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Debug APK
run: ./gradlew assembleDebug
- name: Build Release APK
run: ./gradlew assembleRelease
continue-on-error: true
- name: List APK files
run: find . -name "*.apk" -type f
- name: Copy APK to output
run: |
mkdir -p output
find app/build/outputs -name "*.apk" -exec cp {} output/ \;
ls -la output/
- name: Upload APK artifacts
uses: actions/upload-artifact@v4
with:
name: apk-files
path: output/*.apk
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download APK artifacts
uses: actions/download-artifact@v4
with:
name: apk-files
path: output/
- name: List downloaded files
run: ls -la output/
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
body: |
## 题库APP ${{ github.ref_name }}
### 更新内容
- 自动构建发布
### 下载
请从下方Assets中下载APK文件安装使用
files: output/*.apk
draft: false
prerelease: false