99 strategy :
1010 matrix :
1111 os : [ubuntu-latest, macOS-latest]
12- stack : ["2.15.7 "]
12+ ghc : ["9.4", "9.6", "9.8 "]
1313
1414 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
2016
2117 - uses : haskell-actions/setup@v2
22- name : Setup Haskell Stack
18+ id : setup
2319 with :
24- enable-stack : true
25- stack-version : ${{ matrix.stack }}
26- stack-no-global : true
20+ ghc-version : ${{ matrix.ghc }}
2721
28- - uses : actions/cache@v2
29- name : Cache ~/.stack
22+ - uses : actions/cache@v3
3023 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-
3628
37- - name : Build
38- run : make build
39- id : build
29+ - run : make build
30+ - run : make test
4031
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'
4633 run : make artifact
47- env :
48- PATAT_TAG : ${{ steps.get_version.outputs.version }}
4934
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'
5237 with :
5338 path : artifacts/*
54- name : artifacts
39+ name : artifacts-${{ runner.os }}
5540
5641 release :
5742 name : Release
@@ -60,41 +45,15 @@ jobs:
6045 if : startsWith(github.ref, 'refs/tags')
6146
6247 steps :
63- - name : Get the version
64- id : get_version
65- run : ' echo ::set-output name=version::${GITHUB_REF#refs/tags/}'
66-
6748 - uses : actions/download-artifact@v4
6849 with :
69- name : artifacts
70-
71- - name : Display structure of downloaded files
72- run : ls -R
50+ pattern : artifacts-*
7351
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-*/*'
9154
92- - name : Upload MacOS Asset
93- uses : actions/upload-release-asset@v1
55+ - uses : softprops/action-gh-release@v1
9456 env :
9557 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
9658 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