Skip to content

Commit 3ae91a3

Browse files
amesgenmrkkrp
authored andcommitted
Binaries CI: stop cross-compiling Windows binary
see the linked GH issue We also add an index-state such that the non-Nix cabal build plan is reproducible.
1 parent 285c20e commit 3ae91a3

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

.github/workflows/binaries.yml

+30-4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ jobs:
2020
- os: macOS-latest
2121
system: x86_64-darwin
2222
attr: native
23-
- os: ubuntu-latest
24-
system: x86_64-linux
25-
attr: windows
23+
# Because of
24+
# https://github.com/input-output-hk/haskell.nix/issues/2228, we build
25+
# (outside of Nix) with a non-cross GHC for Windows for now.
26+
# - os: ubuntu-latest
27+
# system: x86_64-linux
28+
# attr: windows
2629
name: Build ${{ matrix.attr }} binary on ${{ matrix.system }}
2730
runs-on: ${{ matrix.os }}
2831
steps:
@@ -51,6 +54,29 @@ jobs:
5154
upload_url: ${{ github.event.release.upload_url }}
5255
asset_path: ormolu.zip
5356
asset_name: ormolu-${{ steps.system.outputs.SYSTEM }}.zip
57+
build-windows:
58+
name: Build Windows binary
59+
runs-on: windows-latest
60+
steps:
61+
- uses: actions/checkout@v4
62+
- uses: haskell-actions/setup@v2
63+
with:
64+
ghc-version: '9.10'
65+
- name: Build binary
66+
run: cabal build exe:ormolu
67+
env:
68+
ORMOLU_REV: ${{ github.sha }}
69+
- name: Prepare upload
70+
run: |
71+
mkdir result
72+
cp $(cabal list-bin exe:ormolu) result
73+
cd result
74+
7z a ../ormolu.zip .
75+
- uses: shogo82148/actions-upload-release-asset@v1
76+
with:
77+
upload_url: ${{ github.event.release.upload_url }}
78+
asset_path: ormolu.zip
79+
asset_name: ormolu-x86_64-windows.zip
5480
test:
5581
strategy:
5682
fail-fast: false
@@ -66,7 +92,7 @@ jobs:
6692
system: x86_64-windows
6793
name: Test built binaries
6894
runs-on: ${{ matrix.os }}
69-
needs: build
95+
needs: [build, build-windows]
7096
steps:
7197
- name: Download and extract binary
7298
run: |

cabal.project

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
packages: . extract-hackage-info
22

3+
index-state: 2025-01-16T23:07:37Z
4+
35
tests: True
46
multi-repl: True
57

0 commit comments

Comments
 (0)