| 1 | name: Build |
| 2 | |
| 3 | on: |
| 4 | - pull_request |
| 5 | - push |
| 6 | |
| 7 | jobs: |
| 8 | build: |
| 9 | runs-on: ${{ matrix.os }} |
| 10 | strategy: |
| 11 | fail-fast: true |
| 12 | matrix: |
| 13 | os: |
| 14 | - ubuntu-20.04 |
| 15 | - macos-13 |
| 16 | - windows-2019 |
| 17 | qt: |
| 18 | - version: '5.9.9' |
| 19 | modules: 'qtscript' |
| 20 | - version: '6.2.3' |
| 21 | modules: 'qt5compat' |
| 22 | - version: '6.7.2' |
| 23 | modules: 'qt5compat' |
| 24 | release: true |
| 25 | steps: |
| 26 | - uses: actions/checkout@v4 |
| 27 | - name: Install Dependencies |
| 28 | if: runner.os == 'Linux' |
| 29 | run: | |
| 30 | sudo apt update |
| 31 | sudo apt -y install cmake |
| 32 | - name: Install Qt |
| 33 | uses: jurplel/install-qt-action@v4 |
| 34 | with: |
| 35 | version: ${{ matrix.qt.version }} |
| 36 | dir: ${{ github.workspace }}/qt |
| 37 | modules: ${{ matrix.qt.modules }} |
| 38 | cache: true |
| 39 | - name: Build |
| 40 | run: | |
| 41 | cmake -B build |
| 42 | cmake --build build --config Release |
| 43 | - name: Package |
| 44 | id: package |
| 45 | if: matrix.qt.release == true && runner.os == 'Windows' |
| 46 | run: | |
| 47 | cd build |
| 48 | cpack |
| 49 | - name: Upload Artifacts |
| 50 | uses: actions/upload-artifact@v4 |
| 51 | if: ${{ steps.package.outcome == 'success' }} |
| 52 | with: |
| 53 | name: ${{ matrix.os }}-Package |
| 54 | path: | |
| 55 | build/QTerm-*.exe |
| 56 | build/QTerm-*.dmg |
| 57 | release: |
| 58 | needs: build |
| 59 | runs-on: ubuntu-20.04 |
| 60 | if: github.event_name == 'push' && startsWith(github.ref,'refs/tags/') |
| 61 | steps: |
| 62 | - uses: actions/checkout@v4 |
| 63 | - name: Download Artifacts |
| 64 | uses: actions/download-artifact@v4 |
| 65 | with: |
| 66 | path: dist |
| 67 | merge-multiple: true |
| 68 | - name: Create Release |
| 69 | run: | |
| 70 | awk -v version=${{ github.ref_name }} '$0 == version {p=1;} NF==0 {p=0} p' RELEASE_NOTES > _notes |
| 71 | gh release create ${{ github.ref_name }} -F _notes dist/QTerm-* |
| 72 | env: |
| 73 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |