Version 3.5.1 #40
Workflow file for this run
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 GitHub actions runs on a release, when it is published, created or edited. | |
# - Installs Dart and flutter | |
# - Uses Flutter beta channel for now. | |
# - Enables Flutter web | |
# - Gets package dependencies | |
# - Runs dart analyze, allows deprecation warnings. | |
# - Show outdated packages, just added for info. | |
# - Verify that dart format is used by all committed code, fails if not. | |
# Controversial but pub.dev penalizes you if dart format is not used. | |
# - Run all tests with coverage. | |
# - Upload code coverage output to Codecov for analysis. | |
# - Build the WEB demo app for FlexColorPicker. | |
# - Flutter clean. | |
# - Flutter build web app, in release mode and with CanvasKit renderer. | |
# - Deploy the Web example to GitHub pages. | |
name: Deploy Web | |
on: | |
push: | |
branches: [none] | |
paths-ignore: | |
- "**.md" | |
release: | |
types: [published] | |
# Edit and add other trigger options if an extra new Web deployment is needed. | |
# Generally I only need a new deployment when I publish a new release, but I may want to trigger it on defaults: | |
# prerelease or just an edit sometimes to test the workflow or a new build irl, these trigger types can be used then: | |
# types: [published, created, edited, prereleased] | |
jobs: | |
tests_build_deploy: | |
name: Analyze, test build and deploy the web demo | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Flutter and Dart SDK | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
- name: Show Dart SDK version | |
run: dart --version | |
- name: Show Flutter SDK version | |
run: flutter --version | |
- name: Flutter Enable Web | |
run: flutter config --enable-web | |
- name: Install Flutter package dependencies | |
run: flutter pub get | |
- name: Analyze Dart source | |
run: dart analyze | |
- name: Show outdated packages | |
run: flutter pub outdated | |
- name: Verify that Dart formatting is used, fail if not | |
run: dart format --output=none --set-exit-if-changed . | |
- name: Test package FlexColorPicker using test coverage | |
run: flutter test --coverage | |
- name: Upload test coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: coverage/lcov.info | |
# Default Example - Make a test web build of it too, not deployed. | |
- name: DEFAULT EXAMPLE START BUILD - Flutter clean before build | |
run: flutter clean && cd example && flutter clean | |
- name: EXAMPLE WEB release build using CanvasKit | |
run: cd example && flutter build web --web-renderer=canvaskit --release --target=lib/main.dart | |
# Web Build and deploy | |
- name: WEB EXAMPLE START BUILD - Flutter clean before build | |
run: flutter clean && cd example && flutter clean | |
- name: WEB EXAMPLE release build using CanvasKit | |
run: cd example && flutter build web --web-renderer=canvaskit --base-href "/flexcolorpicker/" --release --target=lib/demo/main.dart | |
- name: WEB EXAMPLE DEPLOY to GitHub Pages repository, published on commit. | |
uses: dmnemec/copy_file_to_another_repo_action@v1.0.4 | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | |
with: | |
source_file: 'example/build/web/.' | |
destination_folder: 'flexcolorpicker' | |
destination_repo: 'rydmike/rydmike.github.io' | |
user_email: 'm.rydstrom@gmail.com' | |
user_name: 'rydmike' |