Skip to content

Prepare for v3.8.2 release #896

Prepare for v3.8.2 release

Prepare for v3.8.2 release #896

Workflow file for this run

name: Runnable (stable)
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
paths-ignore:
- "**.md"
pull_request:
branches:
- main
paths-ignore:
- "**.md"
jobs:
analyze:
name: Analyze on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- name: Log Dart/Flutter versions
run: |
dart --version
flutter --version
- run: flutter doctor -v
- name: Prepare dependencies
run: flutter pub get
- name: Check Dart code formatting
run: |
dart format . --output=write
git --no-pager diff --exit-code .
- name: Analyze lib
run: flutter analyze lib
- name: Analyze example
run: flutter analyze example
# - name: Analyze example_ohos
# run: flutter analyze example_ohos
- name: Run tests
run: flutter test
- name: Dry run docs generate
run: dart doc --dry-run .
continue-on-error: true
publishable:
if: github.repository == 'fluttercandies/flutter_photo_manager'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- run: flutter doctor -v
- name: Prepare dependencies
run: flutter pub get
- name: Copy before dry run
run: |
chmod +x ./copy_on_publish.sh
./copy_on_publish.sh
- name: Publish dry run
uses: k-paxian/dart-package-publisher@master
with:
credentialJson: "MockCredentialJson"
accessToken: "MockAccessToken"
refreshToken: "MockRefreshToken"
flutter: true
dryRunOnly: true
test_android:
needs: analyze
name: Test Android build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
permissions:
pull-requests: write
issues: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- run: flutter doctor -v
- run: flutter pub get
- run: flutter build apk --release
name: Build apk
working-directory: ${{ github.workspace }}/example
- name: Run Android unit tests
run: ./gradlew photo_manager:test
working-directory: ${{ github.workspace }}/example/android
- name: Upload artifact
uses: actions/upload-artifact@v4
id: apk
with:
if-no-files-found: error
path: ${{ github.workspace }}/example/build/app/outputs/flutter-apk/app-release.apk
name: app-release-${{github.sha}}.apk
- name: comment url in pull request
uses: actions/github-script@v4
if: github.event_name == 'pull_request'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Download apk from [here](${{ steps.apk.outputs.artifact-url }}) for ${{ github.sha}}'
})
test_android_on_windows:
needs: analyze
name: Test Android build on windows
runs-on: windows-latest
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- run: flutter doctor -v
- run: flutter pub get
- run: cd example; flutter build apk --debug
test_android_on_macos:
needs: analyze
name: Test Android build on macOS
runs-on: macos-latest
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- run: flutter doctor -v
- run: flutter pub get
- run: cd example; flutter build apk --debug
test_darwin:
needs: analyze
name: Test Darwin build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- uses: flutter-actions/setup-flutter@v4
with:
channel: 'stable'
cache: true
- run: flutter doctor -v
- run: flutter pub get
- run: cd example; flutter build ios --no-codesign
- run: cd example; flutter build macos --debug
# With Swift Package Manager
- run: flutter config --enable-swift-package-manager
- run: flutter pub get
- run: cd example; flutter build ios --no-codesign
- run: cd example; flutter build macos --debug