Skip to content

Commit

Permalink
Fix Haskell build after moving to gen/haskell
Browse files Browse the repository at this point in the history
  • Loading branch information
domMayhew committed Feb 8, 2024
1 parent 0221f59 commit d748bdb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build-haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
HASKELL_ROOT: gen/haskell
steps:
- name: Checkout
uses: actions/checkout@v4

- run: cd gen/haskell

- name: Install protoc
run: |
PROTOC_ZIP=protoc-3.14.0-linux-x86_64.zip
Expand All @@ -35,6 +35,7 @@ jobs:

- name: Configure Cabal build
run: |
cd {{ env.HASKELL_ROOT }}
cabal configure --enable-tests --enable-benchmarks --disable-documentation
cabal build all --dry-run
# ^ Creates a plan.json file equivalent to a package-lock.json, used for creating a cache key
Expand All @@ -43,8 +44,7 @@ jobs:
uses: actions/cache/restore@v4
id: cache-cabal-build
env:
key:
${{ runner.os }}-ghc-${{ steps.setup-hs.outputs.ghc-version
key: ${{ runner.os }}-ghc-${{ steps.setup-hs.outputs.ghc-version
}}-cabal-${{ steps.setup-hs.outputs.cabal-version }}
with:
path: ${{ steps.setup-hs.outputs.cabal-store }}
Expand All @@ -55,6 +55,7 @@ jobs:
- name: Get Package Version
id: package-version
run: |
cd {{ env.HASKELL_ROOT }}
VERSION=$(sed -nE '/^version:\s*([0-9]\.[0-9]+\.[0-9]+.*)$/s||\1|p' utxorpc.cabal)
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
Expand All @@ -63,6 +64,7 @@ jobs:
env:
version: ${{ steps.package-version.outputs.VERSION }}
run: |
cd {{ env.HASKELL_ROOT }}
cabal build
cabal sdist
echo "SDIST-LOCATION=$(pwd)/dist-newstyle/sdist/utxorpc-${{ env.version }}.tar.gz" >> "$GITHUB_OUTPUT"
Expand Down
3 changes: 3 additions & 0 deletions gen/haskell/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# UTxO RPC

This package contains the generated code from [the UTxO RPC specification](https://utxorpc.org/). Codegen was performed using `proto-lens-protoc` and contains `Message` types useful for serde. For more support for implementing a UTxO RPC client or service, see [the SDK](https://www.github.com/utxorpc/haskell-sdk).
2 changes: 1 addition & 1 deletion gen/haskell/utxorpc.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ library
Proto.Utxorpc.V1alpha.Watch.Watch
Proto.Utxorpc.V1alpha.Watch.Watch_Fields
hs-source-dirs:
gen/haskell
.
build-depends:
base >=4.7 && <5
, proto-lens >= 0.7.1 && < 0.8
Expand Down

0 comments on commit d748bdb

Please sign in to comment.