diff --git a/.github/workflows/build-haskell.yml b/.github/workflows/build-haskell.yml index 966436b..8080be9 100644 --- a/.github/workflows/build-haskell.yml +++ b/.github/workflows/build-haskell.yml @@ -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 @@ -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 @@ -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 }} @@ -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" @@ -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" diff --git a/gen/haskell/README.md b/gen/haskell/README.md new file mode 100644 index 0000000..85b8fdf --- /dev/null +++ b/gen/haskell/README.md @@ -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). \ No newline at end of file diff --git a/gen/haskell/utxorpc.cabal b/gen/haskell/utxorpc.cabal index 5634c23..9b84719 100644 --- a/gen/haskell/utxorpc.cabal +++ b/gen/haskell/utxorpc.cabal @@ -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