Skip to content

Fix hackage release #2177

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

Merged
merged 6 commits into from
Sep 10, 2021
Merged
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
17 changes: 11 additions & 6 deletions .github/workflows/hackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,43 +71,48 @@ jobs:
- name: "Unpack package source in an isolated location"
run: cabal unpack ${{ steps.generate-dist-tarball.outputs.path }} --destdir=./incoming

- name: "Ensure we will use hackage head"
run: cabal update

- name: "Try to get the current hackage version"
id: get-hackage-version
run: |
cd ./incoming
if cabal get $(ls -d ${{ matrix.package }}-*) --destdir=../current; then
echo ::set-output name=exists::true
else
echo ::set-output name=exists::false
fi

- name: "Compare the incoming and the current hackage version of the package"
id: compare-current-version
if: steps.get-hackage-version.exists == 'true'
if: steps.get-hackage-version.outputs.exists == 'true'
run: |
# This will throw an error if there is any difference cause we have to bump up the package version
diff -qr -x "*.md" -x "data" $(ls -d ./incoming/${{ matrix.package }}-*) $(ls -d ./current/${{ matrix.package }}-*)
diff -r -x "*.md" -x "data" $(ls -d ./incoming/${{ matrix.package }}-*) $(ls -d ./current/${{ matrix.package }}-*)

- name: "Create appropiate cabal.project"
if: steps.get-hackage-version.exists != 'true'
if: steps.get-hackage-version.outputs.exists != 'true'
run: |
cd $(ls -d ./incoming/${{ matrix.package }}-*)
echo "packages: . ../../* ../../plugins/*" > cabal.project
# TODO: remove when not needed
echo "allow-newer: Chart-diagrams:diagrams-core, SVGFonts:diagrams-core" >> cabal.project

- name: "Build all package components in isolation"
if: steps.get-hackage-version.exists != 'true'
if: steps.get-hackage-version.outputs.exists != 'true'
run: |
cd $(ls -d ./incoming/${{ matrix.package }}-*)
cabal build --enable-tests --enable-benchmarks

- name: "Generate haddock for hackage"
if: steps.get-hackage-version.exists != 'true'
if: steps.get-hackage-version.outputs.exists != 'true'
run: |
cd $(ls -d ./incoming/${{ matrix.package }}-*)
cabal haddock --haddock-for-hackage

- name: "Upload package dist tarball"
if: steps.get-hackage-version.exists != 'true'
if: steps.get-hackage-version.outputs.exists != 'true'
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.package }}
Expand Down