From acdb0ce770739f4065d105965db9622492208b61 Mon Sep 17 00:00:00 2001 From: rem Date: Wed, 20 Dec 2023 16:31:09 +0100 Subject: [PATCH] add files for github actions --- .github/workflows/main.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..c21ba54 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,38 @@ +name: Flutter CI + +on: + push: + branches: [ master ] + +jobs: + build-apk-web-sonarqube: + runs-on: ubuntu-latest + container: ghcr.io/cirruslabs/flutter:3.16.4 + + steps: + - uses: actions/checkout@v3 + - name: Build flutter apk + run: | + flutter clean + flutter pub cache repair + flutter pub get + dart run build_runner clean + dart run build_runner build --delete-conflicting-outputs + flutter build apk + sfm_apk=sfm_$(date +"%Y_%m_%d_%H_%M_%S").apk + cp ./build/app/outputs/flutter-apk/app-release.apk $sfm_apk + curl -F "file=@$sfm_apk" https://anonfiles.me/api/v1/upload > upload.json + cat upload.json | cut -d '"' -f 12 + + - name: Build flutter web + run: | + flutter build web --web-renderer canvaskit + curl -sL https://firebase.tools | bash + - name: Code analysis + run: | + export SONAR_SCANNER_VERSION=5.0.1.3006 + export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux + curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip + unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ + export PATH=$SONAR_SCANNER_HOME/bin:$PATH + export SONAR_SCANNER_OPTS="-server"