From 4154d5fc2371b004349900bf6f43332d7730d0fe Mon Sep 17 00:00:00 2001 From: Barabas Raffai Date: Sat, 24 Sep 2022 14:48:34 +0100 Subject: [PATCH 01/10] Add GitHub Actions workflow for linux frontend --- .github/workflows/main.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 84e359d0..bdf9b9ca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -290,6 +290,44 @@ jobs: parallel: true flag-name: "flutter" + flutter-linux-release: + needs: [flutter-analyze, flutter-format, flutter-test] + name: Relase frontend for Linux + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Install flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + channel: ${{ env.FLUTTER_CHANNEL }} + cache: true + cache-key: ${{ github.job }} + + - name: Flutter pub cache + uses: actions/cache@v2 + with: + path: ${{ env.PUB_CACHE }} + key: flutter-pub-${{ github.job }}-${{ hashFiles('**/pubspec.lock') }} + restore-keys: | + flutter-pub-${{ github.job }}- + + - run: flutter pub get + + - name: Generate code + run: flutter pub run build_runner build + + - name: Build + run: flutter build linux + + - uses: actions/upload-artifact@v3 + with: + name: frontend-linux + path: build/linux/x64/release/bundle + coveralls-finish: needs: [flutter-test, ctest] runs-on: ubuntu-latest From a98bcc4f81e7ce304bffe73ca344ddee9745b046 Mon Sep 17 00:00:00 2001 From: Barabas Raffai Date: Sat, 24 Sep 2022 14:58:09 +0100 Subject: [PATCH 02/10] Fix working directory --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bdf9b9ca..cf679cd9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -294,6 +294,10 @@ jobs: needs: [flutter-analyze, flutter-format, flutter-test] name: Relase frontend for Linux runs-on: ubuntu-latest + defaults: + run: + working-directory: + frontend steps: - uses: actions/checkout@v2 with: From 7cdf54e57f9207afcba98122842d7a412b87fa61 Mon Sep 17 00:00:00 2001 From: Barabas Raffai Date: Sat, 24 Sep 2022 17:11:56 +0100 Subject: [PATCH 03/10] Fix flutter build setup --- .github/workflows/main.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cf679cd9..8135778b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -311,6 +311,13 @@ jobs: cache: true cache-key: ${{ github.job }} + - name: Install flutter dependencies + run: | + flutter doctor -v + sudo apt-get update -y + sudo apt-get install -y ninja-build libgtk-3-dev + flutter doctor -v + - name: Flutter pub cache uses: actions/cache@v2 with: From 962e8f2d5597ca5ce2607f94658b24d81d302a6f Mon Sep 17 00:00:00 2001 From: Barabas Raffai Date: Sat, 24 Sep 2022 17:22:31 +0100 Subject: [PATCH 04/10] Disable ccache for flutter release build --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8135778b..e610825e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -294,6 +294,9 @@ jobs: needs: [flutter-analyze, flutter-format, flutter-test] name: Relase frontend for Linux runs-on: ubuntu-latest + env: + CMAKE_C_COMPILER_LAUNCHER: "" + CMAKE_CXX_COMPILER_LAUNCHER: "" defaults: run: working-directory: From 2f2f7cd0e3e2d0ed6514f38fe6e330a11a32de8d Mon Sep 17 00:00:00 2001 From: Barabas Raffai Date: Sat, 24 Sep 2022 17:40:58 +0100 Subject: [PATCH 05/10] Add debug code for build folder --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e610825e..bd008768 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -316,7 +316,6 @@ jobs: - name: Install flutter dependencies run: | - flutter doctor -v sudo apt-get update -y sudo apt-get install -y ninja-build libgtk-3-dev flutter doctor -v @@ -337,6 +336,9 @@ jobs: - name: Build run: flutter build linux + - name: Debug build folder + run: ls -R build + - uses: actions/upload-artifact@v3 with: name: frontend-linux From e399d6803af842f85e5eb7aae078df1755aba2c7 Mon Sep 17 00:00:00 2001 From: Barabas Raffai Date: Sat, 24 Sep 2022 17:51:06 +0100 Subject: [PATCH 06/10] Fix flutter build path for artefact --- .github/workflows/main.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bd008768..0bcc8483 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -336,13 +336,10 @@ jobs: - name: Build run: flutter build linux - - name: Debug build folder - run: ls -R build - - uses: actions/upload-artifact@v3 with: name: frontend-linux - path: build/linux/x64/release/bundle + path: frontend/build/linux/x64/release/bundle coveralls-finish: needs: [flutter-test, ctest] From 4c2e1ca79c1a3e81f07ae07614dcdbf1969b149a Mon Sep 17 00:00:00 2001 From: Barabas Raffai Date: Sun, 25 Sep 2022 11:47:08 +0100 Subject: [PATCH 07/10] Configure AppImage for packaging --- .github/workflows/main.yml | 12 ++++++-- frontend/.gitignore | 5 ++++ frontend/AppImageBuilder.yml | 57 ++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 frontend/AppImageBuilder.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0bcc8483..8b008ef5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -336,10 +336,18 @@ jobs: - name: Build run: flutter build linux + - name: Create AppImage + uses: docker://appimagecrafters/appimage-builder:1.1.0 + with: + entrypoint: appimage-builder + args: --recipe ./AppImageBuilder.yml --skip-test + + - run: ls -la + - uses: actions/upload-artifact@v3 with: - name: frontend-linux - path: frontend/build/linux/x64/release/bundle + name: frontend-appimage + path: frontend/ShrapnelDSP-latest-x86_64.AppImage coveralls-finish: needs: [flutter-test, ctest] diff --git a/frontend/.gitignore b/frontend/.gitignore index 8d93255f..68007bee 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -46,3 +46,8 @@ app.*.map.json /android/app/debug /android/app/profile /android/app/release + +# AppImage +*.AppImage* +AppDir +appimage-build diff --git a/frontend/AppImageBuilder.yml b/frontend/AppImageBuilder.yml new file mode 100644 index 00000000..7b4493da --- /dev/null +++ b/frontend/AppImageBuilder.yml @@ -0,0 +1,57 @@ +# appimage-builder recipe see https://appimage-builder.readthedocs.io for details +version: 1 +script: + - rm -rf AppDir || true + - cp -r build/linux/x64/release/bundle AppDir + - mkdir -p AppDir/usr/share/icons + - cp web/icons/Icon-192.png AppDir/usr/share/icons +AppDir: + path: ./AppDir + app_info: + id: com.example.app + name: ShrapnelDSP + icon: Icon-192 + version: latest + exec: shrapnel + exec_args: $@ + apt: + arch: + - amd64 + allow_unauthenticated: true + sources: + - sourceline: deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse + - sourceline: deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse + - sourceline: deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse + - sourceline: deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse + include: + - libgtk-3-0 + - libwayland-client0 + - libwayland-cursor0 + - libwayland-egl1 + files: + include: [] + exclude: + - usr/share/man + - usr/share/doc/*/README.* + - usr/share/doc/*/changelog.* + - usr/share/doc/*/NEWS.* + - usr/share/doc/*/TODO.* + test: + fedora-30: + image: appimagecrafters/tests-env:fedora-30 + command: ./AppRun + debian-stable: + image: appimagecrafters/tests-env:debian-stable + command: ./AppRun + archlinux-latest: + image: appimagecrafters/tests-env:archlinux-latest + command: ./AppRun + centos-7: + image: appimagecrafters/tests-env:centos-7 + command: ./AppRun + ubuntu-xenial: + image: appimagecrafters/tests-env:ubuntu-xenial + command: ./AppRun +AppImage: + arch: x86_64 + update-information: guess From 415b77eb496f73639d91ce36a741bcd02a1f1881 Mon Sep 17 00:00:00 2001 From: Barabas Raffai Date: Sun, 25 Sep 2022 11:55:23 +0100 Subject: [PATCH 08/10] Fix paths --- .github/workflows/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8b008ef5..47b740a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -291,7 +291,7 @@ jobs: flag-name: "flutter" flutter-linux-release: - needs: [flutter-analyze, flutter-format, flutter-test] + #needs: [flutter-analyze, flutter-format, flutter-test] name: Relase frontend for Linux runs-on: ubuntu-latest env: @@ -340,14 +340,15 @@ jobs: uses: docker://appimagecrafters/appimage-builder:1.1.0 with: entrypoint: appimage-builder - args: --recipe ./AppImageBuilder.yml --skip-test + args: --recipe frontend/AppImageBuilder.yml --skip-test - run: ls -la + - run: ls -la frontend - uses: actions/upload-artifact@v3 with: name: frontend-appimage - path: frontend/ShrapnelDSP-latest-x86_64.AppImage + path: ShrapnelDSP-latest-x86_64.AppImage coveralls-finish: needs: [flutter-test, ctest] From aa4feae16fe14f167150483f3d241155eea992d0 Mon Sep 17 00:00:00 2001 From: Barabas Raffai Date: Sun, 25 Sep 2022 12:04:43 +0100 Subject: [PATCH 09/10] Update paths --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 47b740a4..78b5aa79 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -339,8 +339,8 @@ jobs: - name: Create AppImage uses: docker://appimagecrafters/appimage-builder:1.1.0 with: - entrypoint: appimage-builder - args: --recipe frontend/AppImageBuilder.yml --skip-test + entrypoint: bash + args: cd frontend; appimage-builder --recipe AppImageBuilder.yml --skip-test - run: ls -la - run: ls -la frontend @@ -348,7 +348,7 @@ jobs: - uses: actions/upload-artifact@v3 with: name: frontend-appimage - path: ShrapnelDSP-latest-x86_64.AppImage + path: frontend/ShrapnelDSP-latest-x86_64.AppImage coveralls-finish: needs: [flutter-test, ctest] From 1f5e0aeaa1b7ae3d49bff6847f0af33389c46e88 Mon Sep 17 00:00:00 2001 From: Barabas Raffai Date: Sun, 25 Sep 2022 12:16:37 +0100 Subject: [PATCH 10/10] Fix syntax --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 78b5aa79..51c973ff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -340,7 +340,7 @@ jobs: uses: docker://appimagecrafters/appimage-builder:1.1.0 with: entrypoint: bash - args: cd frontend; appimage-builder --recipe AppImageBuilder.yml --skip-test + args: "-c 'cd frontend; appimage-builder --recipe AppImageBuilder.yml --skip-test'" - run: ls -la - run: ls -la frontend