Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
716b9e0
Add Windows executable builds to the CI workflow.
coco-314 Mar 19, 2026
fb1dd7f
Using version 3 of action "setup-ocaml"
coco-314 Mar 19, 2026
155a79c
Removing cf deps to check if it allows installing deps on Windows
panglesd Mar 20, 2026
0028f01
Windows: Check if preprocessing is not working on Windows
panglesd Mar 20, 2026
0c7faa4
Test ci on windows
panglesd Apr 5, 2026
6a0e50d
More windows tests
panglesd Apr 5, 2026
226ef3f
backslashes not as escapes
panglesd Apr 5, 2026
bee2215
Changes to path separator handling for the various target OS of the CI
coco-314 Apr 8, 2026
22faaad
Fixes the creation of a folder in the CI Windows job
coco-314 Apr 8, 2026
67ec52c
For debug
coco-314 Apr 8, 2026
cb093ac
New try
coco-314 Apr 8, 2026
aed85ed
Windows distribution via a ZIP file
coco-314 Apr 9, 2026
f40b490
Using native PowerShell to create the ZIP archive
coco-314 Apr 9, 2026
7a7bf33
Test to see what is responsible for the windows CI problem
panglesd Apr 9, 2026
b1f52bf
Windows CI: Only install x86_64 packages
panglesd Apr 9, 2026
dd78b12
Test
panglesd Apr 9, 2026
f01e576
Debugging
coco-314 Apr 10, 2026
02d6010
fix debug
coco-314 Apr 10, 2026
0a2b1eb
dune install
coco-314 Apr 10, 2026
9e4192a
CI: Add a cache to windows CI
panglesd Apr 10, 2026
d12df1e
Copy missing dlls inti bundle
coco-314 Apr 12, 2026
5e2ccf2
Instal opensll and zlib
coco-314 Apr 23, 2026
d9734d6
Fix Build installable artifacts
coco-314 Apr 23, 2026
9393f67
Test ntldd
coco-314 Apr 23, 2026
94b3fb8
Copy dlls
coco-314 Apr 23, 2026
e11736f
Copy dlls
coco-314 Apr 24, 2026
98303a0
Try installer Oui
coco-314 Apr 24, 2026
e9cc780
Try Wix installation witrh dotnet
coco-314 Apr 24, 2026
61bbca2
Fix oui installation
coco-314 Apr 24, 2026
a5fd3a9
Use WIX
coco-314 Apr 24, 2026
7f1d3a6
Comment version getter
coco-314 Apr 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
258 changes: 258 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,264 @@ 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') }}

- name: Install OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
cache-prefix: v3
ocaml-compiler: 4.14
opam-pin: false
opam-repositories: |
default: https://github.com/punchagan/opam-repository.git#f1c70a26b442142ba1c3bd040bf8621060c94912

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change has now been merged upstream, and this change to use a different version of the repository can be removed.


# - name: Install something that triggers mingw-w64-shims recompilation
# run: opam install conf-mingw-w64-gmp-x86_64 conf-mingw-w64-libffi-x86_64 conf-mingw-w64-openssl-x86_64 -y

- name: Install system dependencies
run: |
opam depext conf-openssl conf-zlib -y
# On s'assure que les paquets sont bien là pour la compilation
opam install conf-openssl conf-zlib -y

- 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

- name: Build installable artifacts
run: opam exec -- dune build --profile release @install --ignore-promoted-rules

- name: Install into relocatable bundle
run: opam exec -- dune install --relocatable --prefix ${{ github.workspace }}/bundle slipshow

- name: Debug - Verify "${{ github.workspace }}\bundle"
run: |
Write-Output "Test ${{ github.workspace }}/bundle : $(Test-Path ${{ github.workspace }}/bundle)"
Get-ChildItem -Path ${{ github.workspace }}/bundle

- name: Copy required DLLs into "${{ github.workspace }}\bundle\bin"
shell: pwsh
run: |
$bundleBin = "${{ github.workspace }}\bundle\bin"
$exe = "$bundleBin\slipshow.exe"

# Retrieve Cygwin folder
$cygwinpath = "$env:LOCALAPPDATA\opam\.cygwin"
Write-host "cygwinpath = $cygwinpath"

# Searches for DLLs in the typical Cygwin locations managed by OPAM
$searchRoots = @(
"C:\cygwin64\bin",
"C:\msys64\usr\bin",
"C:\msys64\mingw64\bin"
) + ($env:PATH -split ";")

# List of DLLs to copy
$dlls = @(
"libcrypto-3.dll",
"libssl-3.dll",
"zlib1.dll"
)

foreach ($dll in $dlls) {
$found = $false

# Try to find the dll into typical Cygwin locations
if (Test-Path $cygwinpath) {
$sourceFile = Get-ChildItem $cygwinpath -Recurse -Filter $dll |
Select-Object -First 1 -ExpandProperty FullName
if (($null -ne $sourceFile) -and (Test-Path $sourceFile)) {
Copy-Item $sourceFile $bundleBin -Force
Write-Host "Library $dll copied from $sourceFile to $bundleBin"
$found = $true
}
}

if (-not $found) {
# Try to find the dll into the Cygwin folder
foreach ($root in $searchRoots) {
$sourceFile = Join-Path $root $dll
if (Test-Path $sourceFile) {
Copy-Item $sourceFile $bundleBin -Force
Write-Host "Library $dll copied from $sourceFile to $bundleBin"
$found = $true
break
}
}
}

if (-not $found) {
Write-Warning "Could not find library $dll"
}
}

# - name: Prepare release directory
# run: |
# New-Item -ItemType Directory -Force -Path new_release

# - name: Create ZIP archive slipshow-${{ matrix.config.name }}-${{ matrix.config.target }}.zip
# run: Compress-Archive -Path ${{ github.workspace }}/bundle/* -DestinationPath new_release/slipshow-${{ matrix.config.name }}-${{ matrix.config.target }}.zip

# - name: Upload archives
# uses: actions/upload-artifact@v4
# with:
# name: archives-windows-${{ matrix.config.arch }}
# path: new_release/*.zip

- name: Install WiX 6 (required by OUI for Windows MSI)
shell: pwsh
run: |
dotnet tool install --global wix --version 6.0.2

# Ajouter le dossier des outils .NET globaux au PATH
$dotnetToolsPath = "$env:USERPROFILE\.dotnet\tools"
echo "$dotnetToolsPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Write-Host "WiX installed, tools path: $dotnetToolsPath"

# - name: Install OUI via opam
# run: opam install oui -y
# - name: Install OUI via opam (depuis les sources)
# run: opam pin add oui https://github.com/OCamlPro/ocaml-universal-installer.git#master --no-action -y && opam install oui -y

# - name: Write oui.json
# shell: pwsh
# run: |
# # Récupérer la version depuis le tag git (ex: v1.2.3 → 1.2.3) + WiX exige major.minor.patch strictement numériques ; fallback sur 0.0.1
# $version = (git describe --tags --abbrev=0 2>$null) -replace '^v', ''
# if (($version -eq $null) -ot ($version -notmatch '^\d+\.\d+\.\d+$')) { $version = "0.0.1" }
# Write-host "version = $version"

# $config = @{
# name = "slipshow"
# fullname = "Slipshow"
# version = $version
# unique_id = "com.slipshow.slipshow"
# wix_manufacturer = "Paul-Elliot"
# wix_description = "Slipshow is an engine to write slips, a concept evolved from slides."
# exec_files = @("bin/slipshow.exe")
# }
# $config | ConvertTo-Json -Depth 5 | Set-Content oui.json -Encoding UTF8
# Write-Host "oui.json generated:"
# Get-Content oui.json

# - name: Lint oui.json
# run: opam exec -- oui lint oui.json ${{ github.workspace }}/bundle

# - name: Generate MSI installer with OUI
# run: |
# New-Item -ItemType Directory -Force -Path new_release
# opam exec -- oui build oui.json ${{ github.workspace }}/bundle --output-dir ${{ github.workspace }}/new_release
# shell: pwsh

# - name: Debug - Verify "${{ github.workspace }}/new_release"
# run: |
# Write-Output "Test ${{ github.workspace }}/new_release : $(Test-Path ${{ github.workspace }}/new_release)"
# Get-ChildItem -Path ${{ github.workspace }}/new_release

- name: Prepare release directory
shell: pwsh
run: New-Item -ItemType Directory -Force -Path new_release

- name: Get version from git tag
continue-on-error: true
id: version
shell: pwsh
run: |
# $version = (git describe --tags --abbrev=0 2>$null) -replace '^v', ''
# if ($version -notmatch '^\d+\.\d+\.\d+$') { $version = "0.0.1" }
$version = "0.0.1"
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
Write-Host "Version: $version"

- name: Write WiX source file (slipshow.wxs)
shell: pwsh
run: |
$version = "${{ steps.version.outputs.VERSION }}"
$bundle = "${{ github.workspace }}\bundle"

# Générer la liste des fichiers du bundle
$files = Get-ChildItem -Path "$bundle\bin" -File
$fileEntries = ($files | ForEach-Object {
$id = $_.Name -replace '[^a-zA-Z0-9]', '_'
" <File Id=""$id"" Source=""$bundle\bin\$($_.Name)"" />"
}) -join "`n"

$wxs = @"
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package
Name="Slipshow"
Version="$version"
Manufacturer="Paul-Elliot"
UpgradeCode="ab3dec57-e72b-4fe1-bfae-62dcc4a5d554"
Scope="perUser">

<MajorUpgrade DowngradeErrorMessage="A newer version is already installed." />

<Feature Id="Main" Title="Slipshow" Level="1">
<ComponentGroupRef Id="MainComponents" />
</Feature>

<StandardDirectory Id="LocalAppDataFolder">
<Directory Id="INSTALLFOLDER" Name="Slipshow">
<ComponentGroup Id="MainComponents">
<Component Id="MainBinaries" Guid="*">
$fileEntries
</Component>
</ComponentGroup>
</Directory>
</StandardDirectory>

</Package>
</Wix>
"@

$wxs | Set-Content slipshow.wxs -Encoding UTF8
Write-Host "slipshow.wxs generated"
Get-Content slipshow.wxs

- name: Build MSI with WiX
shell: pwsh
run: |
$version = "${{ steps.version.outputs.VERSION }}"
wix build slipshow.wxs -o "new_release\slipshow-windows-x64-${version}.msi"
Write-Host "MSI generated:"
Get-ChildItem new_release

- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: archives-windows-${{ matrix.config.arch }}
path: new_release/*.msi

release:
if: startsWith(github.ref, 'refs/tags/')
needs: [linux-build, mac-build]
Expand Down
1 change: 0 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
bos
lwt
(inotify (= :os "linux"))
(cf-lwt (>="0.4"))
astring
fmt
logs
Expand Down
1 change: 0 additions & 1 deletion slipshow.opam
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ depends: [
"bos"
"lwt"
"inotify" {os = "linux"}
"cf-lwt" {>= "0.4"}
"astring"
"fmt"
"logs"
Expand Down
2 changes: 0 additions & 2 deletions vendor/github.com/panglesd/lwd/lib/lwd/lwd_infix.ml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions vendor/github.com/panglesd/lwd/lib/lwd/lwd_infix.mli

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions vendor/github.com/panglesd/lwd/lib/lwd/lwd_seq.ml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions vendor/github.com/panglesd/lwd/lib/lwd/lwd_seq.mli

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.