diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0bdb0478..c3eb050c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -126,6 +126,109 @@ jobs: name: archives-${{ matrix.config.os }}-${{ matrix.config.arch }} path: new_release/* + windows-build: + strategy: + fail-fast: false + matrix: + config: + - { name: "windows", os: "windows-2022", arch: "x86_64", target: "x64" } + ocaml-compiler: + - 4.14.x + runs-on: ${{ matrix.config.os }} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Fetch tags + run: git fetch --tags --force origin + + - uses: actions/cache@v5 + id: wincache + with: + path: | + ~/.opam + _opam + key: windows-${{ hashFiles('*.opam') }}-ocaml.5.4 + + - name: Install OCaml ${{ matrix.ocaml-compiler }} + uses: ocaml/setup-ocaml@v3 + with: + cache-prefix: v4 + ocaml-compiler: 5.4 + opam-pin: false + + - name: Install dependencies + if: steps.wincache.outputs.cache-hit != 'true' + run: opam install conf-gmp + + - name: Install dependencies + if: steps.wincache.outputs.cache-hit != 'true' + run: opam install conf-libssl + + - name: Install dependencies + if: steps.wincache.outputs.cache-hit != 'true' + run: opam install conf-pkg-config + + - name: Install dependencies + if: steps.wincache.outputs.cache-hit != 'true' + run: opam install conf-gmp-powm-sec + + - name: Install dependencies + if: steps.wincache.outputs.cache-hit != 'true' + run: opam install --deps-only --with-test --with-doc -y . + + - name: Install dependencies + if: steps.wincache.outputs.cache-hit + run: opam install --deps-only --with-test --depext-only --with-doc -y . && opam upgrade + # Just to test caching + - name: Try building + run: opam exec -- dune build --ignore-promoted-rules + + - name: Uninstall 32-bit packages + run: > + C:\.opam\.cygwin\setup-x86_64.exe + --root "C:\.opam\.cygwin\root" + --quiet-mode + --remove-packages mingw64-i686-gcc-core,mingw64-i686-gmp,mingw64-i686-libffi,mingw64-i686-openssl + #mingw64-x86_64-gmp,mingw64-x86_64-libffi,mingw64-x86_64-openssl,pkgconf + + - name: Try depexts + run: opam list --required-by slipshow --external --recursive + + - name: Nuke 32-bit cygwin dlls + run: | + $bad_path = "C:\.opam\.cygwin\root\usr\i686-w64-mingw32\sys-root\mingw\bin" + if (Test-Path $bad_path) { + Remove-Item -Path "$bad_path\*.dll" -Force + } + + - name: Install 64-bit packages + run: > + C:\.opam\.cygwin\setup-x86_64.exe "--root" "C:\\.opam\\.cygwin\\root" "--quiet-mode" "noinput" "--no-shortcuts" "--no-startmenu" "--no-desktop" "--no-admin" "--no-version-check" "--no-write-registry" "--packages" "mingw64-x86_64-gcc-core" "--symlink-type" "native" "--upgrade-also" "--only-site" "--site" "https://cygwin.mirror.constant.com/" "--local-package-dir" "C:\\.opam\\.cygwin\\cache" + + - name: Install WiX 6 (required by OUI for Windows MSI) + shell: pwsh + run: | + dotnet tool install --global wix --version 7.0.0 + wix eula accept wix7 + wix extension add WixToolset.UI.wixext + wix extension add WixToolset.Util.wixext + + - name: install oui + run: opam install oui + + - name: run installer + run: mkdir -p bundle/bin/slipshow/ && cp _build/install/default/bin/slipshow* bundle/bin && opam exec -- oui build oui.json bundle && mkdir -p installer-file && cp slipshow*.msi installer-file/ + + - name: upload archives + # if: startsWith(github.ref, 'refs/tags/') + uses: actions/upload-artifact@v4 + with: + name: archives-windows + path: installer-file/* + release: if: startsWith(github.ref, 'refs/tags/') needs: [linux-build, mac-build] diff --git a/dune-project b/dune-project index de9ef062..d8c7d7b9 100644 --- a/dune-project +++ b/dune-project @@ -32,7 +32,6 @@ bos lwt (inotify (= :os "linux")) - (cf-lwt (>="0.4")) astring fmt logs diff --git a/oui.json b/oui.json new file mode 100644 index 00000000..ef9807e7 --- /dev/null +++ b/oui.json @@ -0,0 +1,9 @@ +{ + "name": "slipshow", + "fullname": "slipshow.org", + "version": "0.0.1", + "wix_description": "TODO slipshow.", + "wix_manufacturer": "peada@free.fr", + "exec_files": ["bin/slipshow"], + "unique_id": "slipshow" +} diff --git a/slipshow.opam b/slipshow.opam index 0cf4858b..5c00dea2 100644 --- a/slipshow.opam +++ b/slipshow.opam @@ -21,7 +21,6 @@ depends: [ "bos" "lwt" "inotify" {os = "linux"} - "cf-lwt" {>= "0.4"} "astring" "fmt" "logs" diff --git a/vendor/github.com/panglesd/lwd/lib/lwd/lwd_infix.ml b/vendor/github.com/panglesd/lwd/lib/lwd/lwd_infix.ml index 28f12a63..12935894 100644 --- a/vendor/github.com/panglesd/lwd/lib/lwd/lwd_infix.ml +++ b/vendor/github.com/panglesd/lwd/lib/lwd/lwd_infix.ml @@ -1,8 +1,6 @@ -(*BEGIN LETOP*) let (let$) : 'a Lwd.t -> ('a -> 'b) -> 'b Lwd.t = Lwd.Infix.(>|=) let (and$) : 'a Lwd.t -> 'b Lwd.t -> ('a * 'b) Lwd.t = Lwd.pair let (let$*) : 'a Lwd.t -> ('a -> 'b Lwd.t) -> 'b Lwd.t = Lwd.Infix.(>>=) -(*END*) let ($=) : 'a Lwd.var -> 'a -> unit = Lwd.set let ($<-) : 'a Lwd_table.row -> 'a -> unit = Lwd_table.set diff --git a/vendor/github.com/panglesd/lwd/lib/lwd/lwd_infix.mli b/vendor/github.com/panglesd/lwd/lib/lwd/lwd_infix.mli index a0757107..9d6fbbb8 100644 --- a/vendor/github.com/panglesd/lwd/lib/lwd/lwd_infix.mli +++ b/vendor/github.com/panglesd/lwd/lib/lwd/lwd_infix.mli @@ -1,4 +1,3 @@ -(*BEGIN LETOP*) val (let$) : 'a Lwd.t -> ('a -> 'b) -> 'b Lwd.t (** Alias to {!Lwd.map'} suitable for let-op bindings *) @@ -7,7 +6,6 @@ val (let$*) : 'a Lwd.t -> ('a -> 'b Lwd.t) -> 'b Lwd.t val (and$) : 'a Lwd.t -> 'b Lwd.t -> ('a * 'b) Lwd.t (** Alias to {!Lwd.pair} suitable for let-op bindings *) -(*END*) val ($=) : 'a Lwd.var -> 'a -> unit (** Infix alias to {!Lwd.set} *) diff --git a/vendor/github.com/panglesd/lwd/lib/lwd/lwd_seq.ml b/vendor/github.com/panglesd/lwd/lib/lwd/lwd_seq.ml index cbd48065..c6773aa5 100644 --- a/vendor/github.com/panglesd/lwd/lib/lwd/lwd_seq.ml +++ b/vendor/github.com/panglesd/lwd/lib/lwd/lwd_seq.ml @@ -1,8 +1,4 @@ -(*BEGIN INJECTIVITY*) type !+'a t = -(*ELSE*) -type +'a t = -(*END*) | Nil | Leaf of { mutable mark: int; v: 'a; } | Join of { mutable mark: int; l: 'a t; r: 'a t; } diff --git a/vendor/github.com/panglesd/lwd/lib/lwd/lwd_seq.mli b/vendor/github.com/panglesd/lwd/lib/lwd/lwd_seq.mli index f7607033..a5be682a 100644 --- a/vendor/github.com/panglesd/lwd/lib/lwd/lwd_seq.mli +++ b/vendor/github.com/panglesd/lwd/lib/lwd/lwd_seq.mli @@ -12,13 +12,8 @@ element. *) -(*BEGIN INJECTIVITY*) type !+'a t type !+'a seq = 'a t -(*ELSE*) -type +'a t -type +'a seq = 'a t -(*END*) (** The type of sequences *)