aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorumarcor <unai.martinezcorral@ehu.eus>2021-06-29 13:39:41 +0200
committerumarcor <unai.martinezcorral@ehu.eus>2021-07-18 23:53:08 +0200
commit914a44d996f6d8cf4b8db400391f39a99a14e8cd (patch)
treedf564d6374ff979e5e56cb585b4b59023f5a7f89
parentd60d674c8d83573286766ffbbaa160f1bd08360c (diff)
downloadghdl-914a44d996f6d8cf4b8db400391f39a99a14e8cd.tar.gz
ghdl-914a44d996f6d8cf4b8db400391f39a99a14e8cd.tar.bz2
ghdl-914a44d996f6d8cf4b8db400391f39a99a14e8cd.zip
ci: generate standalone zipfiles
-rw-r--r--.github/workflows/Test.yml64
-rw-r--r--scripts/msys2-mcode/GetStandaloneDeps.sh17
2 files changed, 80 insertions, 1 deletions
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
@@ -366,12 +366,74 @@ jobs:
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