Skip to content

Commit 3398f09

Browse files
committed
Use Github Action to install libsecp256k1
1 parent cd0c2f8 commit 3398f09

File tree

2 files changed

+30
-41
lines changed

2 files changed

+30
-41
lines changed

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

+15-10
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,24 @@ 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 }}
76+
git-ref: ${{ env.SECP256K1_REF }}
77+
cache-version: ${{ env.SECP_CACHE_VERSION }}
7978

80-
- name: "Install secp256k1"
79+
- name: Show paths
8180
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
81+
run: |
82+
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
83+
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
84+
85+
- name: List all pkg-config packages
86+
run: |
87+
# The tests call out to msys2 commands. We generally do not want to mix toolchains, so
88+
# we are very deliberate about only adding msys64 to the path where absolutely necessary.
89+
${{ (runner.os == 'Windows' && '$env:PATH=("C:\msys64\mingw64\bin;{0}" -f $env:PATH)') || '' }}
90+
pkg-config --list-all
8691
8792
- name: Cabal update
8893
run: cabal update

Diff for: .github/workflows/haskell.yml

+15-31
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ 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-28-a"
3333

3434
# Modify this value to "invalidate" the secp cache.
3535
SECP_CACHE_VERSION: "2022-12-23"
@@ -155,33 +155,24 @@ jobs:
155155
if: runner.os == 'macOS'
156156
run: brew install autoconf automake libtool
157157

158-
- uses: actions/cache@v3
159-
name: "Cache secp256k1"
158+
- name: Install secp256k1
159+
uses: input-output-hk/setup-secp256k1@v1
160160
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 }}
161+
git-ref: ${{ env.SECP256K1_REF }}
162+
cache-version: ${{ env.SECP_CACHE_VERSION }}
164163

165-
- name: "LINUX: Install secp256k1"
166-
if: runner.os != 'Windows'
164+
- name: Show paths
167165
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
166+
run: |
167+
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
168+
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
172169
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
170+
- name: List all pkg-config packages
171+
run: |
172+
# The tests call out to msys2 commands. We generally do not want to mix toolchains, so
173+
# we are very deliberate about only adding msys64 to the path where absolutely necessary.
174+
${{ (runner.os == 'Windows' && '$env:PATH=("C:\msys64\mingw64\bin;{0}" -f $env:PATH)') || '' }}
175+
pkg-config --list-all
185176
186177
- name: Cabal update
187178
run: cabal update
@@ -199,13 +190,6 @@ jobs:
199190
echo "# cabal.project.local"
200191
cat cabal.project.local
201192
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-
209193
- name: Build dry run
210194
run: |
211195
# The tests call out to msys2 commands. We generally do not want to mix toolchains, so

0 commit comments

Comments
 (0)