forked from youzan/vant
-
Notifications
You must be signed in to change notification settings - Fork 16
70 lines (57 loc) · 1.78 KB
/
android.yml
File metadata and controls
70 lines (57 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Android CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update Submodule
run: |
git submodule update --init --recursive
- name: set up JDK 11
uses: actions/setup-java@v4
with:
java-version: "11"
distribution: "temurin"
- name: Setup Node.js and pnpm
uses: pnpm/action-setup@v4
with:
version: 10 # 指定 pnpm 版本
run_install: false # 不自动安装依赖(你可以后面手动控制)
- name: Setup Bun
run: |
curl -fsSL https://bun.sh/install | bash
echo "$HOME/.bun/bin" >> $GITHUB_PATH
curl -fsSL https://get.pnpm.io/install.sh | sh -
- name: Grant execute permission for gradlew
run: chmod +x ./WebApkShell/gradlew
- name: Install Dependency
run: bun i
- name: Build with Gradle
run: |
cp WebApkShell/genApk.ts .
bun genApk.ts
- name: Create date tag
id: tag_step
run: |
DATE=$(date +'%Y%m%d-%H%M%S')
TAG="v${DATE}"
echo "生成 Tag: $TAG"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag $TAG
git push origin $TAG
# 输出 tag 名
echo "tag_name=$TAG" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag_step.outputs.tag_name }}
files: |
WebApkShell/app/build/outputs/apk/release/*.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}