Skip to content

Commit d8e41c1

Browse files
committed
Add upload tarballs job
1 parent 7684e6b commit d8e41c1

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

.github/workflows/hackage.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- '*-hackage'
77

88
jobs:
9-
check:
9+
check-and-upload-tarballs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
@@ -69,12 +69,12 @@ jobs:
6969
echo ::set-output name=path::$(ls ./sdist/${{ matrix.package }}-*)
7070
7171
- name: "Unpack package source in an isolated location"
72-
run: cabal unpack ${{ steps.generate-dist-tarball.outputs.path }} --destdir=./packages
72+
run: cabal unpack ${{ steps.generate-dist-tarball.outputs.path }} --destdir=./incoming
7373

7474
- name: "Try to get the current hackage version"
7575
id: get-hackage-version
7676
run: |
77-
cd ./packages
77+
cd ./incoming
7878
if cabal get $(ls -d ${{ matrix.package }}-*) --destdir=../current; then
7979
echo ::set-output name=exists::true
8080
fi
@@ -84,26 +84,26 @@ jobs:
8484
if: steps.get-hackage-version.exists == 'true'
8585
run: |
8686
# This will throw an error if there is any difference casue we have to bump up the package version
87-
diff -qr -x "*.md" -x "data" $(ls -d ./packages/${{ matrix.package }}-*) $(ls -d ./current/${{ matrix.package }}-*)
87+
diff -qr -x "*.md" -x "data" $(ls -d ./incoming/${{ matrix.package }}-*) $(ls -d ./current/${{ matrix.package }}-*)
8888
8989
- name: "Create appropiate cabal.project"
9090
if: steps.get-hackage-version.exists != 'true'
9191
run: |
92-
cd $(ls -d ./packages/${{ matrix.package }}-*)
92+
cd $(ls -d ./incoming/${{ matrix.package }}-*)
9393
echo "packages: . ../../* ../../plugins/*" > cabal.project
9494
# TODO: remove when not needed
9595
echo "allow-newer: Chart-diagrams:diagrams-core, SVGFonts:diagrams-core" >> cabal.project
9696
9797
- name: "Build all package components in isolation"
9898
if: steps.get-hackage-version.exists != 'true'
9999
run: |
100-
cd $(ls -d ./packages/${{ matrix.package }}-*)
100+
cd $(ls -d ./incoming/${{ matrix.package }}-*)
101101
cabal build --enable-tests --enable-benchmarks
102102
103103
- name: "Generate haddock for hackage"
104104
if: steps.get-hackage-version.exists != 'true'
105105
run: |
106-
cd $(ls -d ./packages/${{ matrix.package }}-*)
106+
cd $(ls -d ./incoming/${{ matrix.package }}-*)
107107
cabal haddock --haddock-for-hackage
108108
109109
- name: "Upload package dist tarball"
@@ -113,3 +113,15 @@ jobs:
113113
name: ${{ matrix.package }}
114114
path: ${{ steps.generate-dist-tarball.outputs.path }}
115115

116+
upload-candidate:
117+
needs: check-and-upload-tarballs
118+
runs-on: ubuntu-latest
119+
steps:
120+
121+
- uses: actions/download-artifact@v2
122+
123+
- name: "Upload all tarballs to hackage"
124+
uses: haskell-actions/hackage-publish@v1
125+
with:
126+
hackageToken: ${{ secrets.HACKAGE_AUTH_TOKEN }}
127+
publish: false

0 commit comments

Comments
 (0)