Skip to content

Commit cd8f02a

Browse files
authored
Merge pull request #4738 from input-output-hk/newhoggy/use-github-action-to-install-secp
Use Github Action to install libsecp256k1
2 parents 29d3103 + db11534 commit cd8f02a

File tree

3 files changed

+12
-75
lines changed

3 files changed

+12
-75
lines changed

Diff for: .github/workflows/build-secp256k1.bash

-24
This file was deleted.

Diff for: .github/workflows/github-page.yml

+6-14
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818

1919
env:
2020
# Modify this value to "invalidate" the cabal cache.
21-
CABAL_CACHE_VERSION: "2022-12-28"
21+
CABAL_CACHE_VERSION: "2022-12-30"
2222

2323
# Modify this value to "invalidate" the secp cache.
24-
SECP_CACHE_VERSION: "2022-12-23"
24+
SECP_CACHE_VERSION: "2022-12-30"
2525

2626
# current ref from: 27.02.2022
2727
SECP256K1_REF: ac83be33d0956faf6b7f61a60ab524ef7d6a473a
@@ -70,19 +70,11 @@ jobs:
7070
sudo apt-get -y remove --purge software-properties-common
7171
sudo apt-get -y autoremove
7272
73-
- uses: actions/cache@v3
74-
name: "Cache secp256k1"
73+
- name: Install secp256k1
74+
uses: input-output-hk/setup-secp256k1@v1
7575
with:
76-
path: secp256k1
77-
key: cache-secp256k1-${{ runner.os }}-${{ env.SECP_CACHE_VERSION }}
78-
restore-keys: cache-secp256k1-${{ runner.os }}-${{ env.SECP_CACHE_VERSION }}
79-
80-
- name: "Install secp256k1"
81-
shell: bash
82-
env:
83-
CI_SECP_FLAGS: "--prefix=/usr/local"
84-
CI_SECP_INSTALL_CMD: sudo
85-
run: bash .github/workflows/build-secp256k1.bash
76+
git-ref: ${{ env.SECP256K1_REF }}
77+
cache-version: ${{ env.SECP_CACHE_VERSION }}
8678

8779
- name: Cabal update
8880
run: cabal update

Diff for: .github/workflows/haskell.yml

+6-37
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ jobs:
2929

3030
env:
3131
# Modify this value to "invalidate" the cabal cache.
32-
CABAL_CACHE_VERSION: "2022-12-28"
32+
CABAL_CACHE_VERSION: "2022-12-30"
3333

3434
# Modify this value to "invalidate" the secp cache.
35-
SECP_CACHE_VERSION: "2022-12-23"
35+
SECP_CACHE_VERSION: "2022-12-30"
3636

3737
# current ref from: 27.02.2022
3838
SECP256K1_REF: ac83be33d0956faf6b7f61a60ab524ef7d6a473a
@@ -46,8 +46,6 @@ jobs:
4646
# FIXME: this is arguably a bug, and pkg-config should return the right values!
4747
LD_LIBRARY_PATH: ${{ (matrix.os != 'windows-latest' && '/usr/local/lib') || '' }}
4848

49-
CACHE_VERSION: "2022-12-28"
50-
5149
steps:
5250
- name: "WIN: Install System Dependencies via pacman (msys2)"
5351
if: runner.os == 'Windows'
@@ -155,33 +153,11 @@ jobs:
155153
if: runner.os == 'macOS'
156154
run: brew install autoconf automake libtool
157155

158-
- uses: actions/cache@v3
159-
name: "Cache secp256k1"
156+
- name: Install secp256k1
157+
uses: input-output-hk/setup-secp256k1@v1
160158
with:
161-
path: secp256k1
162-
key: cache-secp256k1-${{ runner.os }}-${{ env.SECP_CACHE_VERSION }}
163-
restore-keys: cache-secp256k1-${{ runner.os }}-${{ env.SECP_CACHE_VERSION }}
164-
165-
- name: "LINUX: Install secp256k1"
166-
if: runner.os != 'Windows'
167-
shell: bash
168-
env:
169-
CI_SECP_FLAGS: "--prefix=/usr/local"
170-
CI_SECP_INSTALL_CMD: sudo
171-
run: bash .github/workflows/build-secp256k1.bash
172-
173-
# TODO: this really should come from a pre-built location
174-
- name: "WIN: Install secp256k1"
175-
if: runner.os == 'Windows'
176-
# Same env as tmate action
177-
env:
178-
MSYS2_PATH_TYPE: inherit
179-
MSYSTEM: MINGW64
180-
CHERE_INVOKING: 1
181-
# install secp into /mingw64 prefix, which is where pkg-config will look
182-
# by default.
183-
CI_SECP_FLAGS: "--prefix=/mingw64"
184-
run: C:\\msys64\\usr\\bin\\bash.exe .github/workflows/build-secp256k1.bash
159+
git-ref: ${{ env.SECP256K1_REF }}
160+
cache-version: ${{ env.SECP_CACHE_VERSION }}
185161

186162
- name: Cabal update
187163
run: cabal update
@@ -199,13 +175,6 @@ jobs:
199175
echo "# cabal.project.local"
200176
cat cabal.project.local
201177
202-
- name: List all pkg-config packages
203-
run: |
204-
# The tests call out to msys2 commands. We generally do not want to mix toolchains, so
205-
# we are very deliberate about only adding msys64 to the path where absolutely necessary.
206-
${{ (runner.os == 'Windows' && '$env:PATH=("C:\msys64\mingw64\bin;{0}" -f $env:PATH)') || '' }}
207-
pkg-config --list-all
208-
209178
- name: Build dry run
210179
run: |
211180
# The tests call out to msys2 commands. We generally do not want to mix toolchains, so

0 commit comments

Comments
 (0)