From f63f3493a3bf0ba0102223769616721c84368298 Mon Sep 17 00:00:00 2001 From: gdesmar <75089569+gdesmar@users.noreply.github.com> Date: Thu, 25 Jul 2024 20:08:48 +0000 Subject: [PATCH 1/8] Adding github action --- .github/workflows/build.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..3208505d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +name: innoextract CI + +on: [push] + +jobs: + build_and_test: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install dependencies + run: | + sudo apt update + apt install -y build-essential cmake libboost-all-dev liblzma-dev + - name: Build innoextract + run: | + mkdir -p build + cd build + cmake .. + make + - name: Archive artifacts + uses: actions/upload-artifact@v4 + with: + name: innoextract + path: build/innoextract From aa0e4904a6dc912062e3ac64b7548138f945f28c Mon Sep 17 00:00:00 2001 From: gdesmar <75089569+gdesmar@users.noreply.github.com> Date: Thu, 25 Jul 2024 20:10:41 +0000 Subject: [PATCH 2/8] Fixing apt installs --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3208505d..1a0e9ed6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,8 +10,8 @@ jobs: uses: actions/checkout@v4 - name: Install dependencies run: | - sudo apt update - apt install -y build-essential cmake libboost-all-dev liblzma-dev + sudo apt-get update + sudo apt-get install -y build-essential cmake libboost-all-dev liblzma-dev - name: Build innoextract run: | mkdir -p build From 71d7ce9d013669f39c82f9be279b99e05ee30178 Mon Sep 17 00:00:00 2001 From: gdesmar <75089569+gdesmar@users.noreply.github.com> Date: Thu, 25 Jul 2024 20:43:14 +0000 Subject: [PATCH 3/8] Add release action on tags --- .github/workflows/build.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a0e9ed6..10db61ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,11 @@ name: innoextract CI -on: [push] +on: + push: + # Runs on every pushed commit jobs: - build_and_test: + build: runs-on: ubuntu-latest steps: - name: Checkout repository @@ -23,3 +25,8 @@ jobs: with: name: innoextract path: build/innoextract + - name: Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: build/innoextract From 5ec46732c7052201fd64945ce88249bd5c9f8857 Mon Sep 17 00:00:00 2001 From: gdesmar <75089569+gdesmar@users.noreply.github.com> Date: Fri, 26 Jul 2024 15:38:17 +0000 Subject: [PATCH 4/8] Statically compile and strip the executable --- .github/workflows/build.yml | 8 +++++++- src/stream/slice.cpp | 5 ++++- src/util/encoding.cpp | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10db61ea..2d1ff811 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,9 @@ on: jobs: build: runs-on: ubuntu-latest + # Forced to run on debian:buster since debian:bullseye's Boost is not + # functional to compile executables statically WITH bz2 and lzma. + container: debian:buster steps: - name: Checkout repository uses: actions/checkout@v4 @@ -14,12 +17,15 @@ jobs: run: | sudo apt-get update sudo apt-get install -y build-essential cmake libboost-all-dev liblzma-dev + # Only because we are running on debian:buster + sudo apt-get install -y zlib1g-dev libbz2-dev - name: Build innoextract run: | mkdir -p build cd build - cmake .. + cmake -DUSE_STATIC_LIBS=ON .. make + strip innoextract - name: Archive artifacts uses: actions/upload-artifact@v4 with: diff --git a/src/stream/slice.cpp b/src/stream/slice.cpp index 9a76f30d..0e3f402e 100644 --- a/src/stream/slice.cpp +++ b/src/stream/slice.cpp @@ -27,7 +27,10 @@ #include #include #include -#include +// Debian Buster has Boost Filesystem 1.67.0.1 installed by default +// directory.hpp was split from the main in 1.72 +// https://www.boost.org/users/history/version_1_72_0.html +// #include #include "util/console.hpp" #include "util/load.hpp" diff --git a/src/util/encoding.cpp b/src/util/encoding.cpp index 3cb88be8..39fc7b56 100644 --- a/src/util/encoding.cpp +++ b/src/util/encoding.cpp @@ -72,6 +72,7 @@ #include "util/log.hpp" #include "util/math.hpp" +#include namespace util { From a2d79a2d0c32e4eff1e708429af297e15ea500a6 Mon Sep 17 00:00:00 2001 From: gdesmar <75089569+gdesmar@users.noreply.github.com> Date: Fri, 26 Jul 2024 15:40:09 +0000 Subject: [PATCH 5/8] No sudo in the container --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d1ff811..5e1b4bb6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,10 +15,10 @@ jobs: uses: actions/checkout@v4 - name: Install dependencies run: | - sudo apt-get update - sudo apt-get install -y build-essential cmake libboost-all-dev liblzma-dev + apt-get update + apt-get install -y build-essential cmake libboost-all-dev liblzma-dev # Only because we are running on debian:buster - sudo apt-get install -y zlib1g-dev libbz2-dev + apt-get install -y zlib1g-dev libbz2-dev - name: Build innoextract run: | mkdir -p build From 753648d0f68f8e6bf45864d083915ef35a171435 Mon Sep 17 00:00:00 2001 From: gdesmar <75089569+gdesmar@users.noreply.github.com> Date: Fri, 26 Jul 2024 16:30:12 +0000 Subject: [PATCH 6/8] Fix typo in comment --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5e1b4bb6..ff11e343 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: build: runs-on: ubuntu-latest # Forced to run on debian:buster since debian:bullseye's Boost is not - # functional to compile executables statically WITH bz2 and lzma. + # functional to compile executables statically with bz2 and lzma. container: debian:buster steps: - name: Checkout repository From 36a3df751740a0c1cca44bd72f9341b90a1bec74 Mon Sep 17 00:00:00 2001 From: gdesmar <75089569+gdesmar@users.noreply.github.com> Date: Fri, 26 Jul 2024 16:32:17 +0000 Subject: [PATCH 7/8] zlib is problematic, not lzma --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff11e343..4d000f88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: build: runs-on: ubuntu-latest # Forced to run on debian:buster since debian:bullseye's Boost is not - # functional to compile executables statically with bz2 and lzma. + # functional to compile executables statically with bz2 and zlip. container: debian:buster steps: - name: Checkout repository From 41705142787a82b7e8c4dedf94740a704ff5a543 Mon Sep 17 00:00:00 2001 From: gdesmar <75089569+gdesmar@users.noreply.github.com> Date: Fri, 26 Jul 2024 16:32:46 +0000 Subject: [PATCH 8/8] Fix typo in comment --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d000f88..98c5c6a4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: build: runs-on: ubuntu-latest # Forced to run on debian:buster since debian:bullseye's Boost is not - # functional to compile executables statically with bz2 and zlip. + # functional to compile executables statically with bz2 and zlib. container: debian:buster steps: - name: Checkout repository