Skip to content

Commit 5f36d25

Browse files
committed
Splitted Jobs for each platform in github actions
1 parent a675cc8 commit 5f36d25

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1401
-1349
lines changed

.github/workflows/main.yml

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,49 @@ on:
66
name: Release Builds
77
jobs:
88
linux:
9-
name: Android & Linux & Web
9+
name: Linux
1010
runs-on: ubuntu-latest
1111
steps:
1212
- run: |
1313
git clone https://github.com/flutter/flutter.git
1414
cd flutter
15-
git checkout 4df8fdb7df
15+
git checkout 5663e02645
1616
- run: echo ::add-path::`pwd`"/flutter/bin"
17-
18-
- uses: actions/setup-java@v1
19-
with:
20-
java-version: '12.x'
21-
2217
- uses: actions/checkout@v2
2318
with:
2419
path: 'app'
25-
2620
- run: |
2721
cd app
2822
flutter config --enable-linux-desktop
29-
flutter config --enable-web
3023
flutter pub get
3124
flutter build linux --release
32-
flutter build apk -t lib/main.mobile.dart --release
33-
flutter build web -t lib/main.mobile.dart --release
3425
cd build/linux/
3526
zip -r linux-release.zip release
27+
- name: Create Android & linux Release
28+
uses: ncipollo/release-action@v1
29+
with:
30+
artifacts: 'app/build/linux/linux-release.zip'
31+
token: ${{ secrets.TOKEN }}
32+
allowUpdates: true
3633

37-
# - run: |
38-
# cd app
39-
# npm i
40-
# npm run upload apk ${{ secrets.ACCOUNT }}
41-
# npm run upload linux ${{ secrets.ACCOUNT }}
34+
web:
35+
name: Web
36+
runs-on: ubuntu-latest
37+
steps:
38+
- run: |
39+
git clone https://github.com/flutter/flutter.git
40+
cd flutter
41+
git checkout 5663e02645
42+
- run: echo ::add-path::`pwd`"/flutter/bin"
43+
- uses: actions/checkout@v2
44+
with:
45+
path: 'app'
4246

47+
- run: |
48+
cd app
49+
flutter config --enable-web
50+
flutter pub get
51+
flutter build web -t lib/main.mobile.dart --release
4352
- name: Deploy to Firebase
4453
uses: w9jds/firebase-action@v1.3.0
4554
with:
@@ -48,10 +57,29 @@ jobs:
4857
PROJECT_PATH: 'app'
4958
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
5059

60+
android:
61+
name: Android
62+
runs-on: ubuntu-latest
63+
steps:
64+
- run: |
65+
git clone https://github.com/flutter/flutter.git
66+
cd flutter
67+
git checkout 5663e02645
68+
- run: echo ::add-path::`pwd`"/flutter/bin"
69+
- uses: actions/setup-java@v1
70+
with:
71+
java-version: '12.x'
72+
- uses: actions/checkout@v2
73+
with:
74+
path: 'app'
75+
- run: |
76+
cd app
77+
flutter pub get
78+
flutter build apk -t lib/main.mobile.dart --release
5179
- name: Create Android & linux Release
5280
uses: ncipollo/release-action@v1
5381
with:
54-
artifacts: 'app/build/app/outputs/apk/release/app-release.apk,app/build/linux/linux-release.zip'
82+
artifacts: 'app/build/app/outputs/apk/release/app-release.apk'
5583
token: ${{ secrets.TOKEN }}
5684
allowUpdates: true
5785

@@ -62,26 +90,18 @@ jobs:
6290
- run: |
6391
git clone https://github.com/flutter/flutter.git
6492
cd flutter
65-
git checkout 4df8fdb7df
93+
git checkout 5663e02645
6694
- run: echo ::add-path::`pwd`"/flutter/bin"
67-
6895
- uses: actions/checkout@v2
6996
with:
7097
path: 'app'
71-
7298
- run: |
7399
cd app
74100
flutter config --enable-macos-desktop
75101
flutter pub get
76102
flutter build macos --release
77103
cd build/macos/Build/Products/Release
78104
ditto -c -k --sequesterRsrc --keepParent flutter_uis.app macos-release.zip
79-
80-
# - run: |
81-
# cd app
82-
# npm i
83-
# npm run upload macos ${{ secrets.ACCOUNT }}
84-
85105
- uses: ncipollo/release-action@v1
86106
with:
87107
artifacts: 'app/build/macOS/Build/Products/Release/macos-release.zip'
@@ -95,27 +115,18 @@ jobs:
95115
- run: |
96116
git clone https://github.com/flutter/flutter.git
97117
cd flutter
98-
git checkout 4df8fdb7df
118+
git checkout 5663e02645
99119
- run: echo ::add-path::"$(pwd)\flutter\bin"
100-
101120
- uses: actions/checkout@v2
102121
with:
103122
path: 'app'
104-
105123
- run: |
106124
cd app
107125
flutter config --enable-windows-desktop
108126
flutter pub get
109127
flutter build windows --release
110128
cd build\windows\x64\Release
111129
Compress-Archive -Path Runner -DestinationPath windows-release.zip
112-
113-
# Windows prints the secret variable in log taht's why It's disabled for now
114-
# - run: |
115-
# cd app
116-
# npm i
117-
# npm run upload windows ${{ secrets.ACCOUNT }}
118-
119130
- name: Windows release build for github
120131
uses: ncipollo/release-action@v1
121132
with:

linux/CMakeLists.txt

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
cmake_minimum_required(VERSION 3.10)
2+
project(runner LANGUAGES CXX)
3+
4+
set(BINARY_NAME "flutter_uis")
5+
6+
cmake_policy(SET CMP0063 NEW)
7+
8+
set(CMAKE_INSTALL_RPATH "\$ORIGIN")
9+
10+
# Configure build options.
11+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
12+
set(CMAKE_BUILD_TYPE "Debug" CACHE
13+
STRING "Flutter build mode" FORCE)
14+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
15+
"Debug" "Profile" "Release")
16+
endif()
17+
18+
# Compilation settings that should be applied to most targets.
19+
function(APPLY_STANDARD_SETTINGS TARGET)
20+
target_compile_features(${TARGET} PUBLIC cxx_std_14)
21+
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
22+
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
23+
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
24+
endfunction()
25+
26+
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
27+
28+
# Flutter library and tool build rules.
29+
add_subdirectory(${FLUTTER_MANAGED_DIR})
30+
31+
# Application build
32+
add_executable(${BINARY_NAME}
33+
"main.cc"
34+
"window_configuration.cc"
35+
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
36+
)
37+
apply_standard_settings(${BINARY_NAME})
38+
target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
39+
add_dependencies(${BINARY_NAME} flutter_assemble)
40+
41+
# Generated plugin build rules, which manage building the plugins and adding
42+
# them to the application.
43+
include(flutter/generated_plugins.cmake)
44+
45+
46+
# === Installation ===
47+
# By default, "installing" just makes a relocatable bundle in the build
48+
# directory.
49+
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
50+
set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/bundle" CACHE PATH "..." FORCE)
51+
endif()
52+
53+
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
54+
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
55+
56+
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
57+
COMPONENT Runtime)
58+
59+
file(GLOB FLUTTER_PLUGIN_DIRS "${PROJECT_BINARY_DIR}/plugins/*")
60+
61+
INSTALL(CODE "
62+
include(BundleUtilities)
63+
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${BINARY_NAME}\" \"\"
64+
\"${FLUTTER_PLUGIN_DIRS};${FLUTTER_LIBRARY_DIR}\")
65+
" COMPONENT Runtime)
66+
67+
INSTALL(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
68+
COMPONENT Runtime)
69+
70+
# Fully re-copy the assets directory on each build to avoid having stale files
71+
# from a previous install.
72+
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
73+
INSTALL(CODE "
74+
file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
75+
" COMPONENT Runtime)
76+
INSTALL(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
77+
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)

linux/Makefile

Lines changed: 0 additions & 157 deletions
This file was deleted.

linux/flutter/.template_version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2

0 commit comments

Comments
 (0)