Skip to content

Commit

Permalink
Fixes release notes with GitHub flow (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
zgosalvez authored Jan 3, 2021
1 parent e5e622e commit 9bd8128
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
28 changes: 17 additions & 11 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,43 @@
# GitHub Actions: Flutter Workflows

This sample project allows you to leverage GitHub Actions to run common Flutter workflows. These are based on the workflows found in the [Flutter Gallery](https://github.com/flutter/gallery) repository.
This sample project allows you to leverage GitHub Actions to run common Flutter workflows. These are based on the workflows found in the [Flutter Gallery](https://github.com/flutter/gallery) repository. Continue reading to apply these to your Flutter project.

## Disclaimer
This is still in active development, and it currently supports iOS and Android deployments only. Please open a pull request to support other platforms.

## Usage

Create a workflow `.yml` file in your `.github/workflows` directory. Example workflows are available in this repository. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).
Create workflows in your `.github/workflows` directory. Examples are available in this repository. For more information, see the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).

## Workflows
*Note:* Although this Flutter project works as-is, consider tailoring these workflows to your needs. If you're starting from scratch, copying and pasting will work as long as you follow the [GitHub flow](https://guides.github.com/introduction/flow/) and [release based workflow](https://lab.github.com/githubtraining/create-a-release-based-workflow).

All workflows use the [Ensure SHA Pinned Actions](https://github.com/marketplace/actions/ensure-sha-pinned-actions) action to ensure security hardening.
### Workflows

_Note:_ The [Get the Flutter Version Environment](https://github.com/marketplace/actions/get-the-flutter-version-environment) action requires that the [`pubspec.yaml`](pubspec.yaml) file contains an `environment:flutter:` key. This is used for installing Flutter in the workflows.
- All of the workflows here use the [Ensure SHA Pinned Actions](https://github.com/marketplace/actions/ensure-sha-pinned-actions) action to ensure security hardening.
- The [Get the Flutter Version Environment](https://github.com/marketplace/actions/get-the-flutter-version-environment) action requires that the [`pubspec.yaml`](pubspec.yaml) file contains an `environment:flutter:` key, which is used for installing Flutter with the correct version.

### Continuous Integration
#### Continuous Integration
[![CI](https://github.com/zgosalvez/github-actions-flutter-workflow/workflows/CI/badge.svg)](https://github.com/zgosalvez/github-actions-flutter-workflow/actions?query=workflow%3ACI)

[`.github/workflows/ci.yml`](workflows/ci.yml)

Also known as CI, Continuous Integration runs Flutter static and dynamic tests on every pull request to `main`, then the coverage report is stored as an artifact for reference. Modify the workflow to further process the code coverage file using [code quality](https://github.com/marketplace?type=actions) or [code review](https://github.com/marketplace?category=code-review&type=actions) actions.
Also known as CI, Continuous Integration runs Flutter static and dynamic tests on *every pull request* to `main` and `release/v*`, then the coverage report is stored as an artifact for reference. A comment is added to the pull request on every run as seen here, https://github.com/zgosalvez/github-actions-flutter-workflows/pull/9#issuecomment-750863281. Modify the workflow to further process the code coverage file using [code quality](https://github.com/marketplace?type=actions) or [code review](https://github.com/marketplace?category=code-review&type=actions) actions.

### Continuous Delivery
#### Continuous Delivery
[![CDelivery](https://github.com/zgosalvez/github-actions-flutter-workflow/workflows/CDelivery/badge.svg)](https://github.com/zgosalvez/github-actions-flutter-workflow/actions?query=workflow%3ACDelivery)

[`.github/workflows/cdelivery.yml`](workflows/cdelivery.yml)

Also known as CDelivery (not to be mistaken with another CD, Continuous Deployment), Continuous Delivery reruns the same Flutter static and dynamic tests from the CI on every push to `main`, then a pre-release draft is created. Manually, remove the pre-release mark after it has been deployed and released to the app store.
Also known as CDelivery (not to be mistaken with another CD, i.e., Continuous Deployment), Continuous Delivery reruns the same Flutter static and dynamic tests from the CI on *every push* to `main` and `release/v*`, then a pre-release draft is created or updated. This ensures that the protected branches are bug-free and drafted release is updated. Manually remove the pre-release mark after it has been deployed and released to the app store.

*Note:* Since CDelivery reruns the `testing` job from CI, it will cost you additional runner minutes. If you are conscious of your budget and [require branches to be up to date before merging](https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/enabling-required-status-checks#:~:text=Require%20branches%20to%20be%20up%20to%20date%20before%20merging), you should comment the job out.

### Deployment
#### Deployment
[![Deployment](https://github.com/zgosalvez/github-actions-flutter-workflow/workflows/Deployment/badge.svg)](https://github.com/zgosalvez/github-actions-flutter-workflow/actions?query=workflow%3ADeployment)

[`.github/workflows/deployment.yml`](workflows/deployment.yml)

Deployment is triggered when the release draft is published. It reruns the same Flutter static and dynamic tests from the CI before running Flutter's build commands. The app version used is based on the release tag, not the name. Lastly, build artifacts are uploaded as release assets.
Deployment is triggered when the release draft (or any release) is published. It reruns the same Flutter static and dynamic tests from the CI before running Flutter's build commands. The app version used is based on the release tag, not the name. Lastly, build artifacts are uploaded as release assets.

## License
The scripts and documentation in this project are released under the [MIT License](LICENSE)
4 changes: 3 additions & 1 deletion .github/workflows/cdelivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: CDelivery

on:
push:
branches: [ main ]
branches:
- main
- release/v*

jobs:
security_hardening:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: CI

on:
pull_request:
branches: [ main ]
branches:
- main
- release/v*

jobs:
security_hardening:
Expand Down

0 comments on commit 9bd8128

Please sign in to comment.