fix tree shaking #150
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PUSH on develop (Test Flutter & Build Android & Deploy Android internal) | |
on: | |
push: | |
branches: | |
- develop | |
paths-ignore: | |
- ".github/**" | |
- ".vscode/**" | |
- "releases/**" | |
- "test/**" | |
- "ios/**" | |
- "web/**" | |
- "**/README.md" | |
- "**/GitVersion.yml" | |
workflow_dispatch: null | |
jobs: | |
test: | |
name: flutter test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: "temurin" | |
java-version: ${{ vars.JAVA_VERSION }} | |
- name: Setup Dart | |
uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: ${{ vars.DART_VERSION }} | |
- run: dart --version | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
- run: flutter --version | |
- run: flutter pub get | |
- name: Verify formatting | |
run: dart format --output=none --set-exit-if-changed . | |
- run: flutter analyze | |
- run: flutter test | |
build: | |
name: Build Android | |
needs: [test] | |
runs-on: ubuntu-latest | |
outputs: | |
releaseversion: ${{ steps.version.outputs.version }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Lesen der aktuellen Version aus der pubspec.yaml | |
id: get_version | |
run: | | |
VERSION=$(grep "version:" pubspec.yaml | awk '{print $2}') | |
echo "currentVersion=$VERSION" >> $GITHUB_OUTPUT | |
echo "Die aaktuelle Version ist $VERSION" | |
- name: Set new version of app | |
id: version | |
run: | | |
VERSION=${{steps.get_version.outputs.currentVersion}} | |
VERSION_WITHOUT_PLUS="${VERSION%%+*}" | |
GITHUB_RUN_NUMBER=${{ github.run_number }} | |
sed -i "/version:/c version: $VERSION_WITHOUT_PLUS+$GITHUB_RUN_NUMBER" pubspec.yaml | |
echo "Die neue Version ist $VERSION_WITHOUT_PLUS+$GITHUB_RUN_NUMBER" | |
echo "version=$VERSION_WITHOUT_PLUS+$GITHUB_RUN_NUMBER" >> $GITHUB_OUTPUT | |
- name: Write version to Summary | |
run: | | |
echo "### Version: ${{ steps.version.outputs.version }}" >> $GITHUB_STEP_SUMMARY | |
- name: Make envfile | |
uses: SpicyPizza/[email protected] | |
with: | |
envkey_WIREDASH_SECRET: ${{ secrets.PROD_WIREDASH_SECRET }} # ignore error | |
envkey_WIREDASH_PROJECT_ID: ${{ secrets.PROD_WIREDASH_PROJECT_ID }} # ignore error | |
envkey_GEOAPIFY_KEY: ${{ secrets.GEOAPIFY_KEY }} # ignore error | |
- name: Setup java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "temurin" | |
java-version: ${{ vars.JAVA_VERSION }} | |
- uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: ${{ vars.DART_VERSION }} | |
- run: dart --version | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
- run: dart --version | |
- run: flutter pub get | |
- name: Build aab | |
run: flutter build appbundle --obfuscate --split-debug-info=build/app/outputs/symbols | |
id: | |
build_aab | |
# Build Android App Bundle which by default will be stored in the | |
# ./build/app/outputs/bundle/release as app-release.aab | |
- name: Sign App Bundle | |
uses: r0adkll/sign-android-release@v1 | |
id: sign_app | |
with: | |
releaseDirectory: build/app/outputs/bundle/release/ | |
signingKeyBase64: ${{ secrets.ANDROID_KEYSTORE }} | |
alias: ${{ secrets.ANDROID_SIGNING_KEY_ALIAS }} | |
keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} | |
- name: Upload Signed App Bundle | |
uses: actions/upload-artifact@v3 | |
with: | |
name: signed-app-bundle | |
path: build/app/outputs/bundle/release/app-release.aab | |
deploy: | |
name: Deploy Android | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v3 | |
id: download-signed-app | |
with: | |
name: signed-app-bundle | |
- name: Upload to Play Store (Internal Testing) | |
uses: r0adkll/upload-google-play@v1 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT_JSON }} | |
packageName: de.jlange.nami.app | |
releaseFiles: app-release.aab | |
releaseName: ${{ needs.build.outputs.releaseversion }} | |
track: internal |