Skip to content

Commit a1c07a5

Browse files
committed
add packaging ci
1 parent 7d1cacc commit a1c07a5

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/publish.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
submodules: 'recursive'
15+
16+
- uses: actions/cache@v2
17+
with:
18+
path: |
19+
~/.cabal/packages
20+
~/.cabal/store
21+
dist-newstyle
22+
key: ${{ runner.os }}-${{ hashFiles('**/*.cabal') }}
23+
restore-keys: |
24+
${{ runner.os }}-
25+
26+
- name: Setup Haskell
27+
uses: haskell/actions/setup@v1
28+
with:
29+
ghc-version: 8.10
30+
cabal-version: 3.4
31+
32+
- name: Install zookeeper-dev on ubuntu
33+
run: sudo apt-get update && sudo apt-get install -y libzookeeper-mt-dev
34+
35+
- name: Publish package
36+
run: |
37+
cabal sdist && cabal haddock --enable-documentation --haddock-for-hackage
38+
39+
tar_file=$(cabal sdist | grep zoovisitor)
40+
doc_file=$(cabal haddock --enable-documentation --haddock-for-hackage|grep 'zoovisitor.*docs.tar.gz')
41+
42+
echo $tar_file
43+
echo $doc_file
44+
45+
cabal upload -u "${{ secrets.HACKAGE_USERNAME }}" -p "${{ secrets.HACKAGE_PASSWORD }}" --publish $tar_file
46+
cabal upload -u "${{ secrets.HACKAGE_USERNAME }}" -p "${{ secrets.HACKAGE_PASSWORD }}" --publush --doc $doc_file

0 commit comments

Comments
 (0)