diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf00a598..cfeda1cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,10 @@ name: CI -on: [push] +on: + pull_request: + push: + branches: + - main jobs: Linux: @@ -8,43 +12,31 @@ jobs: fail-fast: false matrix: target: - - bionic + - focal include: - - target: bionic - image_variant: bionic + - target: focal + image_variant: focal lib_postfix: '/x86_64-linux-gnu' env: HOME: /home/runner - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 container: - image: ghcr.io/kiwix/kiwix-build_ci_${{matrix.image_variant}}:36 + image: ghcr.io/kiwix/kiwix-build_ci_${{matrix.image_variant}}:38 + steps: - - name: Extract branch name - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - id: extract_branch - - name: Checkout code - shell: python - run: | - from subprocess import check_call - from os import environ - command = [ - 'git', 'clone', - 'https://github.com/${{github.repository}}', - '--depth=1', - '--branch', '${{steps.extract_branch.outputs.branch}}' - ] - check_call(command, cwd=environ['HOME']) - - name: Install deps - shell: bash - run: | - ARCHIVE_NAME=deps2_bionic_native_dyn_kiwix-desktop.tar.xz - wget -O- http://tmp.kiwix.org/ci/${ARCHIVE_NAME} | tar -xJ -C /home/runner - - name: Compile - shell: bash - run: | - cd $HOME/kiwix-desktop - qmake PREFIX=$HOME/BUILD_native_dyn/INSTALL - make - env: - PKG_CONFIG_PATH: "/home/runner/BUILD_native_dyn/INSTALL/lib/pkgconfig:/home/runner/BUILD_native_dyn/INSTALL/lib${{matrix.lib_postfix}}/pkgconfig" + - name: Install dependencies + shell: bash + run: | + ARCHIVE_NAME=deps2_focal_native_dyn_kiwix-desktop.tar.xz + wget -O- http://tmp.kiwix.org/ci/${ARCHIVE_NAME} | tar -xJ -C ${{env.HOME}} + + - name: Retrieve source code + uses: actions/checkout@v3 + + - name: Compile source code + shell: bash + env: + PKG_CONFIG_PATH: "/home/runner/BUILD_native_dyn/INSTALL/lib/pkgconfig:/home/runner/BUILD_native_dyn/INSTALL/lib${{matrix.lib_postfix}}/pkgconfig" + run: | + qmake PREFIX=$HOME/BUILD_native_dyn/INSTALL + make diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 2a0384e9..c9fc23d3 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -1,9 +1,16 @@ name: Packages -on: [push, pull_request] + +on: + pull_request: + push: + branches: + - main + release: + types: [published] jobs: build-deb: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: @@ -11,7 +18,6 @@ jobs: - ubuntu-kinetic - ubuntu-jammy - ubuntu-focal - - ubuntu-bionic steps: - uses: actions/checkout@v3 @@ -42,7 +48,6 @@ jobs: args: --no-sign ppa: ${{ steps.ppa.outputs.ppa }} - - uses: legoktm/gh-action-build-deb@ubuntu-jammy if: matrix.distro == 'ubuntu-jammy' name: Build package for ubuntu-jammy @@ -59,14 +64,6 @@ jobs: args: --no-sign ppa: ${{ steps.ppa.outputs.ppa }} - - uses: legoktm/gh-action-build-deb@ubuntu-bionic - if: matrix.distro == 'ubuntu-bionic' - name: Build package for ubuntu-bionic - id: build-ubuntu-bionic - with: - args: --no-sign - ppa: ${{ steps.ppa.outputs.ppa }} - - uses: actions/upload-artifact@v3 with: name: Packages for ${{ matrix.distro }} @@ -74,7 +71,6 @@ jobs: - uses: legoktm/gh-action-dput@master name: Upload dev package - # Only upload on pushes to git default branch if: github.event_name == 'push' && github.event.ref == 'refs/heads/main' && startswith(matrix.distro, 'ubuntu-') with: gpg_key: ${{ secrets.LAUNCHPAD_GPG }} @@ -83,8 +79,7 @@ jobs: - uses: legoktm/gh-action-dput@master name: Upload release package - # Only upload on pushes to master or tag - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && startswith(matrix.distro, 'ubuntu-') + if: github.event_name == 'release' && startswith(matrix.distro, 'ubuntu-') with: gpg_key: ${{ secrets.LAUNCHPAD_GPG }} repository: ppa:kiwixteam/release