Skip to content

Commit 1f0249e

Browse files
authored
Fix hackage release (#2177)
* Do a cabal update * Set false explicitly * Correct outputs * Show entire diff * Remove duplicate cabal update
1 parent d9d27e5 commit 1f0249e

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/hackage.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -71,43 +71,48 @@ jobs:
7171
- name: "Unpack package source in an isolated location"
7272
run: cabal unpack ${{ steps.generate-dist-tarball.outputs.path }} --destdir=./incoming
7373

74+
- name: "Ensure we will use hackage head"
75+
run: cabal update
76+
7477
- name: "Try to get the current hackage version"
7578
id: get-hackage-version
7679
run: |
7780
cd ./incoming
7881
if cabal get $(ls -d ${{ matrix.package }}-*) --destdir=../current; then
7982
echo ::set-output name=exists::true
83+
else
84+
echo ::set-output name=exists::false
8085
fi
8186
8287
- name: "Compare the incoming and the current hackage version of the package"
8388
id: compare-current-version
84-
if: steps.get-hackage-version.exists == 'true'
89+
if: steps.get-hackage-version.outputs.exists == 'true'
8590
run: |
8691
# This will throw an error if there is any difference cause we have to bump up the package version
87-
diff -qr -x "*.md" -x "data" $(ls -d ./incoming/${{ matrix.package }}-*) $(ls -d ./current/${{ matrix.package }}-*)
92+
diff -r -x "*.md" -x "data" $(ls -d ./incoming/${{ matrix.package }}-*) $(ls -d ./current/${{ matrix.package }}-*)
8893
8994
- name: "Create appropiate cabal.project"
90-
if: steps.get-hackage-version.exists != 'true'
95+
if: steps.get-hackage-version.outputs.exists != 'true'
9196
run: |
9297
cd $(ls -d ./incoming/${{ matrix.package }}-*)
9398
echo "packages: . ../../* ../../plugins/*" > cabal.project
9499
# TODO: remove when not needed
95100
echo "allow-newer: Chart-diagrams:diagrams-core, SVGFonts:diagrams-core" >> cabal.project
96101
97102
- name: "Build all package components in isolation"
98-
if: steps.get-hackage-version.exists != 'true'
103+
if: steps.get-hackage-version.outputs.exists != 'true'
99104
run: |
100105
cd $(ls -d ./incoming/${{ matrix.package }}-*)
101106
cabal build --enable-tests --enable-benchmarks
102107
103108
- name: "Generate haddock for hackage"
104-
if: steps.get-hackage-version.exists != 'true'
109+
if: steps.get-hackage-version.outputs.exists != 'true'
105110
run: |
106111
cd $(ls -d ./incoming/${{ matrix.package }}-*)
107112
cabal haddock --haddock-for-hackage
108113
109114
- name: "Upload package dist tarball"
110-
if: steps.get-hackage-version.exists != 'true'
115+
if: steps.get-hackage-version.outputs.exists != 'true'
111116
uses: actions/upload-artifact@v2
112117
with:
113118
name: ${{ matrix.package }}

0 commit comments

Comments
 (0)