Build: Try to unpack Firefox ESR via xz, fall back to bzip2

The `-j` switch passed to `tar` indicates the archive is compressed using the
bzip2 format (`bz2` extension). That was how Firefox used to be compressed until
recently, but the new ESR release now uses xz. Ubuntu `tar` doesn't auto-guess
the encryption algorithm, so to support both, first try with xz and fall back
to bzip2 if that fails.

Note: this will download the old Firefox ESR twice, but it will still work
when the current ESR version starts to use xz with no changes to the code.

Closes gh-5682
Ref gh-5684
This commit is contained in:
Michał Gołębiowski-Owczarek 2025-08-04 23:48:05 +02:00 committed by GitHub
parent 0ef6020295
commit dc5d1f7c61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -72,7 +72,13 @@ jobs:
- name: Install Firefox ESR
run: |
wget --no-verbose $FIREFOX_SOURCE_URL -O - | tar -jx -C ${HOME}
# Support: Firefox <135 only
# Older Firefox used to be compressed using bzip2, newer using xz. Try
# to uncompress using xz, fall back to bzip2 if that fails.
# Note: this will download the old Firefox ESR twice, but it will still work
# when the current ESR version starts to use xz with no changes to the code.
wget --no-verbose "$FIREFOX_SOURCE_URL" -O - | tar -Jx -C "$HOME" || \
wget --no-verbose "$FIREFOX_SOURCE_URL" -O - | tar -jx -C "$HOME"
echo "PATH=${HOME}/firefox:$PATH" >> "$GITHUB_ENV"
echo "FIREFOX_BIN=${HOME}/firefox/firefox" >> "$GITHUB_ENV"
if: contains(matrix.NAME, 'Firefox ESR')