diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77f405aa..6d712a7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# Support for GitHub Actions -- https://github.com/features/actions +# Copyright (C) Markus Franz Xaver Johannes Oberhumer # note: GitHub Actions runner images are frequently updated, and # unfortunately this sometimes breaks builds in mysterious ways... @@ -94,7 +94,7 @@ jobs: run: 'make build/extra/cross-windows-mingw64/release' - name: 'Make artifact' run: | - N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }} + N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') mkdir -p "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") @@ -170,7 +170,7 @@ jobs: make UPX_XTARGET=cross-darwin-arm64 xtarget/release - name: 'Make artifact' run: | - N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }} + N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') mkdir -p "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") @@ -232,7 +232,7 @@ jobs: - name: 'Make artifact' shell: bash run: | - N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }} + N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') mkdir -p "tmp/artifact/$N" (cd build && cp -ai --parents */*/upx.exe "../tmp/artifact/$N") # GitHub Actions magic: set "artifact_name" environment value for use in next step @@ -333,7 +333,7 @@ jobs: - name: 'Make artifact' shell: bash run: | - N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-windows-${{ matrix.name }} + N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-windows-${{ matrix.name }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') mkdir -p "tmp/artifact/$N/$B" cp -ai build/$C/$B/upx/upx*.exe "tmp/artifact/$N/$B" # GitHub Actions magic: set "artifact_name" environment value for use in next step @@ -459,7 +459,7 @@ jobs: - 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} + N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-zigcc-${{ matrix.zig_target }}${ZIG_PIC}" | sed 's/[^0-9a-zA-Z_.-]/-/g') mkdir -p "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") diff --git a/.github/workflows/github-close-inactive-issues.yml b/.github/workflows/github-close-inactive-issues.yml index ae9cdc23..3b8da8ea 100644 --- a/.github/workflows/github-close-inactive-issues.yml +++ b/.github/workflows/github-close-inactive-issues.yml @@ -1,3 +1,5 @@ +# Copyright (C) Markus Franz Xaver Johannes Oberhumer + # see https://docs.github.com/en/actions/managing-issues-and-pull-requests/closing-inactive-issues # see https://github.com/actions/stale diff --git a/.github/workflows/github-close-pull-requests.yml b/.github/workflows/github-close-pull-requests.yml index dd68947e..a8c9d540 100644 --- a/.github/workflows/github-close-pull-requests.yml +++ b/.github/workflows/github-close-pull-requests.yml @@ -1,3 +1,4 @@ +# Copyright (C) Markus Franz Xaver Johannes Oberhumer name: 'GitHub - Close pull requests' on: #pull_request: diff --git a/.github/workflows/misc-spell-check.yml b/.github/workflows/misc-spell-check.yml index cbf19bbc..a39884e5 100644 --- a/.github/workflows/misc-spell-check.yml +++ b/.github/workflows/misc-spell-check.yml @@ -1,3 +1,4 @@ +# Copyright (C) Markus Franz Xaver Johannes Oberhumer # see https://github.com/crate-ci/typos name: 'Misc - Spell check' diff --git a/.github/workflows/static-analyzer-clang.yml b/.github/workflows/static-analyzer-clang.yml index b8313c2b..74462355 100644 --- a/.github/workflows/static-analyzer-clang.yml +++ b/.github/workflows/static-analyzer-clang.yml @@ -1,3 +1,4 @@ +# Copyright (C) Markus Franz Xaver Johannes Oberhumer name: 'Static Analyzer - clang scan-build' on: diff --git a/.github/workflows/static-analyzer-codeql.yml b/.github/workflows/static-analyzer-codeql.yml index 678e39b0..4149c760 100644 --- a/.github/workflows/static-analyzer-codeql.yml +++ b/.github/workflows/static-analyzer-codeql.yml @@ -1,3 +1,4 @@ +# Copyright (C) Markus Franz Xaver Johannes Oberhumer name: 'Static Analyzer - CodeQL' on: diff --git a/.github/workflows/test-alpine-linux.yml b/.github/workflows/test-alpine-linux.yml index 8ed32c3b..31180f68 100644 --- a/.github/workflows/test-alpine-linux.yml +++ b/.github/workflows/test-alpine-linux.yml @@ -1,3 +1,4 @@ +# Copyright (C) Markus Franz Xaver Johannes Oberhumer # test minimal number of packages required for building UPX under Alpine Linux # clang: apk add clang cmake make # gcc: apk add cmake g++ make @@ -22,7 +23,8 @@ jobs: make -C build/debug test make -C build/release test make -C build/release install DESTDIR="$PWD/Install" - echo "artifact_name=upx-test-alpine-linux-clang-${{ matrix.container }}" | sed 's/[^=0-9a-zA-Z_.-]/-/g' >> $GITHUB_ENV + N=$(echo "upx-test-alpine-linux-clang-${{ matrix.container }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') + echo "artifact_name=$N" >> $GITHUB_ENV - name: ${{ format('Upload artifact {0}', env.artifact_name) }} if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: missing nodejs on host uses: actions/upload-artifact@v3 @@ -46,7 +48,8 @@ jobs: make -C build/debug test make -C build/release test make -C build/release install DESTDIR="$PWD/Install" - echo "artifact_name=upx-test-alpine-linux-gcc-${{ matrix.container }}" | sed 's/[^=0-9a-zA-Z_.-]/-/g' >> $GITHUB_ENV + N=$(echo "upx-test-alpine-linux-gcc-${{ matrix.container }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') + echo "artifact_name=$N" >> $GITHUB_ENV - name: ${{ format('Upload artifact {0}', env.artifact_name) }} if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: missing nodejs on host uses: actions/upload-artifact@v3 diff --git a/.github/workflows/weekly-ci-alpine.yml b/.github/workflows/weekly-ci-alpine-linux.yml similarity index 93% rename from .github/workflows/weekly-ci-alpine.yml rename to .github/workflows/weekly-ci-alpine-linux.yml index d617ad84..e8965f1e 100644 --- a/.github/workflows/weekly-ci-alpine.yml +++ b/.github/workflows/weekly-ci-alpine-linux.yml @@ -1,3 +1,4 @@ +# Copyright (C) Markus Franz Xaver Johannes Oberhumer # build under various Alpine Linux versions with clang and gcc # info: Alpine 3.9 has clang-5, cmake-3.13.0 and gcc-8, which nicely @@ -33,7 +34,8 @@ jobs: git -C upx submodule update --init x="$(apk list -I "$(apk info -Wq "$(which clang)")")"; echo "clang_package=${x%% *}" >> $GITHUB_ENV x="$(apk list -I "$(apk info -Wq "$(which gcc)")")"; echo "gcc_package=${x%% *}" >> $GITHUB_ENV - echo "artifact_name=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-weekly-ci-alpine-${{ matrix.container }}" | sed 's/[^=0-9a-zA-Z_.-]/-/g' >> $GITHUB_ENV + N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-weekly-ci-alpine-${{ matrix.container }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') + echo "artifact_name=$N" >> $GITHUB_ENV # build with C++17 - name: ${{ format('Build clang Release with {0}', env.clang_package) }} @@ -72,22 +74,22 @@ jobs: if: ${{ contains(matrix.container, ':edge') }} run: | export UPX_CMAKE_CONFIG_FLAGS='-DUPX_CONFIG_DISABLE_CXX_STANDARD=ON -DCMAKE_VERBOSE_MAKEFILE=ON' - make -C upx UPX_XTARGET=clang-cxx23-static CC="clang -static" CXX="clang++ -std=gnu++2b -static" + make -C upx UPX_XTARGET=clang-cxx23-static CC="clang -static" CXX="clang++ -std=gnu++23 -static" - name: ${{ format('Build clang C++23 Debug with {0}', env.clang_package) }} if: ${{ contains(matrix.container, ':edge') }} run: | export UPX_CMAKE_CONFIG_FLAGS='-DUPX_CONFIG_DISABLE_CXX_STANDARD=ON -DCMAKE_VERBOSE_MAKEFILE=ON' - make -C upx UPX_XTARGET=clang-cxx23-static CC="clang -static" CXX="clang++ -std=gnu++2b -static" xtarget/debug + make -C upx UPX_XTARGET=clang-cxx23-static CC="clang -static" CXX="clang++ -std=gnu++23 -static" xtarget/debug - name: ${{ format('Build gcc C++23 Release with {0}', env.gcc_package) }} if: ${{ contains(matrix.container, ':edge') }} run: | export UPX_CMAKE_CONFIG_FLAGS='-DUPX_CONFIG_DISABLE_CXX_STANDARD=ON -DCMAKE_VERBOSE_MAKEFILE=ON' - make -C upx UPX_XTARGET=gcc-cxx23-static CC="gcc -static" CXX="g++ -std=gnu++2b -static" + make -C upx UPX_XTARGET=gcc-cxx23-static CC="gcc -static" CXX="g++ -std=gnu++23 -static" - name: ${{ format('Build gcc C++23 Debug with {0}', env.gcc_package) }} if: ${{ contains(matrix.container, ':edge') }} run: | export UPX_CMAKE_CONFIG_FLAGS='-DUPX_CONFIG_DISABLE_CXX_STANDARD=ON -DCMAKE_VERBOSE_MAKEFILE=ON' - make -C upx UPX_XTARGET=gcc-cxx23-static CC="gcc -static" CXX="g++ -std=gnu++2b -static" xtarget/debug + make -C upx UPX_XTARGET=gcc-cxx23-static CC="gcc -static" CXX="g++ -std=gnu++23 -static" xtarget/debug - { name: 'Strip release binaries', run: 'strip -p --strip-unneeded upx/build/*/*/release/upx' } - name: ${{ format('Upload artifact {0}', env.artifact_name) }} diff --git a/.github/workflows/weekly-ci-macos-cmake-xcode.yml b/.github/workflows/weekly-ci-cmake-macos-xcode.yml similarity index 61% rename from .github/workflows/weekly-ci-macos-cmake-xcode.yml rename to .github/workflows/weekly-ci-cmake-macos-xcode.yml index 87dcddbb..36d382bd 100644 --- a/.github/workflows/weekly-ci-macos-cmake-xcode.yml +++ b/.github/workflows/weekly-ci-cmake-macos-xcode.yml @@ -1,13 +1,14 @@ +# Copyright (C) Markus Franz Xaver Johannes Oberhumer # build with 'cmake -G Xcode' -name: 'Weekly CI - macOS cmake Xcode' +name: 'Weekly CI - cmake macOS Xcode' on: schedule: [cron: '20 4 * * 3'] # run weekly Wednesday 04:20 UTC workflow_dispatch: jobs: - job-macos-cmake-xcode: + job-cmake-macos-xcode: name: ${{ format('{0} cmake Xcode', matrix.os) }} runs-on: ${{ matrix.os }} strategy: @@ -22,8 +23,22 @@ jobs: uses: actions/checkout@v3 with: { submodules: true } - { name: 'Config cmake Xcode', run: 'cmake -S . -B build/xcode -G Xcode' } + - { name: 'Build cmake Xcode default', run: 'cmake --build build/xcode' } - { name: 'Build cmake Xcode Debug', run: 'cmake --build build/xcode --config Debug' } - { name: 'Build cmake Xcode Release', run: 'cmake --build build/xcode --config Release' } + - name: 'Make artifact' + run: | + N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-weekly-ci-xcode-${{ matrix.os }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') + mkdir -p "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 + - name: ${{ format('Upload artifact {0}', env.artifact_name) }} + uses: actions/upload-artifact@v3 + with: + name: ${{ env.artifact_name }} + path: tmp/artifact - name: 'Run basic tests' if: ${{ matrix.run_test }} run: | diff --git a/.github/workflows/weekly-ci-windows-cmake-nmake.yml b/.github/workflows/weekly-ci-cmake-windows-nmake.yml similarity index 68% rename from .github/workflows/weekly-ci-windows-cmake-nmake.yml rename to .github/workflows/weekly-ci-cmake-windows-nmake.yml index 7a3bd7f2..36fef233 100644 --- a/.github/workflows/weekly-ci-windows-cmake-nmake.yml +++ b/.github/workflows/weekly-ci-cmake-windows-nmake.yml @@ -1,13 +1,14 @@ +# Copyright (C) Markus Franz Xaver Johannes Oberhumer # build with 'cmake -G "NMake Makefiles"' -name: 'Weekly CI - Windows cmake NMake' +name: 'Weekly CI - cmake Windows NMake' on: schedule: [cron: '30 4 * * 3'] # run weekly Wednesday 04:30 UTC workflow_dispatch: jobs: - job-windows-cmake-nmake: + job-cmake-windows-nmake: name: ${{ format('{0} {1}', matrix.os, matrix.arch) }} runs-on: ${{ matrix.os }} strategy: @@ -43,6 +44,19 @@ jobs: cd build/release nmake dir *.exe + - name: 'Make artifact' + shell: bash + run: | + N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-weekly-ci-nmake-${{ matrix.os }}-${{ matrix.arch }}" | sed 's/[^0-9a-zA-Z_.-]/-/g') + mkdir -p "tmp/artifact/$N" + (cd build && cp -ai --parents */upx.exe "../tmp/artifact/$N") + # GitHub Actions magic: set "artifact_name" environment value for use in next step + echo "artifact_name=$N" >> $GITHUB_ENV + - name: ${{ format('Upload artifact {0}', env.artifact_name) }} + uses: actions/upload-artifact@v3 + with: + name: ${{ env.artifact_name }} + path: tmp/artifact - name: 'Run basic tests' if: ${{ matrix.arch != 'amd64_arm64' }} shell: cmd diff --git a/.github/workflows/weekly-ci-zigcc.yml b/.github/workflows/weekly-ci-zigcc.yml index e6f0728e..01e8aad4 100644 --- a/.github/workflows/weekly-ci-zigcc.yml +++ b/.github/workflows/weekly-ci-zigcc.yml @@ -1,3 +1,4 @@ +# Copyright (C) Markus Franz Xaver Johannes Oberhumer # build with "zig cc"; see https://ziglang.org/download/ name: 'Weekly CI - zigcc' @@ -103,7 +104,7 @@ jobs: - 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}-weekly-ci-zigcc-${{ matrix.zig_target }}${ZIG_PIC} + N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-weekly-ci-zigcc-${{ matrix.zig_target }}${ZIG_PIC}" | sed 's/[^0-9a-zA-Z_.-]/-/g') mkdir -p "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")