-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (66 loc) · 2.01 KB
/
ci.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: CI
on: ['push', "pull_request"]
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macOS-latest, ubuntu-latest]
cabal: ["3.6.2.0"]
ghc: ["9.2.2"]
steps:
- name: Get the version
id: get_version
run: 'echo ::set-output name=version::${GITHUB_REF#refs/tags/}'
- uses: actions/checkout@v3
- name: "Show uname"
run: uname | tr 'A-Z' 'a-z'
- uses: haskell/actions/setup@v2
name: Setup Haskell Cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Add ~/.cabal/bin to PATH
run: echo "$HOME/.cabal/bin" >> $GITHUB_PATH
- name: Build
run: cabal build
id: build
- name: Test
run: cabal test
- name: Build artifact
if: startsWith(github.ref, 'refs/tags')
run: make artifact
env:
PATAT_TAG: ${{ steps.get_version.outputs.version }}
- uses: actions/upload-artifact@v2
if: startsWith(github.ref, 'refs/tags')
with:
path: artifacts/*
name: artifacts
release:
name: Release
needs: build
runs-on: [ubuntu-latest]
if: startsWith(github.ref, 'refs/tags')
steps:
- name: Get the version
id: get_version
run: 'echo ::set-output name=version::${GITHUB_REF#refs/tags/}'
- uses: actions/download-artifact@v2
with:
name: artifacts
- name: Display structure of downloaded files
run: ls -R
- name: Upload Linux Asset
uses: softprops/action-gh-release@v1
with:
files: BDC-${{ steps.get_version.outputs.version }}-linux-x86_64.tar.gz
- name: Upload MacOS Asset
uses: softprops/action-gh-release@v1
with:
files: BDC-${{ steps.get_version.outputs.version }}-darwin-x86_64.zip
- name: Upload Windows Asset
uses: softprops/action-gh-release@v1
with:
files: BDC-${{ steps.get_version.outputs.version }}-windows-x86_64.zip