Adding flutter to deploy step #36
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
name: Publish package to pub.dev | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+*" | |
jobs: | |
build_example: | |
name: Build Example App | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: true | |
matrix: | |
platform: | |
- apk | |
- ios | |
os: | |
- ubuntu-latest | |
- macos-latest | |
exclude: | |
# Skip build combinations where Android is attempted to build on MacOS | |
# and iOS attempt to build on Ubuntu. | |
- os: macos-latest | |
platform: apk | |
- os: ubuntu-latest | |
platform: ios | |
# TODO(Dennis): iOS builds aren't properly configured yet. Fix and | |
# uncomment this exclusion | |
# https://github.com/oddbit/flutter_facebook_app_events/actions/runs/3365684172/jobs/5581387481 | |
- platform: ios | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
cache: true | |
- run: flutter --version | |
- run: flutter pub get | |
- name: Configure iOS build environment | |
if: matrix.platform == 'ios' | |
run: | | |
echo "FLUTTER_EXTRA_PARAMS=--no-codesign" >> $GITHUB_ENV | |
- name: Activate iOS Pods Cache | |
uses: actions/cache@v4 | |
if: matrix.platform == 'ios' | |
with: | |
path: example/ios/Pods | |
key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }} | |
restore-keys: ${{ runner.os }}-pods- | |
- run: flutter doctor | |
- name: Build Flutter | |
working-directory: ./example | |
run: >- | |
flutter | |
build ${{ matrix.platform }} | |
${{ env.FLUTTER_EXTRA_PARAMS }} | |
- name: Build iOS IPA with Fastlane | |
if: matrix.platform == 'ios' | |
uses: maierj/[email protected] | |
with: | |
lane: ${{ env.FASTLANE_BUILD_LANE }} | |
subdirectory: "ios" | |
publish: | |
name: Publish Plugin | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
needs: build_example | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dart-lang/setup-dart@v1 | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
cache: true | |
- run: flutter --version | |
- run: flutter pub get | |
- name: Publish package | |
run: flutter pub publish --force |