Skip to content

Commit

Permalink
feat: add flutter_version options for the github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
freekvandeven committed May 15, 2024
1 parent b0ca095 commit 216ce57
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 19 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/app-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ on:
description: 'Additional commands to be run after flutter pub get'
required: false
default: ''

flutter_version:
description: "Optional Flutter Version"
required: false
type: string
env:
DOTENV_BASE64: ${{ secrets.DOTENV_BASE64 }}

Expand All @@ -28,9 +31,19 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- name: Flutter install specific version
if: inputs.flutter_version != ''
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
cache-key: ${{ runner.OS }}-flutter-install-cache
flutter-version: ${{ inputs.flutter_version }}
- name: Flutter install stable version
if: inputs.flutter_version == ''
uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
cache: true
cache-key: ${{ runner.OS }}-flutter-install-cache
- name: Run additional commands
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/component-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ on:
description: 'Additional commands to be run after flutter pub get'
required: false
default: ''

flutter_version:
description: "Optional Flutter Version"
required: false
type: string
jobs:
lint:
defaults:
Expand All @@ -26,9 +29,19 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- name: Flutter install specific version
if: inputs.flutter_version != ''
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
cache-key: ${{ runner.OS }}-flutter-install-cache
flutter-version: ${{ inputs.flutter_version }}
- name: Flutter install stable version
if: inputs.flutter_version == ''
uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
cache: true
cache-key: ${{ runner.OS }}-flutter-install-cache
- name: Run additional commands
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/firebase-android-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ on:
description: "Additional commands to be run after flutter pub get"
required: false
default: ""
flutter_version:
description: "Optional Flutter Version"
required: false
type: string
env:
ANDROID_APP: ${{ vars.ANDROID_APP }}
DOTENV_BASE64: ${{ secrets[inputs.dotenv_override || 'DOTENV_BASE64'] }}
Expand All @@ -46,10 +50,19 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Flutter
- name: Flutter install specific version
if: inputs.flutter_version != ''
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
cache-key: ${{ runner.OS }}-flutter-install-cache
flutter-version: ${{ inputs.flutter_version }}
- name: Flutter install stable version
if: inputs.flutter_version == ''
uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
cache: true
cache-key: ${{ runner.OS }}-flutter-install-cache

Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/firebase-ios-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ on:
description: "Additional commands to be run after flutter pub get"
required: false
default: ""
flutter_version:
description: "Optional Flutter Version"
required: false
type: string

env:
IOS_APP: ${{ vars.IOS_APP }}
Expand All @@ -52,10 +56,19 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Flutter
- name: Flutter install specific version
if: inputs.flutter_version != ''
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
cache-key: ${{ runner.OS }}-flutter-install-cache
flutter-version: ${{ inputs.flutter_version }}
- name: Flutter install stable version
if: inputs.flutter_version == ''
uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
cache: true
cache-key: ${{ runner.OS }}-flutter-install-cache

Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/firebase-web-cd.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Iconica Standard App CI Action
name: Build and Deploy Web app to Firebase hosting

# Workflow version: 5.0.0
# Workflow version: 6.0.0

# https://docs.github.com/en/actions/using-workflows/reusing-workflows
on:
Expand Down Expand Up @@ -33,6 +33,10 @@ on:
description: "Optional dotenv Override"
required: false
type: string
flutter_version:
description: "Optional Flutter Version"
required: false
type: string

env:
PROJECT_ID: ${{ vars.PROJECT_ID }}
Expand All @@ -48,7 +52,17 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- name: Flutter install specific version
if: inputs.flutter_version != ''
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
cache-key: ${{ runner.OS }}-flutter-install-cache
flutter-version: ${{ inputs.flutter_version }}
- name: Flutter install stable version
if: inputs.flutter_version == ''
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/flutter-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ on:
description: 'Subfolder where the Flutter project is located'
required: false
default: '.'

flutter_version:
description: "Optional Flutter Version"
required: false
type: string
jobs:
lint:
defaults:
Expand All @@ -21,9 +24,19 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- name: Flutter install specific version
if: inputs.flutter_version != ''
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
cache-key: ${{ runner.OS }}-flutter-install-cache
flutter-version: ${{ inputs.flutter_version }}
- name: Flutter install stable version
if: inputs.flutter_version == ''
uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
cache: true
cache-key: ${{ runner.OS }}-flutter-install-cache
- name: Project preparation
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/melos-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
description: 'Additional commands to be run after flutter pub get'
required: false
default: ''
flutter_version:
description: "Optional Flutter Version"
required: false
type: string

env:
DOTENV_BASE64: ${{ secrets.DOTENV_BASE64 }}
Expand All @@ -28,9 +32,19 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- name: Flutter install specific version
if: inputs.flutter_version != ''
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
cache-key: ${{ runner.OS }}-flutter-install-cache
flutter-version: ${{ inputs.flutter_version }}
- name: Flutter install stable version
if: inputs.flutter_version == ''
uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
cache: true
cache-key: ${{ runner.OS }}-flutter-install-cache
- name: Project preparation
Expand Down
2 changes: 1 addition & 1 deletion profile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Each Starter Workflow calls a workflow inside this repository so Workflows can b
| component-ci | 2.0.0 | [component-ci.yml](./workflow-templates/component-ci.yml) | This Workflow runs the standard steps for Iconica Components before approval can be given on a Pull Request |
| melos-ci | 1.0.0 | [melos-ci.yml](./workflow-templates/melos-ci.yml) | This Workflow runs the standard steps for Iconica Melos Packages before approval can be given on a Pull Request |
| flutter-cache | 2.0.0 | [flutter-cache.yml](./workflow-templates/flutter-cache.yml) | This Workflow runs a caching action on master and development branch to ensure better cache reuse |
| firebase-web-cd | 5.0.0 | [firebase-web-cd.yml](./workflow-templates/firebase-web-cd.yml) | This workflow runs a Flutter build for web and deploys it to Firebase Hosting (on pull requests and pushes to master). Configuring this action is done through ```firebase init hosting:github``` |
| firebase-web-cd | 6.0.0 | [firebase-web-cd.yml](./workflow-templates/firebase-web-cd.yml) | This workflow runs a Flutter build for web and deploys it to Firebase Hosting (on pull requests and pushes to master). Configuring this action is done through ```firebase init hosting:github``` |
app-firebase-cd | 1.0.0 | [app-firebase-cd.yml](./workflow-templates/app-firebase-cd.yml) | This workflow gives the user the option to build Flutter apps for both Android and iOS (on dispatch) and distribute the builds to Firebase. Before using this workflow, the repository implementing it requires some configuration. This is necessary to sign the iOS app. The configuration steps can be found in [this manual](./.github/workflows/manuals/firebase-ios-cd.md). |
component-documentation | 1.0.0 | [component-documentation.yml](./workflow-templates/component-documentation.yml) | This Workflow runs a action that triggers the component documentation te be updated. |

Expand Down

0 comments on commit 216ce57

Please sign in to comment.