-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (82 loc) · 2.21 KB
/
release.yml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
on:
push:
tags:
- 'v*'
name: release
jobs:
release_test:
name: test
runs-on: ubuntu-16.04
strategy:
matrix:
ghc:
- '8.6.2'
- '8.6.5'
- '8.8.1'
cabal:
- '2.4'
- '3.0'
exclude:
- ghc: '8.8.1'
cabal: '2.4'
steps:
- uses: actions/checkout@master
with:
path: src
- uses: actions/setup-haskell@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- run: cd src; cabal new-update
- run: |
cd src
mkdir ../sdist
cabal new-sdist all -o ../sdist
- run: |
cd sdist
for archive in *.tar.gz; do tar xf "$archive"; done
echo "packages: */" > cabal.project
cabal new-test all
validate_cabal:
name: validate .cabal files
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@master
- uses: actions/setup-haskell@v1
- run: |
shopt -s globstar nullglob
for cabal_file in **/*.cabal; do
pushd "$(dirname $cabal_file)"
test $(sed -e 's/^version:\s*\(.*\)$/\1/;t;d' $cabal_file) = ${GITHUB_REF#refs\/tags\/v}
cabal check
popd
done
create_release:
name: create release
needs:
- release_test
- validate_cabal
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@master
- run: ./dev/ci/github_release.sh
id: github_release
- uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ steps.github_release.outputs.name }}
body: ${{ steps.github_release.outputs.body }}
draft: false
publish:
name: publish packages to Hackage
needs:
- release_test
- validate_cabal
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@master
- uses: actions/setup-haskell@v1
- run: mkdir sdist; cabal new-sdist all -o sdist
- run: cabal upload --publish -u '${{ secrets.HACKAGE_USERNAME }}' -p '${{ secrets.HACKAGE_PASSWORD }}' sdist/*.tar.gz