forked from guozhigq/pilipala
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (61 loc) · 1.86 KB
/
windows.yml
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
71
72
73
74
name: build_windows
# action事件触发
on:
push:
branches:
- "*"
# push tag时触发
tags:
- "*"
pull_request:
workflow_dispatch:
# 可以有多个jobs
jobs:
build_windows:
# 运行环境 ubuntu-latest windows-latest mac-latest
runs-on: windows-latest
# 每个jobs中可以有多个steps
steps:
- name: 代码迁出
uses: actions/checkout@v3
- name: 构建Java环境
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "17"
token: ${{secrets.GIT_TOKEN}}
# - name: 检查缓存
# uses: actions/cache@v2
# id: cache-flutter
# with:
# path: /root/flutter-sdk # Flutter SDK 的路径
# key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}
- name: 安装Flutter
# if: steps.cache-flutter.outputs.cache-hit != 'true'
uses: subosito/flutter-action@v2
with:
flutter-version: 3.16.5
channel: any
- name: 启用windows支持
run: |
flutter config --enable-windows-desktop
- name: 下载项目依赖
run: flutter pub get
- name: flutter build windows
# 对应 android/app/build.gradle signingConfigs中的配置项
run: flutter build windows
- name: 获取版本号
id: version
run: echo "version=${GITHUB_REF#refs/tags/v}" >>$GITHUB_OUTPUT
# - name: 获取当前日期
# id: date
# run: echo "date=$(date +'%m%d')" >>$GITHUB_OUTPUT
- name: 重命名应用 Pili-windows-x64.zip
run: |
7z a -tzip Pili-windows-x64.zip -r build/windows/x64/runner/Release/*
shell: bash
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: Pili-Windows-x64
path: Pili-windows-x64.zip