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@v3 - 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@v3 - uses: subosito/flutter-action@v2 with: flutter-version: ${{ needs.setup.outputs.flutter_version }} channel: 'stable' cache: true - name: Pub dependency cache uses: actions/cache@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@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@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@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@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@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@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_x86_64: name: Linux x86_64 runs-on: ubuntu-22.04 needs: setup steps: - name: Checkout uses: actions/checkout@v3 - uses: subosito/flutter-action@v2 with: flutter-version: ${{ needs.setup.outputs.flutter_version }} channel: 'stable' cache: true - name: Pub dependency cache uses: actions/cache@v3 with: path: ${{ env.PUB_CACHE }} key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} restore-keys: | ${{ runner.os }}-pub- - name: Install dependencies run: | sudo apt-get install \ -y --no-install-recommends \ clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev \ libappindicator3-dev - name: Build run: cd packages/app && flutter build linux --build-number="${{ needs.setup.outputs.build_number }}" - uses: actions/upload-artifact@v3 with: name: Linux x86_64 path: packages/app/build/linux/x64/release/bundle/* if-no-files-found: error linux_arm64: name: Linux arm64 runs-on: ubuntu-22.04 needs: setup steps: - name: Checkout uses: actions/checkout@v3 - name: Set docker image id: docker_image run: | echo "local=nextcloud-neon-build-linux-arm64:${{ needs.setup.outputs.flutter_version }}" >> $GITHUB_OUTPUT echo "remote=ghcr.io/$GITHUB_REPOSITORY/build-linux-arm64:${{ needs.setup.outputs.flutter_version }}" >> $GITHUB_OUTPUT - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin - name: Set up QEMU uses: docker/setup-qemu-action@v2 with: platforms: arm64 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 with: platforms: linux/arm64 - name: Build env: FLUTTER_VERSION: ${{ needs.setup.outputs.flutter_version }} run: ./tool/build-app.sh linux/arm64 --build-number="${{ needs.setup.outputs.build_number }}" - uses: actions/upload-artifact@v3 with: name: Linux arm64 path: packages/app/build/linux/arm64/release/bundle/* if-no-files-found: error