diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ebb7d96 --- /dev/null +++ b/LICENSE @@ -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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..e5a2f38 --- /dev/null +++ b/README.md @@ -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)](.) +Monterail's logo + +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. + +
+ +```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 +``` + +
+ +### 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. + +
+ +```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 +``` + +
diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..af79231 --- /dev/null +++ b/SECURITY.md @@ -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: + +[services@monterail.com](services@monterail.com) + +Our team will review your report and take appropriate action to address the issue. diff --git a/action.yml b/action.yml index 74f25e2..a85291b 100644 --- a/action.yml +++ b/action.yml @@ -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' diff --git a/doc/assets/monterail_logo.svg b/doc/assets/monterail_logo.svg new file mode 100644 index 0000000..7dedfe6 --- /dev/null +++ b/doc/assets/monterail_logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/install-flutter-sdk.sh b/install-flutter-sdk.sh index a1408ab..380b3d6 100644 --- a/install-flutter-sdk.sh +++ b/install-flutter-sdk.sh @@ -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"