From 63dee0c2f5e3756caaf1d8f2d599ba6643e71f67 Mon Sep 17 00:00:00 2001 From: xiaoweii Date: Thu, 26 Oct 2023 12:31:44 +0800 Subject: [PATCH] feat: add build-android and build-ios action --- .github/workflows/build-android.yml | 25 +++++++++++++++++++++++++ .github/workflows/build-ios.yml | 22 ++++++++++++++++++++++ .github/workflows/build.yml | 17 ----------------- example/pubspec.yaml | 1 + 4 files changed, 48 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/build-android.yml create mode 100644 .github/workflows/build-ios.yml delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml new file mode 100644 index 0000000..917cc5a --- /dev/null +++ b/.github/workflows/build-android.yml @@ -0,0 +1,25 @@ +name: Flutter SDK Build for Android + +on: + push: + branches: [ "*" ] + pull_request: + branches: [ "main" ] + +jobs: + build-android: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v2 + with: + distribution: 'corretto' + java-version: '11' + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + - name: Run build apk + run: | + flutter pub get + cd example + flutter build apk diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml new file mode 100644 index 0000000..888a1eb --- /dev/null +++ b/.github/workflows/build-ios.yml @@ -0,0 +1,22 @@ +name: Flutter SDK Build for iOS + +on: + push: + branches: [ "*" ] + pull_request: + branches: [ "main" ] + +jobs: + build-ios: + runs-on: macos-13-xl + steps: + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + architecture: x64 + - name: Run build ios + run: | + flutter pub get + cd example + flutter build ios --release --no-codesign diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 4dd7061..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Flutter SDK Build - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - code-build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Run build - run: | - cd example - flutter build apk diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 3305679..1d49a74 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -3,6 +3,7 @@ description: Demonstrates how to use the clickstream_flutter plugin. # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev +version: 1.0.0+1 environment: sdk: '>=3.1.3 <4.0.0'