Skip to content

Commit

Permalink
add packaging ci
Browse files Browse the repository at this point in the history
  • Loading branch information
4eUeP committed Apr 25, 2021
1 parent 7d1cacc commit a1c07a5
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/publish.yml
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

0 comments on commit a1c07a5

Please sign in to comment.