Skip to content
Myr

Build Docker image using pre-built executables (#2686)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by itchyny · committed by GitHub · parent 8345a8a · Browse files · 1 file+86 added−73 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+86 added−73 removed

  • other:+86 added−73 removed

1 file+86 added−73 removed

modified:.github/workflows/ci.yml+86 added-73 removed
11 unmodified lines
12 strategy:13 fail-fast: false14 matrix:15 arch:16 [17 amd64,18 arm64,19 armel,20 armhf,21 i386,22 mips,23 mips64,24 mips64el,25 mips64r6,26 mips64r6el,27 mipsel,28 mipsr6,29 mipsr6el,30 powerpc,31 ppc64el,32 s390x,33 riscv64,34 ]16 - amd6417 - arm6418 - armel19 - armhf20 - i38621 - mips22 - mips6423 - mips64el24 - mips64r625 - mips64r6el26 - mipsel27 - mipsr628 - mipsr6el29 - powerpc30 - ppc64el31 - riscv6432 - s390x33 include:34 - arch: amd6437 CC: "x86_64-linux-gnu"35 CC: x86_64-linux-gnu36 - arch: arm6439 CC: "aarch64-linux-gnu"37 CC: aarch64-linux-gnu38 - arch: armel41 CC: "arm-linux-gnueabi"39 CC: arm-linux-gnueabi40 - arch: armhf43 CC: "arm-linux-gnueabihf"41 CC: arm-linux-gnueabihf42 - arch: i38645 CC: "i686-linux-gnu"43 CC: i686-linux-gnu44 - arch: mips47 CC: "mips-linux-gnu"45 CC: mips-linux-gnu46 - arch: mips6449 CC: "mips64-linux-gnuabi64"47 CC: mips64-linux-gnuabi6448 - arch: mips64el51 CC: "mips64el-linux-gnuabi64"49 CC: mips64el-linux-gnuabi6450 - arch: mips64r653 CC: "mipsisa64r6-linux-gnuabi64"51 CC: mipsisa64r6-linux-gnuabi6452 - arch: mips64r6el55 CC: "mipsisa64r6el-linux-gnuabi64"53 CC: mipsisa64r6el-linux-gnuabi6454 - arch: mipsel57 CC: "mipsel-linux-gnu"55 CC: mipsel-linux-gnu56 - arch: mipsr659 CC: "mipsisa32r6-linux-gnu"57 CC: mipsisa32r6-linux-gnu58 - arch: mipsr6el61 CC: "mipsisa32r6el-linux-gnu"59 CC: mipsisa32r6el-linux-gnu60 - arch: powerpc63 CC: "powerpc-linux-gnu"61 CC: powerpc-linux-gnu62 - arch: ppc64el65 CC: "powerpc64le-linux-gnu"66 - arch: s390x67 CC: "s390x-linux-gnu"63 CC: powerpc64le-linux-gnu64 - arch: riscv6469 CC: "riscv64-linux-gnu"65 CC: riscv64-linux-gnu66 - arch: s390x67 CC: s390x-linux-gnu68 runs-on: ubuntu-22.0469 env:70 AR: ${{ matrix.CC }}-ar71 CHOST: ${{ matrix.cc }}
22 unmodified lines
94 --disable-valgrind \95 --with-oniguruma=builtin \96 --enable-static \97 --enable-all-static100 make -j$(nproc)98 make -j"$(nproc)"99 file ./jq100 cp ./jq jq-${{ env.SUFFIX }}101 - name: Test102 # Only run tests for amd64 matching the CI machine arch
9 unmodified lines
112 retention-days: 7113 path: |114 test-suite.log115 tests/*.log118 - name: Upload Artifacts116 - name: Upload artifacts117 uses: actions/upload-artifact@v3118 with:121 name: jq-${{ env.SUFFIX }}119 name: jq-linux120 path: jq-${{ env.SUFFIX }}121 if-no-files-found: error122 retention-days: 7123
1 unmodified line
125 strategy:126 fail-fast: false127 matrix:128 arch:131 [132 amd64,133 arm64,134 ]129 - amd64130 - arm64131 include:132 - arch: amd64137 target: "x86_64-apple-darwin"133 target: x86_64-apple-darwin134 - arch: arm64139 target: "arm64-apple-darwin"135 target: arm64-apple-darwin136 runs-on: macos-13137 env:142 LDFLAGS: -s138 LDFLAGS: -dead_strip139 SUFFIX: macos-${{ matrix.arch }}140 steps:141 - name: Clone repository142 uses: actions/checkout@v3
3 unmodified lines
146 run: |147 # brew update sometimes fails with "Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask failed!"148 brew update || brew update-reset149 brew install autoconf automake libtool154 - name: "Set CC"150 - name: Set CC151 run: |156 echo "CC=clang -target ${{ matrix.target }}$(uname -r)" >> $GITHUB_ENV152 echo "CC=clang -target ${{ matrix.target }}$(uname -r)" >> "$GITHUB_ENV"153 - name: Build154 run: |155 autoreconf -i156 ./configure \161 --host=${{ matrix.target }}$(uname -r) \157 --host="${{ matrix.target }}$(uname -r)" \158 --disable-docs \159 --disable-maintainer-mode \160 --disable-valgrind \161 --with-oniguruma=builtin \162 --enable-static \163 --enable-all-static168 make -j$(nproc)164 make -j"$(nproc)"165 strip ./jq166 file ./jq167 cp ./jq jq-${{ env.SUFFIX }}168 - name: Test169 # Only run tests for amd64 matching the CI machine arch
9 unmodified lines
179 retention-days: 7180 path: |181 test-suite.log182 tests/*.log186 - name: Upload Artifacts183 - name: Upload artifacts184 uses: actions/upload-artifact@v3185 with:189 name: jq-${{ env.SUFFIX }}186 name: jq-macos187 path: jq-${{ env.SUFFIX }}188 if-no-files-found: error189 retention-days: 7190
1 unmodified line
192 strategy:193 fail-fast: false194 matrix:195 arch:199 [200 amd64,201 i386,202 ]196 - amd64197 - i386198 include:199 - arch: amd64205 CC: "x86_64-pc-msys"206 toolchain: "gcc"200 CC: x86_64-pc-msys201 toolchain: gcc202 msystem: msys203 - arch: i386209 CC: "i686-w64-mingw32"210 toolchain: "mingw-w64-i686-toolchain"204 CC: i686-w64-mingw32205 toolchain: mingw-w64-i686-toolchain206 msystem: mingw32207 runs-on: windows-2022208 env:209 CHOST: ${{ matrix.CC }}
47 unmodified lines
257 retention-days: 7258 path: |259 test-suite.log260 tests/*.log266 - name: Upload Artifacts261 - name: Upload artifacts262 uses: actions/upload-artifact@v3263 with:269 name: jq-${{ env.SUFFIX }}264 name: jq-windows265 path: jq-${{ env.SUFFIX }}.exe266 if-no-files-found: error267 retention-days: 7268
18 unmodified lines
287 --disable-valgrind \288 --with-oniguruma=builtin289 make dist dist-zip290 git diff --exit-code296 - name: Upload Artifacts291 - name: Upload artifacts292 uses: actions/upload-artifact@v3293 with:294 name: jq-dist295 if-no-files-found: error
5 unmodified lines
301 docker:302 runs-on: ubuntu-latest303 permissions:304 packages: write305 needs: linux306 if: startsWith(github.ref, 'refs/tags/jq-')307 steps:308 - name: Clone repository309 uses: actions/checkout@v3310 - name: Download executables311 uses: actions/download-artifact@v3312 with:315 submodules: true313 name: jq-linux314 - name: Move executables315 run: |316 mkdir -p linux/{386,amd64,arm64,mips64le,ppc64le,riscv64,s390x}317 mv jq-linux-i386 linux/386/jq318 mv jq-linux-amd64 linux/amd64/jq319 mv jq-linux-arm64 linux/arm64/jq320 mv jq-linux-mips64el linux/mips64le/jq321 mv jq-linux-ppc64el linux/ppc64le/jq322 mv jq-linux-riscv64 linux/riscv64/jq323 mv jq-linux-s390x linux/s390x/jq324 chmod +x linux/*/jq325 - name: Create Dockerfile326 run: |327 cat <<'EOF' >Dockerfile328 FROM scratch329 ARG TARGETPLATFORM330 COPY AUTHORS COPYING $TARGETPLATFORM/jq /331 RUN ["/jq", "--version"]332 ENTRYPOINT ["/jq"]333 EOF334 - name: Docker metadata335 uses: docker/metadata-action@v4336 id: metadata337 with:
14 unmodified lines
352 with:353 context: .354 push: true355 provenance: false338 platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x356 platforms: linux/386,linux/amd64,linux/arm64,linux/mips64le,linux/ppc64le,linux/riscv64,linux/s390x357 tags: ${{ steps.metadata.outputs.tags }}358 labels: ${{ steps.metadata.outputs.labels }}359360 release:
4 unmodified lines
365 if: startsWith(github.ref, 'refs/tags/jq-')366 steps:367 - name: Clone repository368 uses: actions/checkout@v3351 - name: Merge built artifacts369 - name: Download artifacts370 uses: actions/download-artifact@v3371 - name: Upload release372 env:373 TAG_NAME: ${{ github.ref_name }}374 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}375 run: |358 mkdir -p "release"359 for files in jq-*; do360 cp -rf "${files}/"* "release/"361 done362376 gh release create "$TAG_NAME" --draft --title "jq ${TAG_NAME#jq-}" --generate-notes364 gh release upload "$TAG_NAME" --clobber release/jq-*377 gh release upload "$TAG_NAME" --clobber jq-*/jq-*