From 16c406303c7bb1cceb77a0f769c6ffcea918964d Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Mon, 3 Jul 2023 06:11:59 +0200 Subject: [PATCH 1/6] Remove Ubuntu Bionic from CI/CD --- .github/workflows/package.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 2a0384e9..f0cb6602 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -11,7 +11,6 @@ jobs: - ubuntu-kinetic - ubuntu-jammy - ubuntu-focal - - ubuntu-bionic steps: - uses: actions/checkout@v3 @@ -59,14 +58,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 }} From 2f4a6313fd431f55cacb0dea6d9b2d53018adadd Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Mon, 3 Jul 2023 06:20:39 +0200 Subject: [PATCH 2/6] Compile using Ubuntu 20.04 image --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf00a598..f964770e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,10 +8,10 @@ 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 @@ -38,7 +38,7 @@ jobs: - name: Install deps shell: bash run: | - ARCHIVE_NAME=deps2_bionic_native_dyn_kiwix-desktop.tar.xz + ARCHIVE_NAME=deps2_focal_native_dyn_kiwix-desktop.tar.xz wget -O- http://tmp.kiwix.org/ci/${ARCHIVE_NAME} | tar -xJ -C /home/runner - name: Compile shell: bash From 8f6de45e3b21086699a7a0d2fc4016830a624313 Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Mon, 3 Jul 2023 06:24:56 +0200 Subject: [PATCH 3/6] Use latest version of compilation container image --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f964770e..6b22a103 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: HOME: /home/runner runs-on: ubuntu-latest 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 From b67551aad7a945f4829edeb12d760cad9338367f Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Mon, 3 Jul 2023 06:31:39 +0200 Subject: [PATCH 4/6] Better events to trigger CI/CD --- .github/workflows/ci.yml | 6 +++++- .github/workflows/package.yml | 13 +++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b22a103..9bfaa533 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: diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index f0cb6602..b121fd9e 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -1,5 +1,12 @@ name: Packages -on: [push, pull_request] + +on: + pull_request: + push: + branches: + - main + release: + types: [published] jobs: build-deb: @@ -65,7 +72,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 }} @@ -74,8 +80,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 From 1a53ad6844ca13d5878b440b0538b37658ee716c Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Mon, 3 Jul 2023 06:34:26 +0200 Subject: [PATCH 5/6] Use fix Ubuntu 22.04 as base for CI/CD --- .github/workflows/ci.yml | 2 +- .github/workflows/package.yml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9bfaa533..10c1d510 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: 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}}:38 steps: diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index b121fd9e..c9fc23d3 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -10,7 +10,7 @@ on: jobs: build-deb: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: @@ -48,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 From 9445197881050df7840c68fa2fd947e6dd8a3309 Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Mon, 3 Jul 2023 06:46:45 +0200 Subject: [PATCH 6/6] Use action to checkout the code --- .github/workflows/ci.yml | 46 +++++++++++++++------------------------- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10c1d510..cfeda1cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,33 +22,21 @@ jobs: runs-on: ubuntu-22.04 container: 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_focal_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