Repository navigation
86 lines (84 loc) · 2.49 KB
/
Copy pathrelease.yml
File metadata and controls
86 lines (84 loc) · 2.49 KB
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
85
86
on:
push:
tags:
- 'v*'
name: release
jobs:
release_test:
name: test
runs-on: ubuntu-latest
strategy:
matrix:
ghc:
- '9.10.1'
cabal:
- '3.12'
steps:
- uses: actions/checkout@v4
with:
path: src
- uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
ghcup-release-channel: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.8.yaml
- run: cd src; cabal update
- run: |
cd src
mkdir ../sdist
cabal sdist all -o ../sdist
- run: |
cd sdist
for archive in *.tar.gz; do tar xf "$archive"; done
echo "packages: */" > cabal.project
cabal test all
validate_cabal:
name: validate .cabal files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
with:
ghc-version: '9.10.1'
cabal-version: '3.12'
ghcup-release-channel: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.8.yaml
- run: |
for pkg in egison-pattern-src*; do
pushd "$pkg"
test $(sed -e 's/^version:\s*\(.*\)$/\1/;t;d' *.cabal) = ${GITHUB_REF#refs\/tags\/v}
cabal check
popd
done
create_release:
name: create release
needs:
- release_test
- validate_cabal
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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-latest
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
with:
ghc-version: '9.10.1'
cabal-version: '3.12'
ghcup-release-channel: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.8.yaml
- run: mkdir sdist; cabal sdist all -o sdist
- run: cabal upload --publish -u '${{ secrets.HACKAGE_USERNAME }}' -p '${{ secrets.HACKAGE_PASSWORD }}' sdist/*.tar.gz