name: Publish on: push: branches: - main concurrency: group: publish cancel-in-progress: true env: PUB_CACHE: ~/.pub-cache jobs: setup: name: Setup runs-on: ubuntu-22.04 outputs: flutter_version: ${{ steps.flutter_version.outputs.FLUTTER_VERSION }} build_number: ${{ steps.build_number.outputs.BUILD_NUMBER }} steps: - name: Checkout uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 - name: Set flutter version id: flutter_version run: echo "FLUTTER_VERSION=$(jq ".flutterSdkVersion" -r < .fvm/fvm_config.json | cut -d "@" -f 1)" >> $GITHUB_OUTPUT - name: Set build number id: build_number run: echo "BUILD_NUMBER=$(date +"%s")" >> $GITHUB_OUTPUT android: name: Android runs-on: ubuntu-22.04 needs: setup steps: - name: Checkout uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # v2 with: flutter-version: ${{ needs.setup.outputs.flutter_version }} channel: 'stable' cache: true - name: Pub dependency cache uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 with: path: ${{ env.PUB_CACHE }} key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} restore-keys: | ${{ runner.os }}-pub- - name: Gradle dependency cache uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 with: path: | ~/.gradle/caches ~/.gradle/wrapper key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: | ${{ runner.os }}-gradle- - name: Set up JDK 11 uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3 with: distribution: 'adopt' java-version: 11 - name: Build run: cd packages/app && flutter build apk --split-per-abi --build-number="${{ needs.setup.outputs.build_number }}" - uses: ilharp/sign-android-release@2034987c31e3959f7c97e88d5e656e52e6e88bd8 # v1 name: Sign with: releaseDir: packages/app/build/app/outputs/flutter-apk signingKey: ${{ secrets.SIGNING_KEY }} keyAlias: ${{ secrets.ALIAS }} keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} keyPassword: ${{ secrets.KEY_PASSWORD }} - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 with: name: Android arm64-v8a path: packages/app/build/app/outputs/flutter-apk/app-arm64-v8a-release-signed.apk if-no-files-found: error - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 with: name: Android armeabi-v7a path: packages/app/build/app/outputs/flutter-apk/app-armeabi-v7a-release-signed.apk if-no-files-found: error - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 with: name: Android x86_64 path: packages/app/build/app/outputs/flutter-apk/app-x86_64-release-signed.apk if-no-files-found: error - name: F-Droid nightly run: | cp packages/app/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk app-arm64-v8a-debug.apk cp packages/app/build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk app-armeabi-v7a-debug.apk cp packages/app/build/app/outputs/flutter-apk/app-x86_64-release.apk app-x86_64-debug.apk sudo add-apt-repository ppa:fdroid/fdroidserver sudo apt-get update sudo apt-get install apksigner fdroidserver python3-pip --no-install-recommends sudo apt-get purge fdroidserver pip3 install https://gitlab.com/fdroid/fdroidserver/-/archive/master/fdroidserver.tar.gz export DEBUG_KEYSTORE=${{ secrets.DEBUG_KEYSTORE }} GITHUB_REPOSITORY=provokateurin/nextcloud-neon fdroid nightly -v --archive-older 10 linux: name: Linux ${{ matrix.architecture.flutter }} runs-on: ubuntu-22.04 needs: setup permissions: packages: write strategy: matrix: architecture: - docker: amd64 flutter: x64 - docker: arm64 flutter: arm64 steps: - name: Checkout uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 - name: Login to GHCR uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Set up QEMU uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3 with: platforms: ${{ matrix.architecture.docker }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3 with: platforms: linux/${{ matrix.architecture.docker }} - name: Build env: FLUTTER_VERSION: ${{ needs.setup.outputs.flutter_version }} run: ./tool/build-app.sh linux/${{ matrix.architecture.docker }} --build-number="${{ needs.setup.outputs.build_number }}" - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 with: name: Linux ${{ matrix.architecture.flutter }} path: packages/app/build/linux/${{ matrix.architecture.flutter }}/release/bundle/* if-no-files-found: error