-
Notifications
You must be signed in to change notification settings - Fork 55
152 lines (148 loc) · 5.14 KB
/
build-apps.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
152
name: Build Apps
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
TAG:
description: 'Set a Tag'
required: true
default: ''
push:
tags:
- v*
jobs:
build-apks-and-linux-app:
name: Release Apks/LinuxApp
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Build apks
run: |
flutter pub get
flutter build apk --release --tree-shake-icons
flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi --release --tree-shake-icons
mkdir -p releases
mv -f build/app/outputs/flutter-apk/*-release.apk releases
mv -f releases/app-release.apk releases/app-universal-release.apk
- name: Sign build apk
uses: iota9star/[email protected]
with:
releaseDirectory: releases
fileRegex: .*-release.apk
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "34.0.0"
- name: Rename signed apk
run: |
for name in $(ls releases/*-signed.apk);do mv -f $name ${name%-signed.apk}.apk ;done
- name: Build linux app
run: |
sudo apt-get install bash curl file unzip xz-utils zip libglu1-mesa clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev -y
flutter pub get
flutter config --enable-linux-desktop
flutter build linux --release
cd build/linux/x64/release/bundle
zip -r linux-release.zip ./
mv linux-release.zip ../../../../../
- name: Release to github
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "releases/*-release.apk,linux-release.zip"
token: ${{ secrets.ACTION_TOKEN }}
tag: ${{ github.event.inputs.TAG }}
build-windows-app:
name: Release Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Build windows
run: |
flutter pub get
flutter config --enable-windows-desktop
flutter build windows --release --tree-shake-icons
Compress-Archive -Path build/windows/x64/runner/Release/* mikan-windows-x64.zip -Force
& "${env:ProgramFiles(x86)}\Inno Setup 6\iscc.exe" windows_inno_setup.iss
- name: Release build
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "mikan-windows-x64.zip,mikan-windows-x64-setup.exe"
token: ${{ secrets.ACTION_TOKEN }}
tag: ${{ github.event.inputs.TAG }}
build-macos-app:
name: Release MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Set up xcode
uses: BoundfoxStudios/action-xcode-select@v1
- name: Build macos
env:
MACOS_APP_RELEASE_PATH: build/macos/Build/Products/Release
run: |
flutter config --enable-macos-desktop
flutter pub get
flutter build macos --release --tree-shake-icons
brew install create-dmg
cd $MACOS_APP_RELEASE_PATH
create-dmg \
--volname "MikanProject Installer" \
--window-pos 200 120 \
--window-size 800 529 \
--icon-size 130 \
--text-size 14 \
--icon "mikan.app" 260 250 \
--hide-extension "mikan.app" \
--app-drop-link 540 250 \
--hdiutil-quiet \
"MikanProject.dmg" \
"mikan.app"
cd ../../../../../
mv $MACOS_APP_RELEASE_PATH/MikanProject.dmg macos-release.dmg
- name: Release Mac
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "macos-release.dmg"
token: ${{ secrets.ACTION_TOKEN }}
tag: ${{ github.event.inputs.TAG }}
- name: Build iOS
run: |
cp -f pubspec.yaml assets/
flutter pub get
flutter build ios --release --tree-shake-icons --no-codesign
mkdir -p Payload
mv build/ios/iphoneos/Runner.app Payload
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install zip
zip -r ios-release.ipa Payload
- name: Release iOS
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "ios-release.ipa"
token: ${{ secrets.ACTION_TOKEN }}
tag: ${{ github.event.inputs.TAG }}