summaryrefslogtreecommitdiff
path: root/.github/workflows/build-macos-package.yml
blob: 873ae9da63609d7afa6510d1fb9ef0556ae18b05 (plain)
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
name: Build macOS Package

on: [push, pull_request]

jobs:
  build:
    name: Build on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [macOS-latest]
        cabal: ["3.2"]
        ghc: ["8.6.5"]

    steps:
    - uses: actions/checkout@v1

    - uses: actions/setup-haskell@v1.1.1
      id: setup-haskell-cabal
      name: Setup Haskell
      with:
        ghc-version: ${{ matrix.ghc }}
        cabal-version: ${{ matrix.cabal }}

    - name: Freeze
      run: |
        cabal freeze

    - uses: actions/cache@v1
      name: Cache ~/.cabal/store
      with:
        path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
        key: ${{ runner.os }}-${{ matrix.ghc }}
        # key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}

    - name: Install build tools
      run: |
        brew install \
          automake \
          autoconf \
          libtool

    - name: Checkout RGL
      run: |
        git clone --depth 1 https://github.com/GrammaticalFramework/gf-rgl.git ../gf-rgl

    - name: Build macOS package
      run: |
        make pkg

    - name: Copy packages
      run: |
        mkdir macos/dist
        cp ../gf_*.pkg macos/dist/

    - uses: actions/upload-artifact@v2
      with:
        path: macos/dist