|
| 1 | +name: Linux Build |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + paths-ignore: |
| 8 | + - .github/workflows/docker.yml |
| 9 | + - .github/workflows/windows.yml |
| 10 | + pull_request: |
| 11 | + branches: |
| 12 | + - main |
| 13 | + paths-ignore: |
| 14 | + - .github/workflows/docker.yml |
| 15 | + - .github/workflows/windows.yml |
| 16 | + |
| 17 | +jobs: |
| 18 | + build: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + name: build (${{ matrix.config.name }}) |
| 21 | + strategy: |
| 22 | + # needs to be set; reduce if github is cancelling jobs |
| 23 | + max-parallel: 2 |
| 24 | + matrix: |
| 25 | + config: |
| 26 | + - name: "AppImage" |
| 27 | + container: "ghcr.io/scrubbbbs/appimage:latest" |
| 28 | + submodules: false |
| 29 | + deps: "" |
| 30 | + cmake_flags: "" |
| 31 | + env: "" |
| 32 | + |
| 33 | + container: |
| 34 | + image: ${{ matrix.config.container }} |
| 35 | + credentials: |
| 36 | + username: ${{ github.actor }} |
| 37 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 38 | + |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v4 |
| 41 | + with: |
| 42 | + ref: ${{ github.event.pull_request.head.sha }} |
| 43 | + |
| 44 | + - name: Allow unsafe git in container |
| 45 | + run: git config --global --add safe.directory ${GITHUB_WORKSPACE} |
| 46 | + |
| 47 | + - name: Checkout submodules |
| 48 | + if: matrix.config.submodules |
| 49 | + run: | |
| 50 | + git submodule init |
| 51 | + git submodule update |
| 52 | +
|
| 53 | + #- name: Install build dependencies |
| 54 | + # run: | |
| 55 | + # sudo apt-get update |
| 56 | + |
| 57 | + - name: Configure |
| 58 | + shell: bash |
| 59 | + run: | |
| 60 | + ${{ matrix.config.env }} qmake6 |
| 61 | +
|
| 62 | + - name: Build |
| 63 | + shell: bash |
| 64 | + run: | |
| 65 | + ${{ matrix.config.env }} make -j$(nproc) |
| 66 | +
|
| 67 | + - name: Get Build Info |
| 68 | + shell: bash |
| 69 | + id: get_version |
| 70 | + run: | |
| 71 | + ARCH=$(uname --machine) |
| 72 | + OS=$(source /etc/lsb-release; echo $DISTRIB_ID-$DISTRIB_RELEASE) |
| 73 | + SHA=$(git rev-parse --short ${{ github.event.pull_request.head.sha || github.sha }}) |
| 74 | + VERSION=$(cat _win32/git.h | grep CBIRD_VERSION | sed 's/[^0-9\.]*//g') |
| 75 | + echo "ARCH=$ARCH" >> $GITHUB_OUTPUT |
| 76 | + echo "BUILD=${VERSION}-${SHA}-${OS}-${ARCH}" >> $GITHUB_OUTPUT |
| 77 | +
|
| 78 | + - name: Build AppImage |
| 79 | + shell: bash |
| 80 | + run: | |
| 81 | + make appimage |
| 82 | +
|
| 83 | + - name: Upload Artifacts |
| 84 | + uses: actions/upload-artifact@v4 |
| 85 | + with: |
| 86 | + name: "cbird-${{ steps.get_version.outputs.BUILD }}-${{ matrix.config.name }}" |
| 87 | + path: cbird-${{ steps.get_version.outputs.ARCH }}.AppImage |
| 88 | + retention-days: 30 |
| 89 | + |
0 commit comments