From 3555b2d37847342f7317399e262bbdfd081bace6 Mon Sep 17 00:00:00 2001 From: Arthur Jamet <60505370+Arthi-chaud@users.noreply.github.com> Date: Thu, 20 Jan 2022 17:40:58 +0100 Subject: [PATCH] Mobile client: Build & Release workflows (#11) --- .github/workflows/build.yml | 38 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 35 ++++++++++++++++++++++++++++++++ mobile/pubspec.lock | 2 +- mobile/pubspec.yaml | 2 +- 4 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1170025 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,38 @@ +name: Build + +on: + push: + branches: + - master + - dev + workflow_dispatch: + +jobs: + build_mobile_apk: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./mobile + steps: + - uses: actions/checkout@v2 + - uses: subosito/flutter-action@v2.2.0 + with: + channel: 'dev' + - name: Get Flutter dependencies + run: flutter upgrade ; flutter pub get + - name: Build APK - Release + if: github.ref == 'refs/heads/master' + run: | + flutter build apk lib/src/main.dart + mv ./build/app/outputs/flutter-apk/app-profile.apk aeris_android.apk + - name: Build APK - Debug + if: github.ref != 'refs/heads/master' + run: | + flutter build apk lib/src/main.dart --profile + mv ./build/app/outputs/flutter-apk/app-profile.apk aeris_android.apk + - name: Upload build artifact + if: github.ref == 'refs/head/master' + uses: actions/upload-artifact@v2 + with: + name: aeris_apk + path: mobile/aeris_android.apk \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b74b15d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Release + +on: + create: + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Wait for builds & tests to finish + uses: lewagon/wait-on-check-action@master + with: + ref: ${{github.ref}} + repo-token: ${{secrets.GITHUB_TOKEN}} + running-workflow-name: release + allowed-conclusions: success,skipped,cancelled,neutral + - name: Download artifacts + uses: dawidd6/action-download-artifact@v2 + with: + commit: ${{env.COMMIT_SHA}} + workflow: build.yml + github_token: ${{secrets.GITHUB_TOKEN}} + - name: "Build Changelog" + id: build_changelog + uses: mikepenz/release-changelog-builder-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: aeris_apk/aeris_android.apk + body: ${{steps.github_release.outputs.changelog}} \ No newline at end of file diff --git a/mobile/pubspec.lock b/mobile/pubspec.lock index 4f41b93..6040021 100644 --- a/mobile/pubspec.lock +++ b/mobile/pubspec.lock @@ -171,4 +171,4 @@ packages: source: hosted version: "2.1.1" sdks: - dart: ">=2.16.0-154.0.dev <3.0.0" + dart: ">=2.16.0-134.0.dev <3.0.0" diff --git a/mobile/pubspec.yaml b/mobile/pubspec.yaml index 859e61b..19d8ab6 100644 --- a/mobile/pubspec.yaml +++ b/mobile/pubspec.yaml @@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=2.16.0-154.0.dev <3.0.0" + sdk: ">=2.16.0-134.0.dev <3.0.0" # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions