Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
Automation, build, CI fixes (#443)
Browse files Browse the repository at this point in the history
* Fix ordering issue

* Fix if

* Add debugging

* More formatting

* Update versions

* Fix goldens

* Trigger draft

* Fix apk

* xx

* Fix apk

* xx

* xx

* xx

* xx

* xx

* xx

* xx

* xx

* xx

* xx

* xx

* xx

* xx

* xx

* xx

* xx

* xx

* Fix windows build

* xx

* xx

* Update CMakeLists.txt

* xx

* Remove debugging

* Update packages

* Update release.yml

* xx

* xx

* xx

* xx

* xx

* xx

* xx

* Cleanup

* apk⇒android
  • Loading branch information
guidezpl authored Mar 1, 2021
1 parent 752ca54 commit 1505fd1
Show file tree
Hide file tree
Showing 18 changed files with 147 additions and 56 deletions.
77 changes: 48 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
create-release:
name: Create draft release
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
Expand All @@ -26,20 +26,28 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
target: [macos, windows, linux, apk]
target: [macos, windows, linux, android]
include:
- os: macos-10.15
- os: macos-10.15 # Catalina
target: macos
path: build/macos/Build/Products/Release
asset_extension: .zip
asset_content_type: application/zip
- os: windows-2019
target: windows
path: build\windows\runner\Release
- os: ubuntu-18.04
asset_extension: .zip
asset_content_type: application/zip
- os: ubuntu-20.04
target: linux
path: build/linux/release/bundle
- os: ubuntu-18.04
target: apk
path: build/app/outputs/apk/release/
path: build/linux/x64/release/bundle
asset_extension: .tar.gz
asset_content_type: application/gzip
- os: ubuntu-20.04
target: android
path: build/app/outputs/flutter-apk
asset_extension: .apk
asset_content_type: application/vnd.android.package-archive
# Disable fail-fast as we want results from all even if one fails.
fail-fast: false
needs: create-release
Expand All @@ -52,23 +60,24 @@ jobs:
ref: 'master'
path: 'flutter'
fetch-depth: 0
- name: Add Flutter to the PATH for Linux and macOS
if: startsWith(matrix.os, 'macOS') || startsWith(matrix.os, 'ubuntu')
- name: Add Flutter to the PATH for Linux, macOS, Android
if: matrix.target != 'windows'
run: echo "$GITHUB_WORKSPACE/flutter/bin" >> $GITHUB_PATH
- name: Add Flutter to the PATH for Windows
if: startsWith(matrix.os, 'windows')
if: matrix.target == 'windows'
run: echo "${env:GITHUB_WORKSPACE}\flutter\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install Linux dependencies
if: startsWith(matrix.target, 'linux')
if: matrix.target == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libx11-dev pkg-config cmake ninja-build libblkid-dev
- name: Install Android dependencies
if: startsWith(matrix.target, 'apk')
if: matrix.target == 'android'
uses: actions/setup-java@v1
with:
java-version: '12.x'
- name: Enable desktop support
if: matrix.target != 'android'
run: |
flutter config --enable-linux-desktop
flutter config --enable-macos-desktop
Expand All @@ -81,38 +90,48 @@ jobs:
uses: actions/checkout@v2
with:
path: 'code'
- name: Get packages for the Flutter project
run: flutter pub get
working-directory: code

# Build the application for desktop.
# Build the application.
- name: Build project
run: |
flutter create .
flutter pub get
flutter build -v ${{ matrix.target }} --release
working-directory: code
- name: Copy VC redistributables to release directory
if: startsWith(matrix.target, 'windows')

# Package the build.
- name: Copy VC redistributables to release directory for Windows
if: matrix.target == 'windows'
run: |
Copy-Item (vswhere -find 'VC\Redist\MSVC\14.27.29016\x64\Microsoft.VC142.CRT\msvcp140.dll') .
Copy-Item (vswhere -find 'VC\Redist\MSVC\14.27.29016\x64\Microsoft.VC142.CRT\vcruntime140.dll') .
Copy-Item (vswhere -find 'VC\Redist\MSVC\14.27.29016\x64\Microsoft.VC142.CRT\vcruntime140_1.dll') .
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\msvcp140.dll') .
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\vcruntime140.dll') .
Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\vcruntime140_1.dll') .
working-directory: code\${{ matrix.path }}
- name: Compress build for Linux and macOS
if: startsWith(matrix.os, 'macOS') || startsWith(matrix.os, 'ubuntu')
run: zip -r $GITHUB_WORKSPACE/flutter_gallery_${{ matrix.target }} .
- name: Rename build for Android
if: matrix.target == 'android'
run: mv app-release.apk $GITHUB_WORKSPACE/flutter_gallery_${{ matrix.target }}.apk
working-directory: code/${{ matrix.path }}
- name: Compress build for Linux
if: matrix.target == 'linux'
run: tar czf $GITHUB_WORKSPACE/flutter_gallery_${{ matrix.target }}.tar.gz *
working-directory: code/${{ matrix.path }}
- name: Compress build for macOS
if: matrix.target == 'macos'
run: ditto -c -k --sequesterRsrc --keepParent Flutter\ Gallery.app $GITHUB_WORKSPACE/flutter_gallery_${{ matrix.target }}.zip
working-directory: code/${{ matrix.path }}
- name: Compress build for Windows
if: startsWith(matrix.os, 'windows')
if: matrix.target == 'windows'
run: compress-archive -Path * -DestinationPath ${env:GITHUB_WORKSPACE}\flutter_gallery_${{ matrix.target }}.zip
working-directory: code\${{ matrix.path }}

# Upload the build.
- name: Upload release asset
id: upload_release_asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./flutter_gallery_${{ matrix.target }}.zip
asset_name: flutter_gallery_${{ matrix.target }}.zip
asset_content_type: application/zip
asset_path: ./flutter_gallery_${{ matrix.target }}${{ matrix.asset_extension }}
asset_name: flutter_gallery_${{ matrix.target }}${{ matrix.asset_extension }}
asset_content_type: ${{ matrix.asset_content_type }}
Binary file modified golden_test/goldens/home_page_desktop_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified golden_test/goldens/home_page_desktop_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified golden_test/goldens/home_page_mobile_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified golden_test/goldens/home_page_mobile_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Generated file. Do not edit.
//

// clang-format off

#include "generated_plugin_registrant.h"

#include <url_launcher_linux/url_launcher_plugin.h>
Expand Down
2 changes: 2 additions & 0 deletions linux/flutter/generated_plugin_registrant.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Generated file. Do not edit.
//

// clang-format off

#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_

Expand Down
2 changes: 2 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Generated file. Do not edit.
//

// clang-format off

import FlutterMacOS
import Foundation

Expand Down
48 changes: 24 additions & 24 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "16.0.0"
version: "17.0.0"
adaptive_breakpoints:
dependency: "direct main"
description:
Expand All @@ -21,14 +21,14 @@ packages:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.1.0"
animations:
dependency: "direct main"
description:
name: animations
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0-nullsafety.0"
version: "2.0.0"
archive:
dependency: transitive
description:
Expand Down Expand Up @@ -157,7 +157,7 @@ packages:
name: flutter_gallery_assets
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "1.0.2"
flutter_localizations:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -247,7 +247,7 @@ packages:
name: io
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.4"
version: "0.3.5"
js:
dependency: transitive
description:
Expand Down Expand Up @@ -324,35 +324,35 @@ packages:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0-nullsafety.1"
version: "2.0.0"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0-nullsafety"
version: "2.0.0"
path_provider_macos:
dependency: transitive
description:
name: path_provider_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.5-nullsafety"
version: "2.0.0"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0-nullsafety"
version: "2.0.0"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0-nullsafety.3"
version: "2.0.0"
pedantic:
dependency: "direct dev"
description:
Expand All @@ -373,7 +373,7 @@ packages:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.1"
version: "2.0.0"
pool:
dependency: transitive
description:
Expand All @@ -394,7 +394,7 @@ packages:
name: provider
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.0-nullsafety.4"
version: "5.0.0-nullsafety.5"
pub_semver:
dependency: transitive
description:
Expand Down Expand Up @@ -443,7 +443,7 @@ packages:
name: shelf_web_socket
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.4"
version: "0.2.4+1"
shrine_images:
dependency: "direct main"
description:
Expand Down Expand Up @@ -518,7 +518,7 @@ packages:
name: test
url: "https://pub.dartlang.org"
source: hosted
version: "1.16.2"
version: "1.16.4"
test_api:
dependency: transitive
description:
Expand All @@ -532,7 +532,7 @@ packages:
name: test_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.13"
version: "0.3.14"
typed_data:
dependency: transitive
description:
Expand All @@ -546,42 +546,42 @@ packages:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.0-nullsafety.7"
version: "6.0.1"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0-nullsafety.3"
version: "2.0.0"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0-nullsafety.2"
version: "2.0.0"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0-nullsafety.1"
version: "2.0.1"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0-nullsafety"
version: "2.0.0"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0-nullsafety.2"
version: "2.0.0"
vector_math:
dependency: "direct main"
description:
Expand Down Expand Up @@ -616,7 +616,7 @@ packages:
name: web_socket_channel
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "2.0.0"
webdriver:
dependency: transitive
description:
Expand Down Expand Up @@ -651,7 +651,7 @@ packages:
name: yaml
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
version: "3.1.0"
sdks:
dart: ">=2.12.0-259.9.beta <3.0.0"
dart: ">=2.12.0 <3.0.0"
flutter: ">=1.24.0-6.0.pre"
2 changes: 1 addition & 1 deletion windows/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.15)
project(gallery LANGUAGES CXX)

set(BINARY_NAME "flutter_gallery")
set(BINARY_NAME "gallery")

cmake_policy(SET CMP0063 NEW)

Expand Down
2 changes: 2 additions & 0 deletions windows/flutter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ list(APPEND FLUTTER_LIBRARY_HEADERS
"flutter_windows.h"
"flutter_messenger.h"
"flutter_plugin_registrar.h"
"flutter_texture_registrar.h"
)
list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")
add_library(flutter INTERFACE)
Expand Down Expand Up @@ -91,6 +92,7 @@ add_custom_command(
${FLUTTER_TOOL_ENVIRONMENT}
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
windows-x64 $<CONFIG>
VERBATIM
)
add_custom_target(flutter_assemble DEPENDS
"${FLUTTER_LIBRARY}"
Expand Down
2 changes: 2 additions & 0 deletions windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Generated file. Do not edit.
//

// clang-format off

#include "generated_plugin_registrant.h"

#include <url_launcher_windows/url_launcher_plugin.h>
Expand Down
Loading

0 comments on commit 1505fd1

Please sign in to comment.