-
Notifications
You must be signed in to change notification settings - Fork 30
151 lines (137 loc) · 4.54 KB
/
release.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: yyrelease
on:
push:
tags:
- "release-v*"
env:
FLUTTER_VERSION: 3.22.0
LINUX_DEPENDENCIES: git wget unzip python3 zip xz-utils curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libjsoncpp25 libsecret-1-dev libsecret-1-0 librhash0 libsqlite3-dev libappindicator3-dev gettext libwebkit2gtk-4.1-dev
jobs:
build-with-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: Install project dependencies
run: |
./script/fetch_git_info.ps1
flutter pub get
flutter pub run build_runner build
- name: Enable windows build
run: flutter config --enable-windows-desktop
- name: Build artifacts
run: flutter build windows --release
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: yy-windows.zip
directory: build/windows/runner/Release
- name: Upload assets
uses: actions/upload-artifact@v3
with:
name: windows
path: build/windows/x64/runner/Release/yy-windows.zip
build-with-linux-x86_64:
runs-on: ubuntu-22.04
env:
TARBALL_NAME: yy-linux-x86_64.tar.gz
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: Disable Google Analytics
run: flutter config --no-analytics
- name: Install dependencies
run: |
flutter pub get
flutter pub run build_runner build
- name: Enable Linux support
run: flutter config --enable-linux-desktop
- name: Install dependencies
run: sudo apt update && sudo apt-get install -y ${{ env.LINUX_DEPENDENCIES }} || true
- name: Build
run: |
python3 script/linux_apply_font.py
bash script/fetch_git_info.sh
flutter build linux --release
- name: Create tarball
run: |
cd build/linux/x64/release/bundle
tar -czf ../${{ env.TARBALL_NAME }} *
- name: Upload assets
uses: actions/upload-artifact@v3
with:
name: x86_64_linux
path: build/linux/x64/release/${{ env.TARBALL_NAME }}
build-cross-platform-and-release:
runs-on: macos-12
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4.1'
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "11"
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
channel: "stable"
- uses: actions/setup-node@v4
with:
node-version: 20
- name: generate release notes
run: node script/draft-release-notes.js > release-notes.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: build apk(archs)
run: |
bash script/fetch_git_info.sh
flutter pub get
flutter pub run build_runner build
flutter pub deps
flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
- name: build all arch
run: flutter build apk --release
# 我的iOS都升到18.0了, 还搞鸡毛啊
# - run: |
# flutter build ios --release --no-codesign
# cd build/ios/iphoneos
# mkdir Payload
# cd Payload
# ln -s ../Runner.app
# cd ..
# zip -r app.ipa Payload
- name: build macos
run: |
flutter config --enable-macos-desktop
flutter build macos --release
cd build/macos/Build/Products/Release
zip -r yoyo.mac.zip yoyo.app/*
- uses: actions/download-artifact@v3
with:
name: x86_64_linux
- uses: actions/download-artifact@v3
with:
name: windows
# build/ios/iphoneos/app.ipa
- uses: softprops/action-gh-release@v2
with:
body_path: release-notes.txt
files: |
build/app/outputs/flutter-apk/*.apk
build/macos/Build/Products/Release/yoyo.mac.zip
yy-linux-x86_64.tar.gz
yy-windows.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}