9
9
strategy :
10
10
matrix :
11
11
os : [ubuntu-latest, macOS-latest]
12
- stack : ["2.15.7 "]
12
+ ghc : ["9.4", "9.6", "9.8 "]
13
13
14
14
steps :
15
- - name : Get the version
16
- id : get_version
17
- run : ' echo ::set-output name=version::${GITHUB_REF#refs/tags/}'
18
-
19
- - uses : actions/checkout@v2
15
+ - uses : actions/checkout@v4
20
16
21
17
- uses : haskell-actions/setup@v2
22
- name : Setup Haskell Stack
18
+ id : setup
23
19
with :
24
- enable-stack : true
25
- stack-version : ${{ matrix.stack }}
26
- stack-no-global : true
20
+ ghc-version : ${{ matrix.ghc }}
27
21
28
- - uses : actions/cache@v2
29
- name : Cache ~/.stack
22
+ - uses : actions/cache@v3
30
23
with :
31
- path : ~/.stack
32
- key : " ${{ runner.os }}-v9-${{ hashFiles('stylish-haskell.cabal', 'stack.yaml', 'stack.yaml.lock') }}"
33
-
34
- - name : Add ~/.local/bin to PATH
35
- run : echo "$HOME/.local/bin" >> $GITHUB_PATH
24
+ path : ${{ steps.setup.outputs.cabal-store }}
25
+ key : ${{ runner.os }}-${{ matrix.ghc }}-v1-${{ hashFiles('*.cabal') }}
26
+ restore-keys : |
27
+ ${{ runner.os }}-${{ matrix.ghc }}-v1-
36
28
37
- - name : Build
38
- run : make build
39
- id : build
29
+ - run : make build
30
+ - run : make test
40
31
41
- - name : Test
42
- run : make test
43
-
44
- - name : Build artifact
45
- if : startsWith(github.ref, 'refs/tags')
32
+ - if : startsWith(github.ref, 'refs/tags') && matrix.ghc == '9.6'
46
33
run : make artifact
47
- env :
48
- PATAT_TAG : ${{ steps.get_version.outputs.version }}
49
34
50
- - uses : actions/upload-artifact@v2
51
- if : startsWith(github.ref, 'refs/tags')
35
+ - uses : actions/upload-artifact@v4
36
+ if : startsWith(github.ref, 'refs/tags') && matrix.ghc == '9.6'
52
37
with :
53
38
path : artifacts/*
54
- name : artifacts
39
+ name : artifacts-${{ runner.os }}
55
40
56
41
release :
57
42
name : Release
@@ -60,41 +45,15 @@ jobs:
60
45
if : startsWith(github.ref, 'refs/tags')
61
46
62
47
steps :
63
- - name : Get the version
64
- id : get_version
65
- run : ' echo ::set-output name=version::${GITHUB_REF#refs/tags/}'
66
-
67
48
- uses : actions/download-artifact@v4
68
49
with :
69
- name : artifacts
70
-
71
- - name : Display structure of downloaded files
72
- run : ls -R
50
+ pattern : artifacts-*
73
51
74
- - uses : actions/create-release@v1
75
- id : create_release
76
- env :
77
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
78
- with :
79
- tag_name : ${{ steps.get_version.outputs.version }}
80
- release_name : ${{ steps.get_version.outputs.version }}
81
-
82
- - name : Upload Linux Asset
83
- uses : actions/upload-release-asset@v1
84
- env :
85
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
86
- with :
87
- upload_url : ${{ steps.create_release.outputs.upload_url }}
88
- asset_path : ./stylish-haskell-${{ steps.get_version.outputs.version }}-linux-x86_64.tar.gz
89
- asset_name : stylish-haskell-${{ steps.get_version.outputs.version }}-linux-x86_64.tar.gz
90
- asset_content_type : application/gzip
52
+ - run : ls -R
53
+ - run : ' sha256sum artifacts-*/*'
91
54
92
- - name : Upload MacOS Asset
93
- uses : actions/upload-release-asset@v1
55
+ - uses : softprops/action-gh-release@v1
94
56
env :
95
57
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
96
58
with :
97
- upload_url : ${{ steps.create_release.outputs.upload_url }}
98
- asset_path : ./stylish-haskell-${{ steps.get_version.outputs.version }}-darwin-x86_64.zip
99
- asset_name : stylish-haskell-${{ steps.get_version.outputs.version }}-darwin-x86_64.zip
100
- asset_content_type : application/zip
59
+ files : ' artifacts-*/stylish-haskell-*'
0 commit comments