Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Github Action to install libsecp256k1 #4738

Merged
merged 2 commits into from
Jan 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 0 additions & 24 deletions .github/workflows/build-secp256k1.bash

This file was deleted.

20 changes: 6 additions & 14 deletions .github/workflows/github-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:

env:
# Modify this value to "invalidate" the cabal cache.
CABAL_CACHE_VERSION: "2022-12-28"
CABAL_CACHE_VERSION: "2022-12-30"

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

# current ref from: 27.02.2022
SECP256K1_REF: ac83be33d0956faf6b7f61a60ab524ef7d6a473a
Expand Down Expand Up @@ -70,19 +70,11 @@ jobs:
sudo apt-get -y remove --purge software-properties-common
sudo apt-get -y autoremove

- uses: actions/cache@v3
name: "Cache secp256k1"
- name: Install secp256k1
uses: input-output-hk/setup-secp256k1@v1
with:
path: secp256k1
key: cache-secp256k1-${{ runner.os }}-${{ env.SECP_CACHE_VERSION }}
restore-keys: cache-secp256k1-${{ runner.os }}-${{ env.SECP_CACHE_VERSION }}

- name: "Install secp256k1"
shell: bash
env:
CI_SECP_FLAGS: "--prefix=/usr/local"
CI_SECP_INSTALL_CMD: sudo
run: bash .github/workflows/build-secp256k1.bash
git-ref: ${{ env.SECP256K1_REF }}
cache-version: ${{ env.SECP_CACHE_VERSION }}

- name: Cabal update
run: cabal update
Expand Down
43 changes: 6 additions & 37 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:

env:
# Modify this value to "invalidate" the cabal cache.
CABAL_CACHE_VERSION: "2022-12-28"
CABAL_CACHE_VERSION: "2022-12-30"

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

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

CACHE_VERSION: "2022-12-28"

steps:
- name: "WIN: Install System Dependencies via pacman (msys2)"
if: runner.os == 'Windows'
Expand Down Expand Up @@ -155,33 +153,11 @@ jobs:
if: runner.os == 'macOS'
run: brew install autoconf automake libtool

- uses: actions/cache@v3
name: "Cache secp256k1"
- name: Install secp256k1
uses: input-output-hk/setup-secp256k1@v1
with:
path: secp256k1
key: cache-secp256k1-${{ runner.os }}-${{ env.SECP_CACHE_VERSION }}
restore-keys: cache-secp256k1-${{ runner.os }}-${{ env.SECP_CACHE_VERSION }}

- name: "LINUX: Install secp256k1"
if: runner.os != 'Windows'
shell: bash
env:
CI_SECP_FLAGS: "--prefix=/usr/local"
CI_SECP_INSTALL_CMD: sudo
run: bash .github/workflows/build-secp256k1.bash

# TODO: this really should come from a pre-built location
- name: "WIN: Install secp256k1"
if: runner.os == 'Windows'
# Same env as tmate action
env:
MSYS2_PATH_TYPE: inherit
MSYSTEM: MINGW64
CHERE_INVOKING: 1
# install secp into /mingw64 prefix, which is where pkg-config will look
# by default.
CI_SECP_FLAGS: "--prefix=/mingw64"
run: C:\\msys64\\usr\\bin\\bash.exe .github/workflows/build-secp256k1.bash
git-ref: ${{ env.SECP256K1_REF }}
cache-version: ${{ env.SECP_CACHE_VERSION }}

- name: Cabal update
run: cabal update
Expand All @@ -199,13 +175,6 @@ jobs:
echo "# cabal.project.local"
cat cabal.project.local

- name: List all pkg-config packages
run: |
# The tests call out to msys2 commands. We generally do not want to mix toolchains, so
# we are very deliberate about only adding msys64 to the path where absolutely necessary.
${{ (runner.os == 'Windows' && '$env:PATH=("C:\msys64\mingw64\bin;{0}" -f $env:PATH)') || '' }}
pkg-config --list-all

- name: Build dry run
run: |
# The tests call out to msys2 commands. We generally do not want to mix toolchains, so
Expand Down