-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (49 loc) · 1.44 KB
/
tst-pub.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Test & Publish
on:
push:
tags:
- 'release-v[0-9]+.[0-9]+.[0-9]+.[0-9]+'
branches:
- work
- main
jobs:
build:
env:
CONFIG: "--enable-tests --test-show-details=direct"
runs-on: ubuntu-latest
steps:
- id: haskell
name: Haskell Setup
uses: haskell/actions/setup@v1
with:
ghc-version: "9.0.1"
cabal-version: "3.4"
- name: Valor Checkout
uses: actions/checkout@v2
- name: Cabal Update
run: cabal v2-update $CONFIG
- name: Cabal Freeze
run: cabal v2-freeze $CONFIG
- name: Caching
uses: actions/cache@v2
with:
path: |
${{ steps.haskell.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-9.0.1-${{ hashFiles( 'cabal.project.freeze' ) }}
restore-keys: ${{ runner.os }}-9.0.1-
- name: Building
run: cabal v2-build all $CONFIG
- name: Testing
run: cabal v2-test all $CONFIG
- name: Documenting
run: cabal v2-haddock $CONFIG
- name: Publishing to Hackage
if: startsWith( github.ref , 'refs/tags/release-v' )
env:
HACKAGE_USERNAME: ${{ secrets.HACKAGE_USERNAME }}
HACKAGE_PASSWORD: ${{ secrets.HACKAGE_PASSWORD }}
run: |
cabal v2-sdist -o ./pack/
files=(pack/*)
cabal upload -u "$HACKAGE_USERNAME" -p "$HACKAGE_PASSWORD" $files