Skip to content
Myr

ci.yml

This file

Path

.github/workflows/ci.yml

420 lines · 12.2 KiB · YAML

Last changed by

Disable shared libraries on macOS to avoid conflict with -all-static (#3261)itchynybefore adoptioneff9caf

History of this file

Take it

The walk stopped after 200 commits: lines older than 4c6f6dc point at it.

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 1–77why, one step back
1name: CI
2on: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-gnu68 runs-on: ubuntu-22.0469 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 repository

Bump actions/checkout from 1 to 4 (#2902)dependabot[bot]before adoptionb0b7614

line 78why, one step back
78 uses: actions/checkout@v4

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 79–105why, one step back
79 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() }}

Bump the official-actions group with 2 updates (#2998)dependabot[bot]before adoption2381d15

line 106why, one step back
106 uses: actions/upload-artifact@v4

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 107–113why, one step back
107 with:
108 name: test-logs-${{ env.SUFFIX }}109 retention-days: 7110 path: |111 test-suite.log112 tests/*.log113 - name: Upload artifacts

Bump the official-actions group with 2 updates (#2998)dependabot[bot]before adoption2381d15

line 114why, one step back
114 uses: actions/upload-artifact@v4

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

line 115why, one step back
115 with:

Bump the official-actions group with 2 updates (#2998)dependabot[bot]before adoption2381d15

line 116why, one step back
116 name: jq-${{ env.SUFFIX }}

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 117–138why, one step back
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-darwin133 runs-on: macos-13134 env:135 LDFLAGS: -dead_strip136 SUFFIX: macos-${{ matrix.arch }}137 steps:138 - name: Clone repository

Bump actions/checkout from 1 to 4 (#2902)dependabot[bot]before adoptionb0b7614

line 139why, one step back
139 uses: actions/checkout@v4

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 140–156why, one step back
140 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 back
157 --disable-shared \

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 158–160why, one step back
158 --enable-static \
159 --enable-all-static \160 CFLAGS="-O2 -pthread -fstack-protector-all"

ci.yml: use sysctl -n hw.logicalcpu instead of nproc on macosEmanuele Torrebefore adoption19453a6

line 161why, one step back
161 make -j"$(sysctl -n hw.logicalcpu)"

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 162–172why, one step back
162 strip ./jq
163 file ./jq164 cp ./jq jq-${{ env.SUFFIX }}165 - name: Test166 # Only run tests for amd64 matching the CI machine arch167 if: ${{ matrix.arch == 'amd64' }}168 run: |169 make check VERBOSE=yes170 git diff --exit-code171 - name: Upload Test Logs172 if: ${{ failure() }}

Bump the official-actions group with 2 updates (#2998)dependabot[bot]before adoption2381d15

line 173why, one step back
173 uses: actions/upload-artifact@v4

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 174–180why, one step back
174 with:
175 name: test-logs-${{ env.SUFFIX }}176 retention-days: 7177 path: |178 test-suite.log179 tests/*.log180 - name: Upload artifacts

Bump the official-actions group with 2 updates (#2998)dependabot[bot]before adoption2381d15

line 181why, one step back
181 uses: actions/upload-artifact@v4

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

line 182why, one step back
182 with:

Bump the official-actions group with 2 updates (#2998)dependabot[bot]before adoption2381d15

line 183why, one step back
183 name: jq-${{ env.SUFFIX }}

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 184–211why, one step back
184 path: jq-${{ env.SUFFIX }}
185 if-no-files-found: error186 retention-days: 7187188 windows:189 strategy:190 fail-fast: false191 matrix:192 arch:193 - amd64194 - i386195 include:196 - arch: amd64197 msystem: UCRT64198 - arch: i386199 msystem: MINGW32200 runs-on: windows-2022201 env:202 LDFLAGS: -s203 SUFFIX: windows-${{ matrix.arch }}204 defaults:205 run:206 shell: msys2 {0}207 steps:208 - name: Prepare git config209 run: git config --system core.autocrlf false210 shell: bash211 - name: Clone repository

Bump actions/checkout from 1 to 4 (#2902)dependabot[bot]before adoptionb0b7614

line 212why, one step back
212 uses: actions/checkout@v4

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 213–245why, one step back
213 with:
214 submodules: true215 - uses: msys2/setup-msys2@v2216 with:217 update: true218 msystem: ${{ matrix.msystem }}219 install: >-220 base-devel221 git222 autoconf223 automake224 libtool225 pacboy: >-226 toolchain:p227 - name: Build228 run: |229 autoreconf -i230 ./configure \231 --disable-docs \232 --with-oniguruma=builtin \233 --disable-shared \234 --enable-static \235 --enable-all-static \236 CFLAGS="-O2 -pthread -fstack-protector-all"237 make -j$(nproc)238 file ./jq.exe239 cp ./jq.exe jq-${{ env.SUFFIX }}.exe240 - name: Test241 run: |242 make check VERBOSE=yes243 git diff --exit-code244 - name: Upload Test Logs245 if: ${{ failure() }}

Bump the official-actions group with 2 updates (#2998)dependabot[bot]before adoption2381d15

line 246why, one step back
246 uses: actions/upload-artifact@v4

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 247–253why, one step back
247 with:
248 name: test-logs-${{ env.SUFFIX }}249 retention-days: 7250 path: |251 test-suite.log252 tests/*.log253 - name: Upload artifacts

Bump the official-actions group with 2 updates (#2998)dependabot[bot]before adoption2381d15

line 254why, one step back
254 uses: actions/upload-artifact@v4

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

line 255why, one step back
255 with:

Bump the official-actions group with 2 updates (#2998)dependabot[bot]before adoption2381d15

line 256why, one step back
256 name: jq-${{ env.SUFFIX }}

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 257–264why, one step back
257 path: jq-${{ env.SUFFIX }}.exe
258 if-no-files-found: error259 retention-days: 7260261 dist:262 runs-on: ubuntu-latest263 steps:264 - name: Clone repository

Bump actions/checkout from 1 to 4 (#2902)dependabot[bot]before adoptionb0b7614

line 265why, one step back
265 uses: actions/checkout@v4

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 266–281why, one step back
266 with:
267 submodules: true268 - name: Install packages269 run: |270 sudo apt-get update -qq271 sudo apt-get install -y automake autoconf272 - name: Create dist273 run: |274 autoreconf -i275 ./configure \276 --disable-docs \277 --with-oniguruma=builtin278 make distcheck279 make dist dist-zip280 git diff --exit-code281 - name: Upload artifacts

Bump the official-actions group with 2 updates (#2998)dependabot[bot]before adoption2381d15

line 282why, one step back
282 uses: actions/upload-artifact@v4

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 283–293why, one step back
283 with:
284 name: jq-dist285 if-no-files-found: error286 retention-days: 7287 path: |288 jq-*.tar.gz289 jq-*.zip290291 docker:292 runs-on: ubuntu-latest293 permissions:

Generate provenance attestations for release artifacts and docker image (#3225)lectricalbefore adoptionbcbf2b4

lines 294–296why, one step back
294 id-token: write
295 contents: read296 attestations: write

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 297–300why, one step back
297 packages: write
298 needs: linux299 steps:300 - name: Clone repository

Bump actions/checkout from 1 to 4 (#2902)dependabot[bot]before adoptionb0b7614

line 301why, one step back
301 uses: actions/checkout@v4

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

line 302why, one step back
302 - name: Download executables

Bump the official-actions group with 2 updates (#2998)dependabot[bot]before adoption2381d15

line 303why, one step back
303 uses: actions/download-artifact@v4

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

line 304why, one step back
304 with:

Bump the official-actions group with 2 updates (#2998)dependabot[bot]before adoption2381d15

lines 305–306why, one step back
305 pattern: jq-linux-*
306 merge-multiple: true

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 307–327why, one step back
307 - name: Move executables
308 run: |309 mkdir -p linux/{386,amd64,arm64,mips64le,ppc64le,riscv64,s390x}310 mv jq-linux-i386 linux/386/jq311 mv jq-linux-amd64 linux/amd64/jq312 mv jq-linux-arm64 linux/arm64/jq313 mv jq-linux-mips64el linux/mips64le/jq314 mv jq-linux-ppc64el linux/ppc64le/jq315 mv jq-linux-riscv64 linux/riscv64/jq316 mv jq-linux-s390x linux/s390x/jq317 chmod +x linux/*/jq318 - name: Create Dockerfile319 run: |320 cat <<'EOF' >Dockerfile321 FROM scratch322 ARG TARGETPLATFORM323 COPY AUTHORS COPYING $TARGETPLATFORM/jq /324 RUN ["/jq", "--version"]325 ENTRYPOINT ["/jq"]326 EOF327 - name: Docker metadata

Bump docker/metadata-action from 4 to 5dependabot[bot]before adoptionf3a46a6

line 328why, one step back
328 uses: docker/metadata-action@v5

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 329–331why, one step back
329 id: metadata
330 with:331 images: ghcr.io/${{ github.repository }}

Generate provenance attestations for release artifacts and docker image (#3225)lectricalbefore adoptionbcbf2b4

lines 332–333why, one step back
332 tags: >
333 ${{ startsWith(github.ref, 'refs/tags/jq-')

Always build Docker image on CI, group Dependabot PRs for official actions (#2997)itchynybefore adoption56828b6

lines 334–335why, one step back
334 && format('type=match,pattern=jq-(.*),group=1,value={0}', github.ref_name)
335 || 'type=sha,format=long' }}

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

line 336why, one step back
336 - name: Set up QEMU

Bump docker/setup-qemu-action from 2 to 3 (#2900)dependabot[bot]before adoptionde1c10c

line 337why, one step back
337 uses: docker/setup-qemu-action@v3

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

line 338why, one step back
338 - name: Set up Docker Buildx

Bump docker/setup-buildx-action from 2 to 3 (#2901)dependabot[bot]before adoptiona5afeea

line 339why, one step back
339 uses: docker/setup-buildx-action@v3

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

line 340why, one step back
340 - name: Login to GitHub Container Registry

Bump docker/login-action from 2 to 3dependabot[bot]before adoptiondfd930f

line 341why, one step back
341 uses: docker/login-action@v3

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 342–346why, one step back
342 with:
343 registry: ghcr.io344 username: ${{ github.repository_owner }}345 password: ${{ secrets.GITHUB_TOKEN }}346 - name: Build and release Docker image

build(deps): bump docker/build-push-action from 5 to 6 (#3143)dependabot[bot]before adoptionba741e5

line 347why, one step back
347 uses: docker/build-push-action@v6

Generate provenance attestations for release artifacts and docker image (#3225)lectricalbefore adoptionbcbf2b4

line 348why, one step back
348 id: build-push

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 349–350why, one step back
349 with:
350 context: .

Always build Docker image on CI, group Dependabot PRs for official actions (#2997)itchynybefore adoption56828b6

line 351why, one step back
351 push: ${{ startsWith(github.ref, 'refs/tags/jq-') }}

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 352–355why, one step back
352 provenance: false
353 platforms: linux/386,linux/amd64,linux/arm64,linux/mips64le,linux/ppc64le,linux/riscv64,linux/s390x354 tags: ${{ steps.metadata.outputs.tags }}355 labels: ${{ steps.metadata.outputs.labels }}

Generate provenance attestations for release artifacts and docker image (#3225)lectricalbefore adoptionbcbf2b4

lines 356–362why, one step back
356 - name: Generate signed attestations
357 if: startsWith(github.ref, 'refs/tags/jq-')358 uses: actions/attest-build-provenance@v2359 with:360 subject-name: ghcr.io/${{ github.repository }}361 subject-digest: ${{ steps.build-push.outputs.digest }}362 push-to-registry: true

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 363–367why, one step back
363
364 release:365 runs-on: ubuntu-latest366 permissions:367 contents: write

Generate provenance attestations for release artifacts and docker image (#3225)lectricalbefore adoptionbcbf2b4

lines 368–369why, one step back
368 id-token: write
369 attestations: write

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 370–375why, one step back
370 pull-requests: write
371 environment: release372 needs: [linux, macos, windows, dist, docker]373 if: startsWith(github.ref, 'refs/tags/jq-')374 steps:375 - name: Clone repository

Bump actions/checkout from 1 to 4 (#2902)dependabot[bot]before adoptionb0b7614

line 376why, one step back
376 uses: actions/checkout@v4

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

line 377why, one step back
377 - name: Download artifacts

Bump the official-actions group with 2 updates (#2998)dependabot[bot]before adoption2381d15

lines 378–379why, one step back
378 uses: actions/download-artifact@v4
379 with:

Generate provenance attestations for release artifacts and docker image (#3225)lectricalbefore adoptionbcbf2b4

line 380why, one step back
380 pattern: jq-*

Bump the official-actions group with 2 updates (#2998)dependabot[bot]before adoption2381d15

line 381why, one step back
381 merge-multiple: true

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 382–386why, one step back
382 - name: Upload release
383 env:384 TAG_NAME: ${{ github.ref_name }}385 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}386 run: |

Bump the official-actions group with 2 updates (#2998)dependabot[bot]before adoption2381d15

lines 387–390why, one step back
387 cp jq-linux-amd64 jq-linux64
388 cp jq-macos-amd64 jq-osx-amd64389 cp jq-windows-amd64.exe jq-win64.exe390 sha256sum jq-* > sha256sum.txt

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

line 391why, one step back
391 gh release create "$TAG_NAME" --draft --title "jq ${TAG_NAME#jq-}" --generate-notes

Bump the official-actions group with 2 updates (#2998)dependabot[bot]before adoption2381d15

line 392why, one step back
392 gh release upload "$TAG_NAME" --clobber jq-* sha256sum.txt

Generate provenance attestations for release artifacts and docker image (#3225)lectricalbefore adoptionbcbf2b4

lines 393–396why, one step back
393 - name: Generate signed attestations
394 uses: actions/attest-build-provenance@v2395 with:396 subject-path: jq-*

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

line 397why, one step back
397 - name: Import GPG key

Bump crazy-max/ghaction-import-gpg from 5 to 6dependabot[bot]before adoptionfb493df

line 398why, one step back
398 uses: crazy-max/ghaction-import-gpg@v6

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 399–409why, one step back
399 with:
400 gpg_private_key: ${{ secrets.JQ_RELEASE_GPG_PRIVATE_KEY }}401 passphrase: ${{ secrets.JQ_RELEASE_GPG_PASSPHRASE }}402 - name: Update signatures403 env:404 TAG_NAME: ${{ github.ref_name }}405 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}406 run: |407 sig_dir="sig/v${TAG_NAME#jq-}"408 mkdir -p "$sig_dir"409 mv sha256sum.txt "$sig_dir"

Bump the official-actions group with 2 updates (#2998)dependabot[bot]before adoption2381d15

line 410why, one step back
410 for file in jq-*; do

Add dependabot (#2889)Yeikelbefore adoption4c6f6dc

lines 411–420why, one step back
411 gpg --detach-sign --armor --batch --output "${sig_dir}/${file#*/}.asc" "$file"
412 done413 git add sig414 git config user.name 'github-actions[bot]'415 git config user.email 'github-actions[bot]@users.noreply.github.com'416 title="Update signatures of ${TAG_NAME#jq-}"417 git commit -m "$title"418 branch="update-signatures-${TAG_NAME#jq-}"419 git push origin "HEAD:refs/heads/$branch"420 gh pr create --title "$title" --body "" --head "$branch"