From 914a44d996f6d8cf4b8db400391f39a99a14e8cd Mon Sep 17 00:00:00 2001 From: umarcor Date: Tue, 29 Jun 2021 13:39:41 +0200 Subject: ci: generate standalone zipfiles --- .github/workflows/Test.yml | 64 +++++++++++++++++++++++++++++++- scripts/msys2-mcode/GetStandaloneDeps.sh | 17 +++++++++ 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 scripts/msys2-mcode/GetStandaloneDeps.sh diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index d6a3bac45..83bafbb07 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -365,13 +365,75 @@ jobs: ghdl-dom help ghdl-ls --help +# +# Windows Generate Standalone ZipFile +# + + win-generate-standalone-zip: + needs: win-build + runs-on: windows-latest + strategy: + fail-fast: false + max-parallel: 2 + matrix: + include: [ + {icon: '🟪', installs: 'MINGW32', arch: i686 }, + {icon: '🟦', installs: "MINGW64", arch: x86_64 }, #! simulation with mcode is not yet supported on win64 + ] + name: '${{ matrix.icon }} Deps · ${{ matrix.installs }} · mcode' + defaults: + run: + shell: msys2 {0} + steps: + + - name: '${{ matrix.icon }} Setup MSYS2' + uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.installs }} + update: true + install: >- + tree + zstd + zip + tar + + - name: '⚙️ git config' + run: git config --global core.autocrlf input + shell: bash + + - name: '🧰 Checkout' + uses: actions/checkout@v2 + + - name: '📥 Download artifact: package' + uses: actions/download-artifact@v2 + + - name: '🚧 Install package' + run: pacman --noconfirm -U artifact/mingw-w64-${{ matrix.arch }}-ghdl-mcode-*.zst + + - name: '🥡 Generate standalone zipfile' + run: | + _zipdir="${{ matrix.installs }}-mcode-standalone" + mkdir -p "${_zipdir}"-extract + tar xf artifact/mingw-w64-${{ matrix.arch }}-ghdl-mcode-*.zst -C "${_zipdir}"-extract + cd "${_zipdir}-extract/${{ matrix.installs }}"/bin + ../../../scripts/msys2-mcode/GetStandaloneDeps.sh + cd ../../.. + mv "${_zipdir}"-extract/mingw${{ matrix.bits }} "${_zipdir}" + tree "${_zipdir}" + zip "${_zipdir}".zip -r "${_zipdir}" + + - name: '📤 Upload artifact: zipfile' + uses: actions/upload-artifact@v2 + with: + path: ${{ matrix.installs }}-mcode-standalone.zip + # # Release # Release: if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/')) - needs: [ doc, lin, osx, win-test, win-pip ] + needs: [ doc, lin, osx, win-test, win-pip, win-generate-standalone-zip ] runs-on: ubuntu-latest name: '📦 Release' steps: diff --git a/scripts/msys2-mcode/GetStandaloneDeps.sh b/scripts/msys2-mcode/GetStandaloneDeps.sh new file mode 100644 index 000000000..a5720fc5a --- /dev/null +++ b/scripts/msys2-mcode/GetStandaloneDeps.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +GetMinGWLibraries() { + ldd "${MSYSTEM_PREFIX}/$1" | while IFS="" read -r dependency; do + fields=($dependency) + dep="${fields[2]}" + if [[ "$dep" == /"${MSYSTEM,,}"/* ]]; then + echo "$dep" + GetMinGWLibraries "${dep#"/${MSYSTEM,,}/"}" + fi + done +} + +for dep in $(GetMinGWLibraries "lib/libghdl-2_0_0_dev.dll"); do + echo "$dep" + cp "$dep" ./ +done -- cgit v1.2.3