mirror of
https://github.com/upx/upx.git
synced 2025-08-07 22:46:51 +08:00
all: more cleanups; NFCI
This commit is contained in:
45
.github/workflows/ci.yml
vendored
45
.github/workflows/ci.yml
vendored
@ -54,15 +54,15 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { os: ubuntu-20.04, use_m32: false }
|
||||
- { os: ubuntu-22.04, use_m32: true }
|
||||
- { os: ubuntu-20.04, use_m32: false }
|
||||
steps:
|
||||
- name: 'Install extra 32-bit packages'
|
||||
- name: 'Install extra 32-bit and Windows packages'
|
||||
if: ${{ matrix.use_m32 }}
|
||||
run: |
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gcc-multilib g++-multilib
|
||||
sudo apt-get install -y g++-multilib g++-mingw-w64-i686 g++-mingw-w64-x86-64
|
||||
- name: 'Check out code'
|
||||
uses: actions/checkout@v3
|
||||
with: { submodules: true }
|
||||
@ -82,11 +82,17 @@ jobs:
|
||||
- name: 'Build cmake extra/gcc-m32/release'
|
||||
if: ${{ matrix.use_m32 }}
|
||||
run: 'make build/extra/gcc-m32/release'
|
||||
- name: 'Build cmake extra/cross-windows-mingw32/release'
|
||||
if: ${{ matrix.use_m32 }}
|
||||
run: 'make build/extra/cross-windows-mingw32/release'
|
||||
- name: 'Build cmake extra/cross-windows-mingw64/release'
|
||||
if: ${{ matrix.use_m32 }}
|
||||
run: 'make build/extra/cross-windows-mingw64/release'
|
||||
- name: 'Make artifact'
|
||||
run: |
|
||||
N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }}
|
||||
mkdir -p "tmp/artifact/$N"
|
||||
(cd build/extra && cp -ai --parents */*/upx "../../tmp/artifact/$N")
|
||||
(cd build && shopt -s nullglob && cp -ai --parents */upx{,.exe} */*/*/upx{,.exe} "../tmp/artifact/$N")
|
||||
(cd tmp/artifact && tar --sort=name -czf "$N.tar.gz" "$N" && rm -rf "./$N")
|
||||
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||
@ -121,8 +127,7 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- { os: macos-11, gcc: gcc-10, gxx: 'g++-10', testsuite: true }
|
||||
# { os: macos-12, gcc: gcc-11, gxx: 'g++-11', testsuite: true } # disable gcc - XCode 14.0.1 ld bug; supposed to be fixed in 14.1
|
||||
- { os: macos-12, testsuite: true }
|
||||
- { os: macos-12, gcc: gcc-11, gxx: 'g++-11', testsuite: true }
|
||||
steps:
|
||||
- name: 'Install brew packages'
|
||||
if: ${{ matrix.testsuite }}
|
||||
@ -145,11 +150,15 @@ jobs:
|
||||
- name: 'Build cmake extra/gcc/release'
|
||||
if: ${{ matrix.gcc != '' }}
|
||||
run: 'make build/extra/gcc/release CC=${{ matrix.gcc }} CXX=${{ matrix.gxx }}'
|
||||
- name: 'Build cmake xtarget/cross-darwin-arm64/release'
|
||||
run: |
|
||||
export CC="clang -target arm64-apple-darwin" CXX="clang++ -target arm64-apple-darwin"
|
||||
make UPX_XTARGET=cross-darwin-arm64
|
||||
- name: 'Make artifact'
|
||||
run: |
|
||||
N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }}
|
||||
mkdir -p "tmp/artifact/$N"
|
||||
(cd build/extra && rsync -R -a */*/upx "../../tmp/artifact/$N/")
|
||||
(cd build && rsync -R -a */*/*/upx "../tmp/artifact/$N/")
|
||||
(cd tmp/artifact && gtar --sort=name -czf "$N.tar.gz" "$N" && rm -rf "./$N")
|
||||
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||
@ -325,14 +334,17 @@ jobs:
|
||||
needs: [ job-rebuild-and-verify-stubs ]
|
||||
name: ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }}
|
||||
runs-on: ubuntu-latest
|
||||
##container: alpine:3.17 # older versions such as alpine:3.12 also work; no-container also works
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { zig_target: aarch64-linux-musl }
|
||||
- { zig_target: aarch64-macos.11-none }
|
||||
- { zig_target: aarch64-macos.12-none }
|
||||
- { zig_target: aarch64-macos.13-none }
|
||||
- { zig_target: aarch64-windows-gnu }
|
||||
- { zig_target: i386-linux-musl }
|
||||
- { zig_target: i386-windows-gnu }
|
||||
- { zig_target: x86_64-linux-musl }
|
||||
- { zig_target: x86_64-linux-musl, zig_pic: -fPIE }
|
||||
@ -341,18 +353,28 @@ jobs:
|
||||
- { zig_target: x86_64-macos.13-none }
|
||||
- { zig_target: x86_64-windows-gnu }
|
||||
env:
|
||||
# 2023-01-22
|
||||
ZIG_DIST_VERSION: 0.11.0-dev.1413+a51c76541
|
||||
# 2023-01-24
|
||||
ZIG_DIST_VERSION: 0.11.0-dev.1436+59d9afcb5
|
||||
# for zig-cc wrapper scripts (see below):
|
||||
ZIG_CPPFLAGS: -DUPX_DOCTEST_CONFIG_MULTITHREADING
|
||||
ZIG_FLAGS: ${{ matrix.zig_flags }}
|
||||
ZIG_PIC: ${{ matrix.zig_pic }}
|
||||
ZIG_TARGET: ${{ matrix.zig_target }}
|
||||
steps:
|
||||
- name: 'Install Alpine packages'
|
||||
if: ${{ job.container }}
|
||||
shell: sh
|
||||
run: |
|
||||
apk update && apk upgrade && apk add bash cmake file git make tar xz
|
||||
# set PATH like in Ubuntu
|
||||
echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
|
||||
# this seems to be needed when running in a container (beause of UID mismatch??)
|
||||
git config --global --add safe.directory '*'
|
||||
- name: 'Check out code'
|
||||
uses: actions/checkout@v3
|
||||
with: { submodules: true }
|
||||
- name: ${{ format('Install Zig {0}', env.ZIG_DIST_VERSION) }}
|
||||
shell: bash
|
||||
run: |
|
||||
# GitHub Actions magic: set "UPX_GITREV_SHORT" environment value for use in steps below
|
||||
rev=$(git rev-parse --short=7 HEAD)
|
||||
@ -392,11 +414,12 @@ jobs:
|
||||
cmake ../../../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_AR=$HOME/.local/bin/zig-ar -DCMAKE_C_COMPILER=zig-cc -DCMAKE_CXX_COMPILER=zig-cxx -DCMAKE_RANLIB=$HOME/.local/bin/zig-ranlib $EXTRA_CMAKE_CONFIG_FLAGS_DEBUG
|
||||
cmake --build . --config Debug --parallel --verbose
|
||||
file ./upx*
|
||||
- name: ${{ format('Make artifact from upx-{0}-{1}', env.GITHUB_REF_NAME, env.UPX_GITREV_SHORT) }}
|
||||
- name: ${{ format('Make artifact from upx-{0}-{1}', github.ref_name, env.UPX_GITREV_SHORT) }}
|
||||
shell: bash
|
||||
run: |
|
||||
N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-zigcc-${{ matrix.zig_target }}${ZIG_PIC}
|
||||
mkdir -p "tmp/artifact/$N"
|
||||
(cd build && shopt -s nullglob && cp -ai --parents */upx* zig/*/*/upx* "../tmp/artifact/$N")
|
||||
(cd build && shopt -s nullglob && cp -ai --parents */upx{,.exe} */*/*/upx{,.exe} "../tmp/artifact/$N")
|
||||
(cd tmp/artifact && tar --sort=name -czf "$N.tar.gz" "$N" && rm -rf "./$N")
|
||||
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||
|
Reference in New Issue
Block a user