190 lines
5.1 KiB
YAML
190 lines
5.1 KiB
YAML
name: Flutter build
|
|
|
|
on:
|
|
push:
|
|
branches: [ yiffed ]
|
|
|
|
jobs:
|
|
analyze:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Get apt deps
|
|
run: |
|
|
sudo apt-get update > /dev/null
|
|
sudo apt-get -y install --no-install-recommends openssl axel lcov gcc g++ ninja-build
|
|
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v1.3.2
|
|
with:
|
|
channel: beta
|
|
|
|
- name: Check formatting
|
|
run: flutter format lib/ test/ test_driver/ --set-exit-if-changed
|
|
|
|
- name: Analyze code
|
|
run: flutter analyze
|
|
|
|
|
|
deploy-web:
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: analyze
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Get apt deps
|
|
run: |
|
|
sudo apt-get update > /dev/null
|
|
sudo apt-get -y install --no-install-recommends openssl axel lcov gcc g++ ninja-build
|
|
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v1.3.2
|
|
with:
|
|
channel: beta
|
|
|
|
- name: Prepare env
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install curl -y
|
|
rm -r assets/js/package
|
|
cd assets/js/ && curl -L 'https://gitlab.com/famedly/libraries/olm/-/jobs/artifacts/master/download?job=build_js' > olm.zip && cd ../../
|
|
cd assets/js/ && unzip olm.zip && cd ../../
|
|
cd assets/js/ && rm olm.zip && cd ../../
|
|
cd assets/js/ && mv javascript package && cd ../../
|
|
cd web/ && rm sql-wasm.js sql-wasm.wasm && cd ../
|
|
cd web/ && curl -L 'https://github.com/sql-js/sql.js/releases/latest/download/sqljs-wasm.zip' > sqljs-wasm.zip && cd ../
|
|
cd web/ && unzip sqljs-wasm.zip && cd ../
|
|
cd web/ && rm sqljs-wasm.zip && cd ../
|
|
flutter clean
|
|
|
|
- name: Configure Flutter
|
|
run: flutter config --enable-web && flutter doctor
|
|
|
|
- run: flutter pub get
|
|
|
|
- name: Build web release
|
|
run: flutter build web --release --verbose
|
|
|
|
- name: Add CNAME
|
|
run: cd build/web/ && echo "chat.inex.dev" > CNAME && cd ../..
|
|
|
|
- name: Deploy to GitHub Pages
|
|
uses: crazy-max/ghaction-github-pages@v2
|
|
with:
|
|
target_branch: gh-pages
|
|
build_dir: build/web/
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
build-android-apk:
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: analyze
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Get apt deps
|
|
run: |
|
|
sudo apt-get update > /dev/null
|
|
sudo apt-get -y install --no-install-recommends openssl axel lcov gcc g++ ninja-build
|
|
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v1.3.2
|
|
with:
|
|
channel: beta
|
|
|
|
- name: Set up secrets
|
|
env:
|
|
SIGN_KEY: ${{ secrets.SIGN_KEY }}
|
|
SIGN_KEY_PASS: ${{ secrets.SIGN_KEY_PASS }}
|
|
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }}
|
|
run: |
|
|
cd android && echo $SIGN_KEY | base64 --decode --ignore-garbage > key.jks && cd ..
|
|
cd android && echo "storePassword=${SIGN_KEY_PASS}" >> key.properties && cd ..
|
|
cd android && echo "keyPassword=${SIGN_KEY_PASS}" >> key.properties && cd ..
|
|
cd android && echo "keyAlias=key" >> key.properties && cd ..
|
|
cd android && echo "storeFile=../key.jks" >> key.properties && cd ..
|
|
cd android/app && echo $GOOGLE_SERVICES >> google-services.json && cd ../..
|
|
|
|
- name: Get Flutter deps
|
|
run: flutter pub get
|
|
|
|
- name: Build release apk
|
|
run: |
|
|
flutter build apk --release
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: FurryChat-Android
|
|
path: build/app/outputs/apk/release/app-release.apk
|
|
|
|
build-linux:
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: analyze
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Get apt deps
|
|
run: |
|
|
sudo apt-get update > /dev/null
|
|
sudo apt-get -y install --no-install-recommends openssl axel lcov gcc g++ ninja-build clang cmake pkg-config libgtk-3-dev libblkid-dev tar
|
|
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v1.3.2
|
|
with:
|
|
channel: dev
|
|
|
|
- name: Get Flutter deps
|
|
run: |
|
|
flutter config --enable-linux-desktop
|
|
flutter pub get
|
|
|
|
- name: Build release package
|
|
run: |
|
|
flutter build linux --release
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: FurryChat-Linux
|
|
path: build/linux/release/bundle/
|
|
|
|
build-windows:
|
|
runs-on: windows-latest
|
|
|
|
needs: analyze
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Get choco deps
|
|
run: |
|
|
choco install git -y
|
|
choco install visualstudio2019community -y --package-parameters "--add Microsoft.VisualStudio.Product.BuildTools --includeRecommended --includeOptional --passive --locale en-US"
|
|
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v1.3.2
|
|
with:
|
|
channel: dev
|
|
|
|
- name: Get Flutter deps
|
|
run: |
|
|
flutter config --enable-windows-desktop
|
|
flutter pub get
|
|
|
|
- name: Build release package
|
|
run: |
|
|
flutter build windows --release
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: FurryChat-Windows
|
|
path: build/windows/runner/Release/
|