ci.yml
This file
Path
.github/workflows/ci.yml
431 lines · 12.6 KiB · YAML
Last changed by
build(deps): bump actions/checkout from 6 to 7 in the official-actions group (#3565)dependabot[bot]before adoption34f7186
History of this fileTake it
The walk stopped after 200 commits: lines older than fa6a2ff point at it.
website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 1–67why, one step back1name: CI2on:3 push:4 branches:5 - master6 tags:7 - "jq-*"8 pull_request:910jobs:11 linux:12 strategy:13 fail-fast: false14 matrix:15 arch:16 - amd6417 - arm6418 - armel19 - armhf20 - i38621 - mips22 - mips6423 - mips64el24 - mips64r625 - mips64r6el26 - mipsel27 - mipsr628 - mipsr6el29 - powerpc30 - ppc64el31 - riscv6432 - s390x33 include:34 - arch: amd6435 CC: x86_64-linux-gnu36 - arch: arm6437 CC: aarch64-linux-gnu38 - arch: armel39 CC: arm-linux-gnueabi40 - arch: armhf41 CC: arm-linux-gnueabihf42 - arch: i38643 CC: i686-linux-gnu44 - arch: mips45 CC: mips-linux-gnu46 - arch: mips6447 CC: mips64-linux-gnuabi6448 - arch: mips64el49 CC: mips64el-linux-gnuabi6450 - arch: mips64r651 CC: mipsisa64r6-linux-gnuabi6452 - arch: mips64r6el53 CC: mipsisa64r6el-linux-gnuabi6454 - arch: mipsel55 CC: mipsel-linux-gnu56 - arch: mipsr657 CC: mipsisa32r6-linux-gnu58 - arch: mipsr6el59 CC: mipsisa32r6el-linux-gnu60 - arch: powerpc61 CC: powerpc-linux-gnu62 - arch: ppc64el63 CC: powerpc64le-linux-gnu64 - arch: riscv6465 CC: riscv64-linux-gnu66 - arch: s390x67 CC: s390x-linux-gnuUpdate CI runners to Ubuntu 24.04 and macOS Sonoma (#3208)itchynybefore adoptionecea2d2
line 68why, one step back68 runs-on: ${{ matrix.arch == 'i386' && 'ubuntu-22.04' || 'ubuntu-24.04' }}website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 69–77why, one step back69 env:70 AR: ${{ matrix.CC }}-ar71 CHOST: ${{ matrix.CC }}72 CC: ${{ matrix.CC }}-gcc73 CPP: ${{ matrix.CC }}-cpp74 LDFLAGS: -s75 SUFFIX: linux-${{ matrix.arch }}76 steps:77 - name: Clone repositorybuild(deps): bump actions/checkout from 6 to 7 in the official-actions group (#3565)dependabot[bot]before adoption34f7186
line 78why, one step back78 uses: actions/checkout@v7website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 79–105why, one step back79 with:80 submodules: true81 - name: Install packages82 run: |83 sudo apt-get update84 sudo apt-get install -y automake autoconf libtool crossbuild-essential-${{ matrix.arch }}85 - name: Build86 run: |87 autoreconf -i88 ./configure \89 --host=${{ matrix.CC }} \90 --disable-docs \91 --with-oniguruma=builtin \92 --enable-static \93 --enable-all-static \94 CFLAGS="-O2 -pthread -fstack-protector-all"95 make -j"$(nproc)"96 file ./jq97 cp ./jq jq-${{ env.SUFFIX }}98 - name: Test99 # Only run tests for amd64 matching the CI machine arch100 if: ${{ matrix.arch == 'amd64' }}101 run: |102 make check VERBOSE=yes103 git diff --exit-code104 - name: Upload Test Logs105 if: ${{ failure() }}build(deps): bump the official-actions group with 3 updates (#3494)dependabot[bot]before adoption36b6ae0
line 106why, one step back106 uses: actions/upload-artifact@v7website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 107–113why, one step back107 with:108 name: test-logs-${{ env.SUFFIX }}109 retention-days: 7110 path: |111 test-suite.log112 tests/*.log113 - name: Upload artifactsbuild(deps): bump the official-actions group with 3 updates (#3494)dependabot[bot]before adoption36b6ae0
line 114why, one step back114 uses: actions/upload-artifact@v7website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 115–132why, one step back115 with:116 name: jq-${{ env.SUFFIX }}117 path: jq-${{ env.SUFFIX }}118 if-no-files-found: error119 retention-days: 7120121 macos:122 strategy:123 fail-fast: false124 matrix:125 arch:126 - amd64127 - arm64128 include:129 - arch: amd64130 target: x86_64-apple-darwin131 - arch: arm64132 target: arm64-apple-darwinUpdate CI runners to Ubuntu 24.04 and macOS Sonoma (#3208)itchynybefore adoptionecea2d2
line 133why, one step back133 runs-on: macos-14website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 134–138why, one step back134 env:135 LDFLAGS: -dead_strip136 SUFFIX: macos-${{ matrix.arch }}137 steps:138 - name: Clone repositorybuild(deps): bump actions/checkout from 6 to 7 in the official-actions group (#3565)dependabot[bot]before adoption34f7186
line 139why, one step back139 uses: actions/checkout@v7website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 140–156why, one step back140 with:141 submodules: true142 - name: Install packages143 run: |144 # brew update sometimes fails with "Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask failed!"145 brew update || brew update-reset146 brew install autoconf automake libtool147 - name: Set CC148 run: |149 echo "CC=clang -target ${{ matrix.target }}$(uname -r)" >> "$GITHUB_ENV"150 - name: Build151 run: |152 autoreconf -i153 ./configure \154 --host="${{ matrix.target }}$(uname -r)" \155 --disable-docs \156 --with-oniguruma=builtin \Disable shared libraries on macOS to avoid conflict with -all-static (#3261)itchynybefore adoptioneff9caf
line 157why, one step back157 --disable-shared \website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 158–170why, one step back158 --enable-static \159 --enable-all-static \160 CFLAGS="-O2 -pthread -fstack-protector-all"161 make -j"$(sysctl -n hw.logicalcpu)"162 strip ./jq163 file ./jq164 cp ./jq jq-${{ env.SUFFIX }}165 - name: Test166 run: |167 make check VERBOSE=yes168 git diff --exit-code169 - name: Upload Test Logs170 if: ${{ failure() }}build(deps): bump the official-actions group with 3 updates (#3494)dependabot[bot]before adoption36b6ae0
line 171why, one step back171 uses: actions/upload-artifact@v7website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 172–178why, one step back172 with:173 name: test-logs-${{ env.SUFFIX }}174 retention-days: 7175 path: |176 test-suite.log177 tests/*.log178 - name: Upload artifactsbuild(deps): bump the official-actions group with 3 updates (#3494)dependabot[bot]before adoption36b6ae0
line 179why, one step back179 uses: actions/upload-artifact@v7website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 180–192why, one step back180 with:181 name: jq-${{ env.SUFFIX }}182 path: jq-${{ env.SUFFIX }}183 if-no-files-found: error184 retention-days: 7185186 windows:187 strategy:188 fail-fast: false189 matrix:190 arch:191 - amd64192 - i386CI: add builds for Windows arm64 (#3376)Dennis Amelingbefore adoption4357b61
line 193why, one step back193 - arm64website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 194–196why, one step back194 include:195 - arch: amd64196 msystem: UCRT64CI: add builds for Windows arm64 (#3376)Dennis Amelingbefore adoption4357b61
line 197why, one step back197 os: windows-2022website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 198–199why, one step back198 - arch: i386199 msystem: MINGW32CI: add builds for Windows arm64 (#3376)Dennis Amelingbefore adoption4357b61
lines 200–204why, one step back200 os: windows-2022201 - arch: arm64202 msystem: CLANGARM64203 os: windows-11-arm204 runs-on: ${{ matrix.os }}website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 205–215why, one step back205 env:206 LDFLAGS: -s207 SUFFIX: windows-${{ matrix.arch }}208 defaults:209 run:210 shell: msys2 {0}211 steps:212 - name: Prepare git config213 run: git config --system core.autocrlf false214 shell: bash215 - name: Clone repositorybuild(deps): bump actions/checkout from 6 to 7 in the official-actions group (#3565)dependabot[bot]before adoption34f7186
line 216why, one step back216 uses: actions/checkout@v7website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 217–239why, one step back217 with:218 submodules: true219 - uses: msys2/setup-msys2@v2220 with:221 update: true222 msystem: ${{ matrix.msystem }}223 install: >-224 base-devel225 git226 autoconf227 automake228 libtool229 pacboy: >-230 toolchain:p231 - name: Build232 run: |233 autoreconf -i234 ./configure \235 --disable-docs \236 --with-oniguruma=builtin \237 --disable-shared \238 --enable-static \239 --enable-all-static \Increase the maximum printing depth from 256 to 10000 (fixes #3413) (#3414)Ish Nagybefore adoptionb29504b
line 240why, one step back240 CFLAGS="-O2 -pthread -fstack-protector-all -Wl,--stack,8388608"website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 241–249why, one step back241 make -j$(nproc)242 file ./jq.exe243 cp ./jq.exe jq-${{ env.SUFFIX }}.exe244 - name: Test245 run: |246 make check VERBOSE=yes247 git diff --exit-code248 - name: Upload Test Logs249 if: ${{ failure() }}build(deps): bump the official-actions group with 3 updates (#3494)dependabot[bot]before adoption36b6ae0
line 250why, one step back250 uses: actions/upload-artifact@v7website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 251–257why, one step back251 with:252 name: test-logs-${{ env.SUFFIX }}253 retention-days: 7254 path: |255 test-suite.log256 tests/*.log257 - name: Upload artifactsbuild(deps): bump the official-actions group with 3 updates (#3494)dependabot[bot]before adoption36b6ae0
line 258why, one step back258 uses: actions/upload-artifact@v7website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 259–268why, one step back259 with:260 name: jq-${{ env.SUFFIX }}261 path: jq-${{ env.SUFFIX }}.exe262 if-no-files-found: error263 retention-days: 7264265 dist:266 runs-on: ubuntu-latest267 steps:268 - name: Clone repositorybuild(deps): bump actions/checkout from 6 to 7 in the official-actions group (#3565)dependabot[bot]before adoption34f7186
line 269why, one step back269 uses: actions/checkout@v7website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 270–285why, one step back270 with:271 submodules: true272 - name: Install packages273 run: |274 sudo apt-get update -qq275 sudo apt-get install -y automake autoconf276 - name: Create dist277 run: |278 autoreconf -i279 ./configure \280 --disable-docs \281 --with-oniguruma=builtin282 make distcheck283 make dist dist-zip284 git diff --exit-code285 - name: Upload artifactsbuild(deps): bump the official-actions group with 3 updates (#3494)dependabot[bot]before adoption36b6ae0
line 286why, one step back286 uses: actions/upload-artifact@v7website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 287–300why, one step back287 with:288 name: jq-dist289 if-no-files-found: error290 retention-days: 7291 path: |292 jq-*.tar.gz293 jq-*.zip294295 docker:296 runs-on: ubuntu-latest297 permissions:298 id-token: write299 contents: read300 attestations: writeFix CI to add `artifact-metadata` permission for actions/attest (#3530)itchynybefore adoption7316e5c
line 301why, one step back301 artifact-metadata: writewebsite: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 302–305why, one step back302 packages: write303 needs: linux304 steps:305 - name: Clone repositorybuild(deps): bump actions/checkout from 6 to 7 in the official-actions group (#3565)dependabot[bot]before adoption34f7186
line 306why, one step back306 uses: actions/checkout@v7website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
line 307why, one step back307 - name: Download executablesbuild(deps): bump the official-actions group with 3 updates (#3494)dependabot[bot]before adoption36b6ae0
line 308why, one step back308 uses: actions/download-artifact@v8website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 309–313why, one step back309 with:310 pattern: jq-linux-*311 merge-multiple: true312 - name: Move executables313 run: |Support arm/v7 architecture in Docker images (#3463)itchynybefore adoptiond44baeb
lines 314–315why, one step back314 mkdir -p linux/{386,amd64,arm64,arm/v7,mips64le,ppc64le,riscv64,s390x}315 chmod +x jq-linux-*website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 316–318why, one step back316 mv jq-linux-i386 linux/386/jq317 mv jq-linux-amd64 linux/amd64/jq318 mv jq-linux-arm64 linux/arm64/jqSupport arm/v7 architecture in Docker images (#3463)itchynybefore adoptiond44baeb
line 319why, one step back319 mv jq-linux-armhf linux/arm/v7/jqwebsite: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 320–333why, one step back320 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 - name: Create Dockerfile325 run: |326 cat <<'EOF' >Dockerfile327 FROM scratch328 ARG TARGETPLATFORM329 COPY AUTHORS COPYING $TARGETPLATFORM/jq /330 RUN ["/jq", "--version"]331 ENTRYPOINT ["/jq"]332 EOF333 - name: Docker metadatabuild(deps): bump the docker-actions group with 5 updates (#3506)dependabot[bot]before adoption1a39491
line 334why, one step back334 uses: docker/metadata-action@v6website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 335–342why, one step back335 id: metadata336 with:337 images: ghcr.io/${{ github.repository }}338 tags: >339 ${{ startsWith(github.ref, 'refs/tags/jq-')340 && format('type=match,pattern=jq-(.*),group=1,value={0}', github.ref_name)341 || 'type=sha,format=long' }}342 - name: Set up QEMUbuild(deps): bump the docker-actions group with 5 updates (#3506)dependabot[bot]before adoption1a39491
line 343why, one step back343 uses: docker/setup-qemu-action@v4website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
line 344why, one step back344 - name: Set up Docker Buildxbuild(deps): bump the docker-actions group with 5 updates (#3506)dependabot[bot]before adoption1a39491
line 345why, one step back345 uses: docker/setup-buildx-action@v4website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
line 346why, one step back346 - name: Login to GitHub Container Registrybuild(deps): bump the docker-actions group with 5 updates (#3506)dependabot[bot]before adoption1a39491
line 347why, one step back347 uses: docker/login-action@v4website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 348–352why, one step back348 with:349 registry: ghcr.io350 username: ${{ github.repository_owner }}351 password: ${{ secrets.GITHUB_TOKEN }}352 - name: Build and release Docker imagebuild(deps): bump the docker-actions group with 5 updates (#3506)dependabot[bot]before adoption1a39491
line 353why, one step back353 uses: docker/build-push-action@v7website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 354–358why, one step back354 id: build-push355 with:356 context: .357 push: ${{ startsWith(github.ref, 'refs/tags/jq-') }}358 provenance: falseSupport arm/v7 architecture in Docker images (#3463)itchynybefore adoptiond44baeb
line 359why, one step back359 platforms: linux/386,linux/amd64,linux/arm64,linux/arm/v7,linux/mips64le,linux/ppc64le,linux/riscv64,linux/s390xwebsite: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 360–363why, one step back360 tags: ${{ steps.metadata.outputs.tags }}361 labels: ${{ steps.metadata.outputs.labels }}362 - name: Generate signed attestations363 if: startsWith(github.ref, 'refs/tags/jq-')build(deps): bump the official-actions group with 3 updates (#3494)dependabot[bot]before adoption36b6ae0
line 364why, one step back364 uses: actions/attest@v4website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 365–375why, one step back365 with:366 subject-name: ghcr.io/${{ github.repository }}367 subject-digest: ${{ steps.build-push.outputs.digest }}368 push-to-registry: true369370 release:371 runs-on: ubuntu-latest372 permissions:373 contents: write374 id-token: write375 attestations: writeFix CI to add `artifact-metadata` permission for actions/attest (#3530)itchynybefore adoption7316e5c
line 376why, one step back376 artifact-metadata: writewebsite: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 377–382why, one step back377 pull-requests: write378 environment: release379 needs: [linux, macos, windows, dist, docker]380 if: startsWith(github.ref, 'refs/tags/jq-')381 steps:382 - name: Clone repositorybuild(deps): bump actions/checkout from 6 to 7 in the official-actions group (#3565)dependabot[bot]before adoption34f7186
line 383why, one step back383 uses: actions/checkout@v7website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
line 384why, one step back384 - name: Download artifactsbuild(deps): bump the official-actions group with 3 updates (#3494)dependabot[bot]before adoption36b6ae0
line 385why, one step back385 uses: actions/download-artifact@v8website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 386–388why, one step back386 with:387 pattern: jq-*388 merge-multiple: trueUpload attestation bundle as a release artifact (#3563)itchynybefore adoptiona5a29cc
line 389why, one step back389 - name: Prepare release artifactswebsite: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 390–394why, one step back390 run: |391 cp jq-linux-amd64 jq-linux64392 cp jq-macos-amd64 jq-osx-amd64393 cp jq-windows-amd64.exe jq-win64.exe394 - name: Generate signed attestationsUpload attestation bundle as a release artifact (#3563)itchynybefore adoptiona5a29cc
line 395why, one step back395 id: attestbuild(deps): bump the official-actions group with 3 updates (#3494)dependabot[bot]before adoption36b6ae0
line 396why, one step back396 uses: actions/attest@v4website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 397–398why, one step back397 with:398 subject-path: jq-*Upload attestation bundle as a release artifact (#3563)itchynybefore adoptiona5a29cc
lines 399–407why, one step back399 - name: Upload release400 env:401 TAG_NAME: ${{ github.ref_name }}402 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}403 run: |404 mv "${{ steps.attest.outputs.bundle-path }}" jq-attestation.json405 sha256sum jq-* > sha256sum.txt406 gh release create "$TAG_NAME" --draft --title "jq ${TAG_NAME#jq-}" --generate-notes407 gh release upload "$TAG_NAME" --clobber jq-* sha256sum.txtwebsite: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
line 408why, one step back408 - name: Import GPG keybuild(deps): bump crazy-max/ghaction-import-gpg from 6 to 7 (#3501)dependabot[bot]before adoption03a269b
line 409why, one step back409 uses: crazy-max/ghaction-import-gpg@v7website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff
lines 410–431why, one step back410 with:411 gpg_private_key: ${{ secrets.JQ_RELEASE_GPG_PRIVATE_KEY }}412 passphrase: ${{ secrets.JQ_RELEASE_GPG_PASSPHRASE }}413 - name: Update signatures414 env:415 TAG_NAME: ${{ github.ref_name }}416 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}417 run: |418 sig_dir="sig/v${TAG_NAME#jq-}"419 mkdir -p "$sig_dir"420 mv sha256sum.txt "$sig_dir"421 for file in jq-*; do422 gpg --detach-sign --armor --batch --output "${sig_dir}/${file#*/}.asc" "$file"423 done424 git add sig425 git config user.name 'github-actions[bot]'426 git config user.email 'github-actions[bot]@users.noreply.github.com'427 title="Update signatures of ${TAG_NAME#jq-}"428 git commit -m "$title"429 branch="update-signatures-${TAG_NAME#jq-}"430 git push origin "HEAD:refs/heads/$branch"431 gh pr create --title "$title" --body "" --head "$branch"