Skip to content
Myr

ci.yml

This file

Path

.github/workflows/ci.yml

418 lines · 12.2 KiB · YAML

Last changed by

Update CI runners to Ubuntu 24.04 and macOS Sonoma (#3208)itchynybefore adoptionecea2d2

History of this file

Take it

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

lines 1–67why, 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-gnu

Update CI runners to Ubuntu 24.04 and macOS Sonoma (#3208)itchynybefore adoptionecea2d2

line 68why, one step back
68 runs-on: ${{ matrix.arch == 'i386' && 'ubuntu-22.04' || 'ubuntu-24.04' }}

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

lines 69–105why, one step back
69 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 repository78 uses: actions/checkout@v479 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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

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 }}

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

lines 117–132why, 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-darwin

Update CI runners to Ubuntu 24.04 and macOS Sonoma (#3208)itchynybefore adoptionecea2d2

line 133why, one step back
133 runs-on: macos-14

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

lines 134–156why, one step back
134 env:
135 LDFLAGS: -dead_strip136 SUFFIX: macos-${{ matrix.arch }}137 steps:138 - name: Clone repository139 uses: actions/checkout@v4140 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 \

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

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)"

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

lines 162–170why, one step back
162 strip ./jq
163 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() }}

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

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

lines 172–178why, one step back
172 with:
173 name: test-logs-${{ env.SUFFIX }}174 retention-days: 7175 path: |176 test-suite.log177 tests/*.log178 - name: Upload artifacts

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

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

line 180why, one step back
180 with:

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

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

lines 182–243why, one step back
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 - i386193 include:194 - arch: amd64195 msystem: UCRT64196 - arch: i386197 msystem: MINGW32198 runs-on: windows-2022199 env:200 LDFLAGS: -s201 SUFFIX: windows-${{ matrix.arch }}202 defaults:203 run:204 shell: msys2 {0}205 steps:206 - name: Prepare git config207 run: git config --system core.autocrlf false208 shell: bash209 - name: Clone repository210 uses: actions/checkout@v4211 with:212 submodules: true213 - uses: msys2/setup-msys2@v2214 with:215 update: true216 msystem: ${{ matrix.msystem }}217 install: >-218 base-devel219 git220 autoconf221 automake222 libtool223 pacboy: >-224 toolchain:p225 - name: Build226 run: |227 autoreconf -i228 ./configure \229 --disable-docs \230 --with-oniguruma=builtin \231 --disable-shared \232 --enable-static \233 --enable-all-static \234 CFLAGS="-O2 -pthread -fstack-protector-all"235 make -j$(nproc)236 file ./jq.exe237 cp ./jq.exe jq-${{ env.SUFFIX }}.exe238 - name: Test239 run: |240 make check VERBOSE=yes241 git diff --exit-code242 - name: Upload Test Logs243 if: ${{ failure() }}

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

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

lines 245–251why, one step back
245 with:
246 name: test-logs-${{ env.SUFFIX }}247 retention-days: 7248 path: |249 test-suite.log250 tests/*.log251 - name: Upload artifacts

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

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

line 253why, one step back
253 with:

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

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

lines 255–279why, one step back
255 path: jq-${{ env.SUFFIX }}.exe
256 if-no-files-found: error257 retention-days: 7258259 dist:260 runs-on: ubuntu-latest261 steps:262 - name: Clone repository263 uses: actions/checkout@v4264 with:265 submodules: true266 - name: Install packages267 run: |268 sudo apt-get update -qq269 sudo apt-get install -y automake autoconf270 - name: Create dist271 run: |272 autoreconf -i273 ./configure \274 --disable-docs \275 --with-oniguruma=builtin276 make distcheck277 make dist dist-zip278 git diff --exit-code279 - name: Upload artifacts

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

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

lines 281–291why, one step back
281 with:
282 name: jq-dist283 if-no-files-found: error284 retention-days: 7285 path: |286 jq-*.tar.gz287 jq-*.zip288289 docker:290 runs-on: ubuntu-latest291 permissions:

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

lines 292–294why, one step back
292 id-token: write
293 contents: read294 attestations: write

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

lines 295–300why, one step back
295 packages: write
296 needs: linux297 steps:298 - name: Clone repository299 uses: actions/checkout@v4300 - name: Download executables

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

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

line 302why, one step back
302 with:

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

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

lines 305–329why, one step back
305 - name: Move executables
306 run: |307 mkdir -p linux/{386,amd64,arm64,mips64le,ppc64le,riscv64,s390x}308 mv jq-linux-i386 linux/386/jq309 mv jq-linux-amd64 linux/amd64/jq310 mv jq-linux-arm64 linux/arm64/jq311 mv jq-linux-mips64el linux/mips64le/jq312 mv jq-linux-ppc64el linux/ppc64le/jq313 mv jq-linux-riscv64 linux/riscv64/jq314 mv jq-linux-s390x linux/s390x/jq315 chmod +x linux/*/jq316 - name: Create Dockerfile317 run: |318 cat <<'EOF' >Dockerfile319 FROM scratch320 ARG TARGETPLATFORM321 COPY AUTHORS COPYING $TARGETPLATFORM/jq /322 RUN ["/jq", "--version"]323 ENTRYPOINT ["/jq"]324 EOF325 - name: Docker metadata326 uses: docker/metadata-action@v5327 id: metadata328 with:329 images: ghcr.io/${{ github.repository }}

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

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

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

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

lines 334–344why, one step back
334 - name: Set up QEMU
335 uses: docker/setup-qemu-action@v3336 - name: Set up Docker Buildx337 uses: docker/setup-buildx-action@v3338 - name: Login to GitHub Container Registry339 uses: docker/login-action@v3340 with:341 registry: ghcr.io342 username: ${{ github.repository_owner }}343 password: ${{ secrets.GITHUB_TOKEN }}344 - name: Build and release Docker image

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

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

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

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

lines 347–348why, one step back
347 with:
348 context: .

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

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

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

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

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

lines 361–365why, one step back
361
362 release:363 runs-on: ubuntu-latest364 permissions:365 contents: write

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

lines 366–367why, one step back
366 id-token: write
367 attestations: write

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

lines 368–375why, one step back
368 pull-requests: write
369 environment: release370 needs: [linux, macos, windows, dist, docker]371 if: startsWith(github.ref, 'refs/tags/jq-')372 steps:373 - name: Clone repository374 uses: actions/checkout@v4375 - name: Download artifacts

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

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

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

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

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

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

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

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

lines 385–388why, one step back
385 cp jq-linux-amd64 jq-linux64
386 cp jq-macos-amd64 jq-osx-amd64387 cp jq-windows-amd64.exe jq-win64.exe388 sha256sum jq-* > sha256sum.txt

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

line 389why, one step back
389 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 390why, one step back
390 gh release upload "$TAG_NAME" --clobber jq-* sha256sum.txt

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

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

lines 395–407why, one step back
395 - name: Import GPG key
396 uses: crazy-max/ghaction-import-gpg@v6397 with:398 gpg_private_key: ${{ secrets.JQ_RELEASE_GPG_PRIVATE_KEY }}399 passphrase: ${{ secrets.JQ_RELEASE_GPG_PASSPHRASE }}400 - name: Update signatures401 env:402 TAG_NAME: ${{ github.ref_name }}403 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}404 run: |405 sig_dir="sig/v${TAG_NAME#jq-}"406 mkdir -p "$sig_dir"407 mv sha256sum.txt "$sig_dir"

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

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

website: use https URLs instead of http URLs in download pageEmanuele Torrebefore adoption1617091

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