From 0faf0fb360fc97035d6c94b62715ea7b3e9b3819 Mon Sep 17 00:00:00 2001 From: Simone Date: Sat, 2 May 2026 20:06:58 +0200 Subject: [PATCH] ci: add Linux jobs to build and release workflows --- .github/workflows/build.yml | 55 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 47 +++++++++++++++++++++++++++++- 2 files changed, 101 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2190f2e..58190f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,3 +70,58 @@ jobs: path: dist/** if-no-files-found: error retention-days: 30 + + build-linux: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + config: [x86-ansi, x86-unicode, x64-unicode] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install MinGW toolchain + run: | + sudo apt-get update + sudo apt-get install -y \ + make \ + binutils-mingw-w64-i686 \ + binutils-mingw-w64-x86-64 \ + g++-mingw-w64-i686 \ + g++-mingw-w64-x86-64 + + - name: Read VERSION + id: version_linux + run: | + v="$(tr -d '\r\n' < VERSION)" + echo "version=$v" >> "$GITHUB_OUTPUT" + + - name: Build ${{ matrix.config }} on Linux + run: python build_plugin.py --host linux --configs ${{ matrix.config }} --verbose + + - name: Collect DLL + run: | + case "${{ matrix.config }}" in + x86-ansi) dir="x86-ansi" ;; + x86-unicode) dir="x86-unicode" ;; + x64-unicode) dir="amd64-unicode" ;; + esac + dst="dist/${{ matrix.config }}" + mkdir -p "$dst" + cp "plugins/$dir/nsis7z.dll" "$dst/" + + - name: Upload DLL + uses: actions/upload-artifact@v4 + with: + name: ${{ github.event.repository.name }}-${{ steps.version_linux.outputs.version }}-${{ matrix.config }}-linux + path: dist/** + if-no-files-found: error + retention-days: 30 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e4cf67d..d236698 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,8 +68,53 @@ jobs: name: pkg-${{ matrix.config }} path: '*.zip' + build-linux: + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + config: [x86-ansi, x86-unicode, x64-unicode] + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install MinGW toolchain + run: | + sudo apt-get update + sudo apt-get install -y \ + make \ + binutils-mingw-w64-i686 \ + binutils-mingw-w64-x86-64 \ + g++-mingw-w64-i686 \ + g++-mingw-w64-x86-64 + + - name: Build ${{ matrix.config }} on Linux + run: python build_plugin.py --host linux --configs ${{ matrix.config }} + + - name: Collect DLL + run: | + case "${{ matrix.config }}" in + x86-ansi) dir="x86-ansi" ;; + x86-unicode) dir="x86-unicode" ;; + x64-unicode) dir="amd64-unicode" ;; + esac + dst="dist/${{ matrix.config }}" + mkdir -p "$dst" + cp "plugins/$dir/nsis7z.dll" "$dst/" + + - uses: actions/upload-artifact@v4 + with: + name: linux-build-${{ matrix.config }} + path: dist/** + if-no-files-found: error + publish: - needs: build + needs: [build, build-linux] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4