|
| 1 | +# @credits https://github.com/c0re100/qBittorrent-Enhanced-Edition |
| 2 | +name: ci - alpine build |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_call: |
| 6 | + inputs: |
| 7 | + distinct_id: |
| 8 | + description: "Distinct id" |
| 9 | + required: false |
| 10 | + type: string |
| 11 | + workflow-files: |
| 12 | + description: "Alpine: workflow-files files" |
| 13 | + required: true |
| 14 | + type: string |
| 15 | + icu: |
| 16 | + description: "enable icu" |
| 17 | + required: true |
| 18 | + type: string |
| 19 | + debug: |
| 20 | + description: "debug builds" |
| 21 | + required: true |
| 22 | + type: string |
| 23 | + |
| 24 | +jobs: |
| 25 | + build-alpine: |
| 26 | + runs-on: ubuntu-latest |
| 27 | + strategy: |
| 28 | + fail-fast: false |
| 29 | + matrix: |
| 30 | + os_id: [alpine] |
| 31 | + os_version_id: [edge] |
| 32 | + qbt_cross_name: ["armhf", "armv7", "aarch64", "x86_64", "x86"] |
| 33 | + qbt_libtorrent_version: ["1.2", "2.0"] |
| 34 | + qbt_build_tool: ["", "qmake"] |
| 35 | + include: |
| 36 | + - qbt_build_tool: "qmake" |
| 37 | + qbt_qt_version_name: "qt5-" |
| 38 | + qbt_qt_version: "5" |
| 39 | + - qbt_build_tool: "" |
| 40 | + qbt_qt_version_name: "" |
| 41 | + qbt_qt_version: "6" |
| 42 | + |
| 43 | + name: "${{ matrix.qbt_cross_name }}-${{ matrix.qbt_qt_version_name }}libtorrent-v${{ matrix.qbt_libtorrent_version }}" |
| 44 | + |
| 45 | + env: |
| 46 | + qbt_build_dir: "qbt-build" |
| 47 | + |
| 48 | + steps: |
| 49 | + - name: Checkout ${{ inputs.distinct_id }} |
| 50 | + uses: actions/checkout@v4 |
| 51 | + |
| 52 | + - name: Host - phased updates ${{ inputs.distinct_id }} |
| 53 | + run: printf '%s\n' 'APT::Get::Always-Include-Phased-Updates "false";' | sudo tee /etc/apt/apt.conf.d/99-phased-updates |
| 54 | + |
| 55 | + - name: Host - update ${{ inputs.distinct_id }} |
| 56 | + run: sudo apt-get update |
| 57 | + |
| 58 | + - name: Host - upgrade ${{ inputs.distinct_id }} |
| 59 | + run: sudo apt-get -y upgrade |
| 60 | + |
| 61 | + - name: Host - set up qemu-user-static binfmt-support ${{ inputs.distinct_id }} |
| 62 | + run: sudo apt install libpipeline1 qemu-user-static binfmt-support |
| 63 | + |
| 64 | + - name: Host - Create Docker template env file ${{ inputs.distinct_id }} |
| 65 | + run: | |
| 66 | + printf '%s\n' "qbt_build_dir=${{ env.qbt_build_dir }}" > env.custom |
| 67 | + printf '%s\n' "qbt_libtorrent_version=${{ matrix.qbt_libtorrent_version }}" >> env.custom |
| 68 | + printf '%s\n' "qbt_qt_version=${{ matrix.qbt_qt_version }}" >> env.custom |
| 69 | + printf '%s\n' "qbt_build_tool=${{ matrix.qbt_build_tool }}" >> env.custom |
| 70 | + printf '%s\n' "qbt_cross_name=${{ matrix.qbt_cross_name }}" >> env.custom |
| 71 | + printf '%s\n' "qbt_patches_url=${{ github.repository }}" >> env.custom |
| 72 | + printf '%s\n' "qbt_skip_icu=${{ inputs.icu }}" >> env.custom |
| 73 | + printf '%s\n' "qbt_boost_tag=" >> env.custom |
| 74 | + printf '%s\n' "qbt_libtorrent_tag=" >> env.custom |
| 75 | + printf '%s\n' "qbt_qt_tag=" >> env.custom |
| 76 | + printf '%s\n' "qbt_qbittorrent_tag=" >> env.custom |
| 77 | + printf '%s\n' "qbt_libtorrent_master_jamfile=" >> env.custom |
| 78 | + printf '%s\n' "qbt_workflow_files=${{ inputs.workflow-files }}" >> env.custom |
| 79 | + printf '%s\n' "qbt_workflow_artifacts=" >> env.custom |
| 80 | + printf '%s\n' "qbt_cache_dir=" >> env.custom |
| 81 | + printf '%s\n' "qbt_optimise_strip=${{ inputs.debug }}" >> env.custom |
| 82 | + printf '%s\n' "qbt_build_debug=${{ inputs.debug }}" >> env.custom |
| 83 | + printf '%s\n' "qbt_revision_url=${{ github.repository }}" >> env.custom |
| 84 | + printf '%s\n' "qbt_standard=" >> env.custom |
| 85 | + printf '%s\n' "qbt_static_ish=" >> env.custom |
| 86 | +
|
| 87 | + - name: Host - Create docker multiarch container ${{ inputs.distinct_id }} |
| 88 | + run: docker run --name multiarch -it -d --env-file env.custom -w /root -v ${{ github.workspace }}:/root ${{ matrix.os_id }}:${{ matrix.os_version_id }} |
| 89 | + |
| 90 | + - name: Docker - apk update ${{ inputs.distinct_id }} |
| 91 | + run: docker exec -w /root multiarch apk update |
| 92 | + |
| 93 | + - name: Docker - apk install bash ${{ inputs.distinct_id }} |
| 94 | + run: docker exec -w /root multiarch apk add bash |
| 95 | + |
| 96 | + - name: Docker - Bootstrap ${{ inputs.distinct_id }} |
| 97 | + run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh -bs-a |
| 98 | + |
| 99 | + - name: Host - qBittorrent v5 transition ${{ inputs.distinct_id }} |
| 100 | + run: | |
| 101 | + if [[ -f "${{ env.qbt_build_dir }}/release_info/disable-qt5" ]]; then |
| 102 | + printf '%s\n' "disable_qt5=yes" >> $GITHUB_ENV |
| 103 | + fi |
| 104 | +
|
| 105 | + - name: Docker - Copy repo patches to build folder ${{ inputs.distinct_id }} |
| 106 | + if: env.disable_qt5 != 'yes' |
| 107 | + run: if [[ -d patches ]]; then docker exec -w /root multiarch cp -r patches/* /root/${{ env.qbt_build_dir }}/patches; fi |
| 108 | + |
| 109 | + - name: Docker - zlib-ng ${{ inputs.distinct_id }} |
| 110 | + if: env.disable_qt5 != 'yes' |
| 111 | + run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh zlib |
| 112 | + |
| 113 | + - name: Docker - iconv ${{ inputs.distinct_id }} |
| 114 | + if: env.disable_qt5 != 'yes' |
| 115 | + run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh iconv |
| 116 | + |
| 117 | + - name: Docker - icu ${{ inputs.distinct_id }} |
| 118 | + if: env.disable_qt5 != 'yes' |
| 119 | + run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh icu |
| 120 | + |
| 121 | + - name: Docker - openssl ${{ inputs.distinct_id }} |
| 122 | + if: env.disable_qt5 != 'yes' |
| 123 | + run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh openssl |
| 124 | + |
| 125 | + - name: Docker - boost ${{ inputs.distinct_id }} |
| 126 | + if: env.disable_qt5 != 'yes' |
| 127 | + run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh boost |
| 128 | + |
| 129 | + - name: Docker - libtorrent ${{ inputs.distinct_id }} |
| 130 | + if: env.disable_qt5 != 'yes' |
| 131 | + run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh libtorrent |
| 132 | + |
| 133 | + - name: Docker - double_conversion ${{ inputs.distinct_id }} |
| 134 | + if: matrix.qbt_build_tool == '' && env.disable_qt5 != 'yes' |
| 135 | + run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh double_conversion |
| 136 | + |
| 137 | + - name: Docker - qtbase ${{ inputs.distinct_id }} |
| 138 | + if: env.disable_qt5 != 'yes' |
| 139 | + run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh qtbase |
| 140 | + |
| 141 | + - name: Docker - qttools ${{ inputs.distinct_id }} |
| 142 | + if: env.disable_qt5 != 'yes' |
| 143 | + run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh qttools |
| 144 | + |
| 145 | + - name: Docker - qbittorrent ${{ inputs.distinct_id }} |
| 146 | + if: env.disable_qt5 != 'yes' |
| 147 | + run: docker exec -w /root multiarch bash qbittorrent-nox-static.sh qbittorrent |
| 148 | + |
| 149 | + - name: Docker - Set release asset name ${{ inputs.distinct_id }} |
| 150 | + if: env.disable_qt5 != 'yes' |
| 151 | + run: docker exec -w /root/${{ env.qbt_build_dir }}/completed multiarch mv -f qbittorrent-nox ${{ matrix.qbt_cross_name }}-${{ matrix.qbt_qt_version_name }}qbittorrent-nox |
| 152 | + |
| 153 | + - name: Generate artifact attestation ${{ inputs.distinct_id }} |
| 154 | + if: env.disable_qt5 != 'yes' |
| 155 | + uses: actions/attest-build-provenance@v2 |
| 156 | + with: |
| 157 | + subject-path: "${{ env.qbt_build_dir }}/completed/${{ matrix.qbt_cross_name }}-${{ matrix.qbt_qt_version_name }}qbittorrent-nox" |
| 158 | + |
| 159 | + - name: Docker - Release Info ${{ inputs.distinct_id }} |
| 160 | + if: env.disable_qt5 != 'yes' |
| 161 | + run: docker exec -w /root/${{ env.qbt_build_dir }}/release_info multiarch bash -c 'mv *.md *.json '/root/${{ env.qbt_build_dir }}/completed'' |
| 162 | + |
| 163 | + - name: Host - Upload libtorrent-v${{ matrix.qbt_libtorrent_version }}-qbittorrent-nox and release info artifact ${{ inputs.distinct_id }} |
| 164 | + if: env.disable_qt5 != 'yes' |
| 165 | + uses: actions/upload-artifact@v4 |
| 166 | + with: |
| 167 | + name: libtorrent-v${{ matrix.qbt_libtorrent_version }}-${{ matrix.qbt_cross_name }}-${{ matrix.qbt_qt_version_name }}qbittorrent-nox |
| 168 | + path: | |
| 169 | + ${{ env.qbt_build_dir }}/completed/* |
| 170 | + !${{ env.qbt_build_dir }}/completed/*.png |
| 171 | +
|
| 172 | + - name: Host - Upload cmake graphs artifact ${{ inputs.distinct_id }} |
| 173 | + if: matrix.qbt_build_tool == '' && env.disable_qt5 != 'yes' |
| 174 | + uses: actions/upload-artifact@v4 |
| 175 | + with: |
| 176 | + name: "${{ matrix.qbt_cross_name }}-libtorrent-v${{ matrix.qbt_libtorrent_version }}-graphs" |
| 177 | + path: "${{ env.qbt_build_dir }}/completed/*.png" |
0 commit comments