From a67a8fad209887d0f691d7f01fe23bbff1bdc370 Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Sat, 4 May 2024 15:33:38 +0000 Subject: [PATCH] feature/ci-deploy (#1) Reviewed-on: https://git.kluster.moll.re/remoll/fast-network-navigation/pulls/1 --- .drone.yml | 25 +++++++++++++++++++ .gitea/workflows/build-android.yaml | 38 ++++++++++++++++++++++------- .gitea/workflows/build-web.yaml | 21 ++++++++++++++++ 3 files changed, 75 insertions(+), 9 deletions(-) create mode 100644 .drone.yml create mode 100644 .gitea/workflows/build-web.yaml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..1ea50ce --- /dev/null +++ b/.drone.yml @@ -0,0 +1,25 @@ +kind: pipeline +type: kubernetes +name: build-apk + +clone: + depth: 1 + +steps: + - name: build + image: cirrusci/flutter:stable + pull: true + commands: + - flutter packages get + - flutter build apk --release --split-per-abi + - mkdir apks + - mv build/app/outputs/apk/*/*/*.apk apks + + - name: Publish APK + image: plugins/gitea-release + settings: + api_key: + from_secret: GITEA_TOKEN +trigger: + event: + - push \ No newline at end of file diff --git a/.gitea/workflows/build-android.yaml b/.gitea/workflows/build-android.yaml index d5b55e3..76305b1 100644 --- a/.gitea/workflows/build-android.yaml +++ b/.gitea/workflows/build-android.yaml @@ -5,18 +5,38 @@ jobs: name: Build APK runs-on: k8s steps: - - uses: https://github.com/actions/checkout@v1 - - uses: https://github.com/actions/setup-java@v1 + + - name: Install prerequisites + run: | + sudo apt-get update + sudo apt-get install -y xz-utils unzip + - uses: https://gitea.com/actions/checkout@v4 + + - uses: https://github.com/actions/setup-java@v4 with: - java-version: '12.x' - - uses: https://github.com/subosito/flutter-action@v1 + java-version: '17' + distribution: 'zulu' + + - uses: https://github.com/subosito/flutter-action@v2 with: - flutter-version: '1.7.8+hotfix.4' + channel: stable + flutter-version: 3.19.6 + cache: true + - name: Setup Android SDK + uses: https://github.com/android-actions/setup-android@v3 + - run: flutter pub get # - run: flutter test - run: flutter build apk --debug --split-per-abi - - name: Push APK to Releases - uses: https://github.com/ncipollo/release-action@v1 + + - name: Release APK + uses: https://gitea.com/akkuman/gitea-release-action@v1 with: - artifacts: "build/app/outputs/apk/debug/*.apk" - token: ${{ secrets.TOKEN }} \ No newline at end of file + files: build/app/outputs/flutter-apk/*.apk + tag: testing + release_name: Testing release + release_body: "This is a testing release." + prerelease: true + token: ${{ secrets.GITEA_TOKEN }} + env: + NODE_OPTIONS: '--experimental-fetch' diff --git a/.gitea/workflows/build-web.yaml b/.gitea/workflows/build-web.yaml new file mode 100644 index 0000000..cc08a5e --- /dev/null +++ b/.gitea/workflows/build-web.yaml @@ -0,0 +1,21 @@ +on: push +name: Test, Build and Release web +jobs: + build: + name: Build Web + runs-on: k8s + steps: + - name: Install prerequisites + run: | + sudo apt-get update + sudo apt-get install -y xz-utils + + - uses: actions/checkout@v4 + - uses: https://github.com/subosito/flutter-action@v2 + with: + channel: stable + flutter-version: 3.19.6 + cache: true + - run: flutter pub get + # - run: flutter test +