Skip to content

Commit

Permalink
Merge pull request #14 from mseri/test
Browse files Browse the repository at this point in the history
Update workflow to collect required windows dlls
  • Loading branch information
mseri authored Feb 2, 2022
2 parents 3b117bb + f41ed4c commit cd7ac3a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/scripts/win.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
dir="_build/default/bin"
OUTPUT="out"
mkdir "$OUTPUT"
for exe in "$dir/"*.exe ; do
for dll in $(PATH="/usr/x86_64-w64-mingw32/sys-root/mingw/bin:$PATH" cygcheck "$exe" | grep -F x86_64-w64-mingw32 | sed -e 's/^ *//'); do
if [ ! -e "$OUTPUT/$(basename "$dll")" ] ; then
echo "Extracting $dll for $exe"
cp "$dll" "$OUTPUT/"
else
echo "$exe uses $dll (already extracted)"
fi
done
echo "Extracted $exe"
cp "$exe" "$OUTPUT/"
done
10 changes: 9 additions & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
uses: ocaml/setup-ocaml@v2
with:
ocaml-version: ${{ matrix.ocaml-version }}
dune-cache: true

- name: Set git user
run: |
Expand Down Expand Up @@ -95,8 +96,15 @@ jobs:
run: opam exec -- dune build -p doi2bib

- name: Create release archive
if: ${{ startsWith(github.ref, 'refs/tags/') }}
if: ${{ startsWith(github.ref, 'refs/tags/') && !startsWith(runner.os, 'Win') }}
run: opam exec -- tar czf release.tar.gz -C _build/default/bin/ doi2bib.exe

- name: Create release archive (Windows)
if: ${{ startsWith(github.ref, 'refs/tags/') && startsWith(runner.os, 'Win') }}
run: |
opam exec -- dos2unix .github/scripts/win.sh
opam exec -- bash .github/scripts/win.sh
opam exec -- tar czf release.tar.gz out/
- name: Upload build artifact
if: ${{ startsWith(github.ref, 'refs/tags/') }}
Expand Down

0 comments on commit cd7ac3a

Please sign in to comment.