From 730b254e49b17595563d4f41d0aa54063cc4ef15 Mon Sep 17 00:00:00 2001 From: zmtzawqlp Date: Thu, 17 Aug 2023 22:03:04 +0800 Subject: [PATCH] update publish.yml --- .github/workflows/checker.yml | 19 ------ .github/workflows/pub_dry_run.yml | 19 ------ .github/workflows/pub_publish.yml | 21 ------ .github/workflows/pub_publish_manually.yml | 19 ------ .github/workflows/publish.yml | 19 ++++++ .github/workflows/publishable.yml | 26 +++++++ .github/workflows/runnable.yml | 79 ++++++++++++++++++++++ 7 files changed, 124 insertions(+), 78 deletions(-) delete mode 100644 .github/workflows/checker.yml delete mode 100644 .github/workflows/pub_dry_run.yml delete mode 100644 .github/workflows/pub_publish.yml delete mode 100644 .github/workflows/pub_publish_manually.yml create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/publishable.yml create mode 100644 .github/workflows/runnable.yml diff --git a/.github/workflows/checker.yml b/.github/workflows/checker.yml deleted file mode 100644 index f1c81ff..0000000 --- a/.github/workflows/checker.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: No Free usage issue checker - -on: - issues: - types: [opened, reopened] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Check issue actor - uses: ./ - with: - repo: $GITHUB_REPOSITORY - user: $GITHUB_ACTOR - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/pub_dry_run.yml b/.github/workflows/pub_dry_run.yml deleted file mode 100644 index 7b49e74..0000000 --- a/.github/workflows/pub_dry_run.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Pub Publish dry run - -on: [push] - -jobs: - publish: - - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v1 - - name: Publish - uses: sakebook/actions-flutter-pub-publisher@v1.3.0 - with: - credential: ${{ secrets.CREDENTIAL_JSON }} - flutter_package: true - skip_test: true - dry_run: true diff --git a/.github/workflows/pub_publish.yml b/.github/workflows/pub_publish.yml deleted file mode 100644 index 6dd65b1..0000000 --- a/.github/workflows/pub_publish.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Pub Publish plugin - -on: - release: - types: [published] - -jobs: - publish: - - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v1 - - name: Publish - uses: sakebook/actions-flutter-pub-publisher@v1.3.0 - with: - credential: ${{ secrets.CREDENTIAL_JSON }} - flutter_package: true - skip_test: true - dry_run: false diff --git a/.github/workflows/pub_publish_manually.yml b/.github/workflows/pub_publish_manually.yml deleted file mode 100644 index 6d60ac8..0000000 --- a/.github/workflows/pub_publish_manually.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Pub Publish plugin - -on: workflow_dispatch - -jobs: - publish: - - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v1 - - name: Publish - uses: sakebook/actions-flutter-pub-publisher@v1.3.0 - with: - credential: ${{ secrets.CREDENTIAL_JSON }} - flutter_package: true - skip_test: true - dry_run: false diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..4d0474e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,19 @@ +name: Publish + +on: + release: + types: [ published ] + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Publish + uses: k-paxian/dart-package-publisher@master + with: + credentialJson: ${{ secrets.CREDENTIAL_JSON }} + flutter: true + skipTests: true \ No newline at end of file diff --git a/.github/workflows/publishable.yml b/.github/workflows/publishable.yml new file mode 100644 index 0000000..8786a9d --- /dev/null +++ b/.github/workflows/publishable.yml @@ -0,0 +1,26 @@ +name: Publishable + +on: + push: + branches: + - main + pull_request: + branches: + - main + paths: + - "**.md" + - "**.yaml" + - "**.yml" + +jobs: + publish-dry-run: + name: Publish dry-run with packages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: k-paxian/dart-package-publisher@master + with: + credentialJson: 'MockCredentialJson' + flutter: true + dryRunOnly: true + skipTests: true \ No newline at end of file diff --git a/.github/workflows/runnable.yml b/.github/workflows/runnable.yml new file mode 100644 index 0000000..c3abfbd --- /dev/null +++ b/.github/workflows/runnable.yml @@ -0,0 +1,79 @@ +name: Runnable (stable) + +on: + push: + branches: + - main + 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@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: '11.x' + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + - name: Log Dart/Flutter versions + run: | + dart --version + flutter --version + - name: Prepare dependencies + run: flutter pub get + - name: Analyse the repo + run: flutter analyze lib example/lib + - name: Run tests + run: flutter test + - name: Generate docs + run: | + dart pub global activate dartdoc + dart pub global run dartdoc . + + test_iOS: + needs: analyze + name: Test iOS + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: '11.x' + - uses: subosito/flutter-action@v2.8.0 + with: + channel: stable + - run: dart --version + - run: flutter --version + - run: flutter pub get + - run: cd example; flutter build ios --no-codesign + + test_android: + needs: analyze + name: Test Android + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: '11.x' + - uses: subosito/flutter-action@v2.8.0 + with: + channel: stable + - run: dart --version + - run: flutter --version + - run: flutter pub get + - run: sudo echo "y" | sudo $ANDROID_HOME/tools/bin/sdkmanager "ndk;21.4.7075529" + - run: cd example; flutter build apk --debug \ No newline at end of file