Skip to content

Commit 85bfa90

Browse files
committed
tools: reduce source tarball compression in CI
Make source-tarball gzip compression configurable, keeping level 9 as the default. Use level 6 in build-tarball and test-shared to reduce tarball creation time with a small increase in archive size. Refs: #66228 (comment) Assisted-by: Codex Signed-off-by: inoway46 <inoueyuya416@gmail.com>
1 parent 3d85c94 commit 85bfa90

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎.github/workflows/build-tarball.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
export DISTTYPE=nightly
9595
export DATESTRING=$(date "+%Y-%m-%d")
9696
export COMMIT=$(git rev-parse --short=10 "$GITHUB_SHA")
97-
./configure && make tar -j4 SKIP_XZ=1
97+
./configure && make tar -j4 SKIP_XZ=1 GZIP_COMPRESSION=6
9898
- name: Upload tarball artifact
9999
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
100100
with:

‎.github/workflows/test-shared.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
run: |
134134
export DATESTRING=$(date "+%Y-%m-%d")
135135
export COMMIT=$(git rev-parse --short=10 "$GITHUB_SHA")
136-
./configure && make tar -j4 SKIP_XZ=1 SKIP_SHARED_DEPS=1
136+
./configure && make tar -j4 SKIP_XZ=1 SKIP_SHARED_DEPS=1 GZIP_COMPRESSION=6
137137
env:
138138
DISTTYPE: nightly
139139

‎Makefile‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,8 @@ HAS_XZ ?= $(shell command -v xz > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || ech
11131113
SKIP_XZ ?= 0
11141114
XZ = $(shell [ $(HAS_XZ) -eq 1 ] && [ $(SKIP_XZ) -eq 0 ] && echo 1 || echo 0)
11151115
XZ_COMPRESSION ?= 9e
1116+
# Compression level for source tarballs.
1117+
GZIP_COMPRESSION ?= 9
11161118
PKG=$(TARNAME).pkg
11171119
MACOSOUTDIR=out/macos
11181120

@@ -1345,7 +1347,7 @@ endif
13451347
find $(TARNAME)/ -type l | xargs $(RM)
13461348
tar -cf $(TARNAME).tar $(TARNAME)
13471349
$(RM) -r $(TARNAME)
1348-
gzip -c -f -9 $(TARNAME).tar > $(TARNAME).tar.gz
1350+
gzip -c -f -$(GZIP_COMPRESSION) $(TARNAME).tar > $(TARNAME).tar.gz
13491351
ifeq ($(XZ), 1)
13501352
xz -c -f -$(XZ_COMPRESSION) $(TARNAME).tar > $(TARNAME).tar.xz
13511353
endif

0 commit comments

Comments
 (0)