Skip to content

Commit

Permalink
CI: Build static and shared, publish headers and libjq too
Browse files Browse the repository at this point in the history
  • Loading branch information
nicowilliams committed Jan 19, 2024
1 parent 1f1e619 commit f9e95f5
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,14 @@ jobs:
--disable-docs \
--disable-valgrind \
--with-oniguruma=builtin \
--enable-shared \
--enable-static \
--enable-all-static \
CFLAGS="-O2 -pthread -fstack-protector-all"
make -j"$(nproc)"
file ./jq
cp ./jq jq-${{ env.SUFFIX }}
mkdir jq-${{ env.SUFFIX }}
cp src/jv.h src/jq.h src/.libs/libjq* ./jq jq-${{ env.SUFFIX }}
- name: Test
# Only run tests for amd64 matching the CI machine arch
if: ${{ matrix.arch == 'amd64' }}
Expand Down Expand Up @@ -157,6 +159,7 @@ jobs:
--disable-docs \
--disable-valgrind \
--with-oniguruma=builtin \
--enable-shared \
--enable-static \
--enable-all-static \
CFLAGS="-O2 -pthread -fstack-protector-all"
Expand Down Expand Up @@ -233,7 +236,7 @@ jobs:
--disable-docs \
--disable-valgrind \
--with-oniguruma=builtin \
--disable-shared \
--enable-shared \
--enable-static \
--enable-all-static \
CFLAGS="-O2 -pthread -fstack-protector-all"
Expand Down Expand Up @@ -308,14 +311,15 @@ jobs:
- name: Move executables
run: |
mkdir -p linux/{386,amd64,arm64,mips64le,ppc64le,riscv64,s390x}
mv jq-linux-i386 linux/386/jq
mv jq-linux-amd64 linux/amd64/jq
mv jq-linux-arm64 linux/arm64/jq
mv jq-linux-mips64el linux/mips64le/jq
mv jq-linux-ppc64el linux/ppc64le/jq
mv jq-linux-riscv64 linux/riscv64/jq
mv jq-linux-s390x linux/s390x/jq
mv jq-linux-i386/* linux/386/
mv jq-linux-amd64/* linux/amd64/
mv jq-linux-arm64/* linux/arm64/
mv jq-linux-mips64el/* linux/mips64le/
mv jq-linux-ppc64el/* linux/ppc64le/
mv jq-linux-riscv64/* linux/riscv64/
mv jq-linux-s390x/* linux/s390x/
chmod +x linux/*/jq
ls -F linux/{386,amd64,arm64,mips64le,ppc64le,riscv64,s390x}
- name: Create Dockerfile
run: |
cat <<'EOF' >Dockerfile
Expand Down Expand Up @@ -373,6 +377,9 @@ jobs:
TAG_NAME: ${{ github.ref_name }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# These are for backwards compatibility with previous
# releases' URI local parts that get baked into users'
# recipes.
cp jq-linux-amd64 jq-linux64
cp jq-macos-amd64 jq-osx-amd64
cp jq-windows-amd64.exe jq-win64.exe
Expand Down

0 comments on commit f9e95f5

Please sign in to comment.