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

Improve releasing process #661

Merged
merged 22 commits into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/release_deploy_play_store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ on:
workflow_dispatch:
inputs:
lane:
description: "Fastlane lane to use (beta OR promote_to_production OR production)"
description: "Fastlane lane"
required: true
default: "beta"
# Refs/tags push events to matching v*, i.e. v1.0, v20.15.10
push:
tags:
- "v*"
type: choice
options:
- beta
- promote_to_production
- production

# Declare default permissions as read only.
permissions: read-all
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release_deploy_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on:
workflow_dispatch:
inputs:
environment:
description: "Environment to deploy to (staging OR prod)"
description: "Environment to deploy web build"
required: true
default: "staging"
# Refs/tags push events to matching v*, i.e. v1.0, v20.15.10
push:
tags:
- "v*"
type: choice
options:
- staging
- prod

# Declare default permissions as read only.
permissions: read-all
Expand Down
47 changes: 11 additions & 36 deletions .github/workflows/release_draft_github_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,33 @@ name: Draft Github Release
on:
# Enable manual run
workflow_dispatch:
# Refs/tags push events to matching v*, i.e. v1.0, v20.15.10
push:
tags:
- "v*"
inputs:
version:
description: "Tag to create (e.g. v2.10.0). Must include 'v' and must match pubspec"
required: true
default: "v2.10.0"
type: string

# Declare default permissions as read only.
permissions: read-all

jobs:
generate-changelog:
name: Generate changelog
runs-on: ubuntu-latest
steps:
- name: Get latest published release tag
id: get_latest_release
uses: pozetroninc/github-action-get-latest-release@2b51d48e904071035d6632715d41966f516711dd
with:
repository: ${{ github.repository }}
excludes: prerelease, draft
- name: Generate changelog since last published release
uses: charmixer/auto-changelog-action@5c6320ae4dedc8743e4439a3c56294c294553fb9
with:
token: ${{ secrets.FLUTTERGALLERYRELEASEBOT_TOKEN }}
future_release: ${{ github.ref }}
since_tag: ${{ steps.get_latest_release.outputs.release }}
- name: Upload changelog
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2
with:
name: changelog
path: CHANGELOG.md

draft-release:
name: Draft Github release
needs: generate-changelog
runs-on: ubuntu-20.04
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Download changelog
uses: actions/download-artifact@f023be2c48cc18debc3bacd34cb396e0295e2869
with:
name: changelog
- name: Draft release with changelog
- name: Draft release with release notes
id: create_release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
env:
GITHUB_TOKEN: ${{ secrets.FLUTTERGALLERYRELEASEBOT_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Flutter Gallery ${{ github.ref }}
body_path: CHANGELOG.md
tag_name: ${{ github.event.inputs.version }}
draft: true
prerelease: false
generate_release_notes: true

create-build:
name: Create ${{ matrix.target }} build
Expand Down Expand Up @@ -174,3 +148,4 @@ jobs:
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 }}
overwrite: true
24 changes: 22 additions & 2 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
# This file should be version controlled.

version:
revision: f5733f7a62ebc7c2ba324a2b410cd81215956b7d
revision: 2aa348b9407e96ffe4eca8e8f213c7984afad3f7
channel: master

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 2aa348b9407e96ffe4eca8e8f213c7984afad3f7
base_revision: 2aa348b9407e96ffe4eca8e8f213c7984afad3f7
- platform: windows
create_revision: 2aa348b9407e96ffe4eca8e8f213c7984afad3f7
base_revision: 2aa348b9407e96ffe4eca8e8f213c7984afad3f7

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
120 changes: 63 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,8 @@ wild.

![Flutter Gallery](https://user-images.githubusercontent.com/6655696/73928238-0d7fcc80-48d3-11ea-8a7e-ea7dc5d6e713.png)

## Running Flutter Gallery on Flutter's master channel

The Flutter Gallery targets Flutter's master channel. As such, it can take advantage
of new SDK features that haven't landed in the stable channel.

If you'd like to run the Flutter Gallery, make sure to switch to the master channel
first:

```bash
flutter channel master
flutter upgrade
```

When you're done, use this command to return to the safety of the stable
channel:

```bash
flutter channel stable
flutter upgrade
```

## Features

- Showcase for `material`, `cupertino`, and other widgets
- [Adpative layout](lib/layout/adaptive.dart) for mobile and desktop
- State restoration support
Expand All @@ -52,6 +32,8 @@ These include:
- Linux ([.tar.gz][latest release])
- Windows ([.zip][latest release])

## Running

One can run the gallery locally for any of these platforms. For desktop platforms,
please see the [Flutter docs](https://docs.flutter.dev/desktop) for the latest
requirements.
Expand All @@ -62,26 +44,34 @@ flutter pub get
flutter run
```

## Development

<details>
<summary>Including a new splash animation</summary>
<summary>Troubleshooting</summary>

1. Convert your animation to a `.gif` file.
Ideally, use a background color of `0xFF030303` to ensure the animation
blends into the background of the app.
### Flutter `master` channel

2. Add your new `.gif` file to the assets directory under
`assets/splash_effects`. Ensure the name follows the format
`splash_effect_$num.gif`. The number should be the next number after the
current largest number in the repository.
The Flutter Gallery targets Flutter's `master` channel. As such, it can take advantage
of new SDK features that haven't landed in the stable channel.

If you'd like to run the Flutter Gallery, you may have to switch to the `master` channel
first:

```bash
flutter channel master
flutter upgrade
```

When you're done, use this command to return to the safety of the `stable`
channel:

```bash
flutter channel stable
flutter upgrade
```

3. Update the map `_effectDurations` in
[splash.dart](lib/pages/splash.dart) to include the number of the
new `.gif` as well as its estimated duration. The duration is used to
determine how long to display the splash animation at launch.
</details>

## Development

<details>
<summary>Generating localizations</summary>

Expand Down Expand Up @@ -113,39 +103,55 @@ more details.

</details>

## Creating a new release (for Flutter org members)
<details>
<summary>Including a new splash animation</summary>

1. Convert your animation to a `.gif` file.
Ideally, use a background color of `0xFF030303` to ensure the animation
blends into the background of the app.

2. Add your new `.gif` file to the assets directory under
`assets/splash_effects`. Ensure the name follows the format
`splash_effect_$num.gif`. The number should be the next number after the
current largest number in the repository.

3. Update the map `_effectDurations` in
[splash.dart](lib/pages/splash.dart) to include the number of the
new `.gif` as well as its estimated duration. The duration is used to
determine how long to display the splash animation at launch.
</details>

1. **Version bump**: Bump the `pubspec.yaml` version number. This can be in a PR making a change or a separate PR.
Use [semantic versioning](https://semver.org/) to determine
which part to increment. The version number after the `+` should also be incremented. For example `1.2.3+010203`
with a patch should become `1.2.4+010204`.
## Releasing

2. **Staging**: After the version bump PR is merged, push a new version tag to main.
<details>
<summary>for flutter-hackers members</summary>

```bash
git pull upstream main
git tag v1.2.4 # note the v
git push upstream v1.2.4
```
The process is largely automated and easy to set in motion.

This will trigger a set of GitHub Actions [workflows](https://github.com/flutter/gallery/tree/main/.github/workflows) that will:
First things first, bump the `pubspec.yaml` version number. This can be in a PR making a change or a separate PR.
Use [semantic versioning](https://semver.org/) to determine
which part to increment. The version number after the `+` should also be incremented. For example `1.2.3+010203`
with a patch should become `1.2.4+010204`.

- Draft a [GitHub release](<(https://github.com/flutter/gallery/releases)>) with automatically generated release notes and packaged builds (.apk, macOS, Windows, and Linux)
- Deploy the gallery to the Firebase hosted [staging site](https://gallery-staging-flutter-dev.web.app/)
- Deploy a new Android build to the Play Store [beta track](https://play.google.com/apps/testing/io.flutter.demo.gallery)
Then, use the following workflows. It is strongly recommended to use the staging/beta environments when available, before deploying to production.

Note: all GitHub Action workflows can also be [run manually](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow)
- [Deploy to Play Store](https://github.com/flutter/gallery/actions/workflows/release_deploy_play_store.yml): Uses Fastlane to create a [beta](https://play.google.com/console/u/0/developers/7661132837216938445/app/4974617875198505129/tracks/open-testing) (freely available on the [Play Store](https://play.google.com/apps/testing/io.flutter.demo.gallery)), promote an existing beta to production, or publish straight to [production](https://play.google.com/console/u/0/developers/7661132837216938445/app/4974617875198505129/tracks/production) ([Play Store](https://play.google.com/store/apps/details?id=io.flutter.demo.gallery)).
> **Note**
> Once an .aab is released with a particular version number, it can't be replaced. The version number must be incremented again.
- [Deploy to web](https://github.com/flutter/gallery/actions/workflows/release_deploy_web.yml): Deploys a web build to the Firebase-hosted [staging](https://gallery-flutter-staging.web.app) or [production](https://gallery.flutter.dev) site.
- [Draft GitHub release](https://github.com/flutter/gallery/actions/workflows/release_draft_github_release.yml): Drafts a GitHub release, including automatically generated release notes and packaged builds for Android, macOS, Linux, and Windows.
> **Note**
> The release draft is private until published. Upon being published, the specified version tag will be created.

3. **Production**: Once satisfied,
- Publish the drafted [GitHub release](https://github.com/flutter/gallery/releases) (`Edit draft` -> `Publish release`).
- Deploy the gallery to the Firebase hosted [production site](https://gallery.flutter.dev) by running [this workflow](https://github.com/flutter/gallery/actions/workflows/deploy_web.yml) with `prod` using GitHub's UI.
- Promote the Play Store beta to production by running [this workflow](https://github.com/flutter/gallery/actions/workflows/deploy_play_store.yml) with `promote_to_production` using GitHub's UI.
For posterity, information about doing these things locally is available at [go/flutter-gallery-manual-deployment](http://go/flutter-gallery-manual-deployment).

More information about doing these things locally is available at [go/flutter-gallery-manual-deployment](http://go/flutter-gallery-manual-deployment).
</details>

## Tests

The gallery has its own set of unit and integration tests. Flutter itself also uses it in tests. To enable breaking changes, the gallery version is pinned in two places:
The gallery has its own set of unit, golden, and integration tests.

In addition, Flutter itself uses the gallery in tests. To enable breaking changes, the gallery version is pinned in two places:

- `flutter analyze`: https://github.com/flutter/tests/blob/master/registry/flutter_gallery.test
- DeviceLab tests: https://github.com/flutter/flutter/blob/master/dev/devicelab/lib/versions/gallery.dart
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
We made improvements and squashed bugs.

The complete list of changes is available at https://github.com/flutter/gallery/releases
The complete list of contributions is available at https://github.com/flutter/gallery/releases.
4 changes: 2 additions & 2 deletions linux/my_application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ static void my_application_activate(GApplication* application) {
if (use_header_bar) {
GtkHeaderBar *header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
gtk_widget_show(GTK_WIDGET(header_bar));
gtk_header_bar_set_title(header_bar, "gallery");
gtk_header_bar_set_title(header_bar, "Flutter Gallery");
gtk_header_bar_set_show_close_button(header_bar, TRUE);
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
}
else {
gtk_window_set_title(window, "gallery");
gtk_window_set_title(window, "Flutter Gallery");
}

gtk_window_set_default_size(window, 1280, 720);
Expand Down
22 changes: 14 additions & 8 deletions windows/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
cmake_minimum_required(VERSION 3.15)
# Project-level configuration.
cmake_minimum_required(VERSION 3.14)
project(gallery LANGUAGES CXX)

# The name of the executable created for the application. Change this to change
# the on-disk name of your application.
set(BINARY_NAME "gallery")

# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake.
cmake_policy(SET CMP0063 NEW)

set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")

# Configure build options.
# Define build configuration option.
get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(IS_MULTICONFIG)
set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
Expand All @@ -20,7 +23,7 @@ else()
"Debug" "Profile" "Release")
endif()
endif()

# Define settings for the Profile build mode.
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
Expand All @@ -30,6 +33,10 @@ set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
add_definitions(-DUNICODE -D_UNICODE)

# Compilation settings that should be applied to most targets.
#
# Be cautious about adding new options here, as plugins use this function by
# default. In most cases, you should add new options to specific targets instead
# of modifying this function.
function(APPLY_STANDARD_SETTINGS TARGET)
target_compile_features(${TARGET} PUBLIC cxx_std_17)
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
Expand All @@ -38,12 +45,11 @@ function(APPLY_STANDARD_SETTINGS TARGET)
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")
endfunction()

set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")

# Flutter library and tool build rules.
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
add_subdirectory(${FLUTTER_MANAGED_DIR})

# Application build
# Application build; see runner/CMakeLists.txt.
add_subdirectory("runner")

# Generated plugin build rules, which manage building the plugins and adding
Expand Down
3 changes: 2 additions & 1 deletion windows/flutter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.15)
# This file controls Flutter-level build steps. It should not be edited.
cmake_minimum_required(VERSION 3.14)

set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")

Expand Down
Loading