Skip to content

feat: get current permission #590

feat: get current permission

feat: get current permission #590

Workflow file for this run

name: Runnable (stable)
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: 'adopt'
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 . -o none --set-exit-if-changed
- 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: Generate docs
run: |
dart pub global activate dartdoc
dart pub global run dartdoc .
publishable:
if: github.repository == 'fluttercandies/flutter_photo_manager'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
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
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- 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: 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:
java-version: '17'
distribution: 'adopt'
- 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:
java-version: '17'
distribution: 'adopt'
- 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: 'adopt'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
architecture: x64
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