Skip to content

Commit

Permalink
Add docs, adjust installation for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
wrbl606 committed Mar 18, 2024
1 parent 4e0028e commit 6248138
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 2 deletions.
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2024 Marcin Wróblewski

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
98 changes: 98 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Flutter SDK for GitHub Actions

[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](.)
<img src="./doc/assets/monterail_logo.svg" alt="Monterail's logo" width="25%" align="right"/>

Flutter and Dart in your GitHub Actions. Use effortlessly in your project, inspire yourself with our [Recipes](#recipes).

## Installation

Copy and paste the following snippet into your action's `.yml` file.

```yaml
- name: Install Flutter
uses: monterail/flutter-action@v1
```
## Usage
With Flutter SDK for GitHub Actions you can do the following:
```yaml
steps:
- uses: monterail/flutter-action@v1
- run: flutter build ...
```
### Action arguments
`monterail/flutter-action@v1` provides sane defaults, assuming the default usage is to get the newest, production-ready, Flutter SDK. For more complex use-cases, customize the action with the non-standard inputs.

| Name | Description | Default |
| --- | --- | --- |
| `channel` | Flutter [channel](https://github.com/flutter/flutter/wiki/Flutter-build-release-channels) | `stable` |

## Recipes

List of practical applications of `monterail/flutter-action@v1` for your project. Click the `Details` dropdown to see the implementation.

### Assure code quality standard for each PR

Will check (and annotate, if necessary) code quality and formatting guidelines set in `analysis_options.yaml`. Once code quality is checked, will run tests.

<details>

```yaml
name: Lint and Test PRs
on:
pull_request:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: monterail/flutter-action@v1
- run: flutter pub get
- uses: invertase/github-action-dart-analyzer@v3
with:
annotate: true
- run: dart format --set-exit-if-changed --output none
- run: flutter test
```

</details>

### Build web project artifact on each `main` push

Load project's dependencies and build web app into a `.zip` file, stored as an artifact for the given commit.

<details>

```yaml
name: Build web app
on:
push:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: monterail/flutter-action@v1
- run: flutter pub get
- run: flutter build web
- uses: actions/upload-artifact@v4
with:
name: web-app
path: build/web
```

</details>
7 changes: 7 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Handling Security Vulnerabilities

In order to maintain responsible disclosure practices, we request that you do not submit security vulnerabilities or pull requests on GitHub, as this information could be exploited by malicious actors. We recommend that you report any security vulnerabilities directly to our security team via email at:

[[email protected]]([email protected])

Our team will review your report and take appropriate action to address the issue.
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: 'Install Flutter SDK'
description: 'Make dart and flutter CLI available for your action'
description: 'Dart and Flutter CLIs available for your GitHub Action'
author: 'Marcin Wróblewski'
branding:
color: 'white'
icon: 'download'
inputs:
channel:
description: 'Desired Flutter channel'
Expand Down
1 change: 1 addition & 0 deletions doc/assets/monterail_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion install-flutter-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ git clone -b "$CHANNEL" https://github.com/flutter/flutter.git "$FLUTTER_PATH"
echo "$FLUTTER_PATH/bin"
echo "$FLUTTER_PATH/bin/cache/dart-sdk/bin"
echo "$HOME/.pub-cache/bin" # POSIX
echo "C:\Users\runneradmin\AppData\Local\Pub\Cache\bin" # Windows
echo "$LOCALAPPDATA\Pub\Cache\bin" # Windows
} >> "$GITHUB_PATH"

0 comments on commit 6248138

Please sign in to comment.