-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
128 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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%" height="100" 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. Test the recipe by putting it into `.github/workflows/action.yml` file in your project's repository. | ||
|
||
### 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
||
[services@monterail.com](services@monterail.com) | ||
|
||
Our team will review your report and take appropriate action to address the issue. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
#!/bin/bash | ||
|
||
CHANNEL="stable" | ||
while getopts 'v:' param; do | ||
while getopts 'v:c:' param; do | ||
case $param in | ||
v) CHANNEL="$OPTARG" ;; | ||
c) CHANNEL="$OPTARG" ;; | ||
esac | ||
done | ||
|
||
if [ -z "$CHANNEL" ]; then | ||
|
||
FLUTTER_PATH="$GITHUB_ACTION_PATH/flutter" | ||
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" | ||
echo "$HOME/.pub-cache/bin" # POSIX | ||
echo "$LOCALAPPDATA\Pub\Cache\bin" # Windows | ||
} >> "$GITHUB_PATH" |