Skip to content

Commit dbb6409

Browse files
authored
Add windows-secp256k1 binary distribution (#1424)
1 parent 51bc734 commit dbb6409

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: "Test secp256k1 on windows"
2+
on: workflow_dispatch
3+
jobs:
4+
tests:
5+
runs-on: windows-latest
6+
7+
defaults:
8+
run:
9+
shell: bash
10+
11+
steps:
12+
13+
- uses: haskell/actions/setup@v1
14+
id: setup-haskell
15+
with:
16+
ghc-version: 8.10.7
17+
cabal-version: 3.6.2.0
18+
19+
- name: Install pkgconfiglite
20+
run: choco install -y pkgconfiglite
21+
22+
- name: Install libsecp256k1
23+
run: |
24+
curl -Ls \
25+
--connect-timeout 5 \
26+
--max-time 10 \
27+
--retry 5 \
28+
--retry-delay 0 \
29+
--retry-max-time 40 \
30+
https://hydra.iohk.io/job/Cardano/haskell-nix/windows-secp256k1/latest/download/1 -o secp256k1.zip
31+
mkdir secp256k1
32+
cd secp256k1
33+
unzip ../secp256k1.zip
34+
cd ..
35+
export PKG_CONFIG_PATH="$(readlink -f secp256k1/lib/pkgconfig)"
36+
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV
37+
export SECP256K1_PATH="$(readlink -f secp256k1/bin | tr / '\\')"
38+
echo "$SECP256K1_PATH" >> $GITHUB_PATH
39+
40+
- name: Cabal update
41+
run: cabal update
42+
43+
- name: Build and run haskell-secp256k1 tests
44+
run: |
45+
cabal unpack secp256k1-haskell
46+
cd secp256k1-haskell-*
47+
cabal build --enable-tests
48+
cp ../secp256k1/bin/*.dll dist-newstyle/build/x86_64-windows/ghc-*/secp256k1-haskell-*/t/spec/build/spec/
49+
cabal test
50+

release.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ let
4646
) (names nixpkgsJobs)
4747
) (names allJobs));
4848
in traceNames "job " (latestJobs // requiredJobs // {
49+
windows-secp256k1 =
50+
let
51+
pkgs = (import ./. {}).pkgs-unstable;
52+
makeBinDist = drv: pkgs.runCommand drv.name {
53+
nativeBuildInputs = [ pkgs.zip ];
54+
} ''
55+
mkdir -p $out/nix-support
56+
cp -r ${drv}/* .
57+
chmod -R +w .
58+
zip -r $out/${drv.name}.zip .
59+
echo "file binary-dist $out/${drv.name}.zip" > $out/nix-support/hydra-build-products
60+
'';
61+
in makeBinDist pkgs.pkgsCross.mingwW64.secp256k1;
4962
required = genericPkgs.releaseTools.aggregate {
5063
name = "haskell.nix-required";
5164
meta.description = "All jobs required to pass CI";

0 commit comments

Comments
 (0)