|
| 1 | +name: QuestPDF Companion Build |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | + |
| 7 | +jobs: |
| 8 | + main: |
| 9 | + name: ${{ matrix.runtime.name }} |
| 10 | + runs-on: ${{ matrix.runtime.runs-on }} |
| 11 | + container: ${{ matrix.runtime.container }} |
| 12 | + |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + runtime: |
| 17 | + - name: windows |
| 18 | + runs-on: windows-latest |
| 19 | + - name: linux |
| 20 | + runs-on: ubuntu-latest |
| 21 | + container: ubuntu:20.04 |
| 22 | + # - name: macos (run locally) |
| 23 | + # runs-on: macos-latest-xlarge |
| 24 | + |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v3 |
| 27 | + |
| 28 | + - name: Set timezone configuration to non-interactive |
| 29 | + if: matrix.runtime.name == 'linux' |
| 30 | + run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata |
| 31 | + env: |
| 32 | + TZ: "America/New_York" |
| 33 | + |
| 34 | + - name: Install linux dependencies |
| 35 | + if: matrix.runtime.name == 'linux' |
| 36 | + run: apt-get update && apt-get install -y jq curl xz-utils git ninja-build libgtk-3-dev cmake clang |
| 37 | + |
| 38 | + - name: Install appdmg |
| 39 | + if: matrix.runtime.name == 'macos' |
| 40 | + run: npm install -g appdmg |
| 41 | + |
| 42 | + - name: Setup Flutter |
| 43 | + uses: subosito/flutter-action@v2 |
| 44 | + with: |
| 45 | + flutter-version: '3.x' |
| 46 | + channel: 'stable' |
| 47 | + |
| 48 | + - name: Fix Flutter on Linux |
| 49 | + if: matrix.runtime.name == 'linux' |
| 50 | + run: git config --global --add safe.directory '*' |
| 51 | + |
| 52 | + - name: Get Dependencies |
| 53 | + run: flutter pub get |
| 54 | + |
| 55 | + - name: Activate Packaging Tool |
| 56 | + run: dart pub global activate flutter_distributor |
| 57 | + |
| 58 | + - name: Make windows/exe |
| 59 | + if: matrix.runtime.name == 'windows' |
| 60 | + run: flutter_distributor package --platform=windows --targets=exe |
| 61 | + |
| 62 | + - name: Make linux/deb |
| 63 | + if: matrix.runtime.name == 'linux' |
| 64 | + run: flutter_distributor package --platform=linux --targets=deb |
| 65 | + |
| 66 | + - name: Make macos-arm64/dmg |
| 67 | + if: matrix.runtime.name == 'macos' |
| 68 | + run: flutter_distributor package --platform=macos --targets=dmg |
| 69 | + |
| 70 | + - name: Archive production artifacts |
| 71 | + uses: actions/upload-artifact@v3 |
| 72 | + with: |
| 73 | + name: questpdf-companion-build |
| 74 | + path: dist |
0 commit comments