Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
martijn00 committed Aug 1, 2024
1 parent 873c7fe commit 74bf184
Show file tree
Hide file tree
Showing 14 changed files with 214 additions and 486 deletions.
153 changes: 117 additions & 36 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ name: build
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the develop branch
on:
workflow_dispatch:

push:
branches: [ develop, master ]
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
branches: [develop, main]
pull_request:
branches: [ develop ]
branches: [develop]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -22,12 +26,15 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# Make sure the stable version of Flutter is available
- uses: subosito/flutter-action@v1
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
architecture: x64
cache: true

# Download all Flutter packages
- name: Download dependencies
Expand All @@ -51,12 +58,15 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# Make sure the stable version of Flutter is available
- uses: subosito/flutter-action@v1
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
architecture: x64
cache: true

# Download all Flutter packages
- name: Download dependencies
Expand All @@ -81,17 +91,21 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# Ensure correct JAVA version is installed.
- uses: actions/setup-java@v1
- uses: actions/setup-java@v4
with:
java-version: '12.x'
distribution: "zulu"
java-version: "17"

# Make sure the stable version of Flutter is available
- uses: subosito/flutter-action@v1
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
architecture: x64
cache: true

# Download all Flutter packages
- name: Download dependencies
Expand All @@ -116,12 +130,15 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# Make sure the stable version of Flutter is available
- uses: subosito/flutter-action@v1
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
architecture: x64
cache: true

# Download all Flutter packages
- name: Download dependencies
Expand All @@ -146,12 +163,15 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# Make sure the stable version of Flutter is available
- uses: subosito/flutter-action@v1
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
architecture: x64
cache: true

# Enable platform support
- name: Enable macOS
Expand Down Expand Up @@ -181,12 +201,15 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# Make sure the stable version of Flutter is available
- uses: subosito/flutter-action@v1
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
architecture: x64
cache: true

# Enable platform support
- name: Enable Windows
Expand Down Expand Up @@ -220,12 +243,15 @@ jobs:
- run: sudo apt-get install -y ninja-build libgtk-3-dev libblkid-dev

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# Make sure the stable version of Flutter is available
- uses: subosito/flutter-action@v1
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
architecture: x64
cache: true

# Enable platform support
- name: Enable Linux
Expand Down Expand Up @@ -260,12 +286,15 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# Make sure the stable version of Flutter is available
- uses: subosito/flutter-action@v1
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
architecture: x64
cache: true

# Download all Flutter packages
- name: Download dependencies
Expand All @@ -288,12 +317,15 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# Make sure the stable version of Flutter is available
- uses: subosito/flutter-action@v1
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: "stable"
architecture: x64
cache: true

# Download all Flutter packages
- name: Download dependencies
Expand All @@ -305,9 +337,58 @@ jobs:
run: flutter test --coverage
working-directory: ${{env.source-directory}}

# Upload code coverage information
- uses: codecov/codecov-action@v1
# # Upload code coverage information
# - uses: codecov/codecov-action@v4
# with:
# file: ${{env.source-directory}}/coverage/lcov.info # optional
# name: OctoImage # optional
# fail_ci_if_error: true

publish:
if: ${{ github.ref_type == 'tag' }}
name: Publish
permissions:
id-token: write
needs:
[
format,
analyze,
tests,
build_android,
build_ios,
build_macOS,
build_windows,
build_linux,
build_web,
]
# The type of runner that the job will run on
runs-on: ubuntu-latest

env:
source-directory: .

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

- name: Set up Dart
uses: dart-lang/setup-dart@v1

# Make sure the stable version of Flutter is available
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
file: ${{env.source-directory}}/coverage/lcov.info # optional
name: OctoImage # optional
fail_ci_if_error: true
channel: "stable"
architecture: x64
cache: true

# Download all Flutter packages
- name: Download dependencies
run: flutter pub get
working-directory: ${{env.source-directory}}

# Publish the package
- name: Publish package
run: dart pub publish -v -f
working-directory: ${{env.source-directory}}
Loading

0 comments on commit 74bf184

Please sign in to comment.