From d552640d58a44b6a336dcd657160cc3754601515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zi=C4=85bek?= Date: Mon, 14 Oct 2024 09:54:15 +0200 Subject: [PATCH] Create build.yml --- .github/workflows/build.yml | 74 +++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..f81c105 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,74 @@ +name: QuestPDF Companion Build + +on: + workflow_dispatch: + + +jobs: + main: + name: ${{ matrix.runtime.name }} + runs-on: ${{ matrix.runtime.runs-on }} + container: ${{ matrix.runtime.container }} + + strategy: + fail-fast: false + matrix: + runtime: + - name: windows + runs-on: windows-latest + - name: linux + runs-on: ubuntu-latest + container: ubuntu:20.04 + # - name: macos (run locally) + # runs-on: macos-latest-xlarge + + steps: + - uses: actions/checkout@v3 + + - name: Set timezone configuration to non-interactive + if: matrix.runtime.name == 'linux' + run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata + env: + TZ: "America/New_York" + + - name: Install linux dependencies + if: matrix.runtime.name == 'linux' + run: apt-get update && apt-get install -y jq curl xz-utils git ninja-build libgtk-3-dev cmake clang + + - name: Install appdmg + if: matrix.runtime.name == 'macos' + run: npm install -g appdmg + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: '3.x' + channel: 'stable' + + - name: Fix Flutter on Linux + if: matrix.runtime.name == 'linux' + run: git config --global --add safe.directory '*' + + - name: Get Dependencies + run: flutter pub get + + - name: Activate Packaging Tool + run: dart pub global activate flutter_distributor + + - name: Make windows/exe + if: matrix.runtime.name == 'windows' + run: flutter_distributor package --platform=windows --targets=exe + + - name: Make linux/deb + if: matrix.runtime.name == 'linux' + run: flutter_distributor package --platform=linux --targets=deb + + - name: Make macos-arm64/dmg + if: matrix.runtime.name == 'macos' + run: flutter_distributor package --platform=macos --targets=dmg + + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: questpdf-companion-build + path: dist