-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cabal/packages | ||
~/.cabal/store | ||
dist-newstyle | ||
key: ${{ runner.os }}-${{ hashFiles('**/*.cabal') }} | ||
restore-keys: | | ||
${{ runner.os }}- | ||
- name: Setup Haskell | ||
uses: haskell/actions/setup@v1 | ||
with: | ||
ghc-version: 8.10 | ||
cabal-version: 3.4 | ||
|
||
- name: Install zookeeper-dev on ubuntu | ||
run: sudo apt-get update && sudo apt-get install -y libzookeeper-mt-dev | ||
|
||
- name: Publish package | ||
run: | | ||
cabal sdist && cabal haddock --enable-documentation --haddock-for-hackage | ||
tar_file=$(cabal sdist | grep zoovisitor) | ||
doc_file=$(cabal haddock --enable-documentation --haddock-for-hackage|grep 'zoovisitor.*docs.tar.gz') | ||
echo $tar_file | ||
echo $doc_file | ||
cabal upload -u "${{ secrets.HACKAGE_USERNAME }}" -p "${{ secrets.HACKAGE_PASSWORD }}" --publish $tar_file | ||
cabal upload -u "${{ secrets.HACKAGE_USERNAME }}" -p "${{ secrets.HACKAGE_PASSWORD }}" --publush --doc $doc_file |