-
-
Notifications
You must be signed in to change notification settings - Fork 24
77 lines (68 loc) · 1.87 KB
/
cabal.yml
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
name: Cabal Build
on:
push:
branches:
- main
pull_request:
create:
tags:
- '*'
jobs:
build:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
cabal: ["3.6.2.0"]
ghc: ["9.0.1"]
include:
- os: ubuntu-latest
os_name: linux
artifact: "pboy-linux.tar.gz"
- os: macOS-latest
os_name: osx
artifact: "pboy-osx.tar.gz"
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/[email protected]
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- run: cabal update
- run: cabal freeze
- uses: actions/cache@v2
with:
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-
- name: Build
run: |
mkdir bin
cabal install --install-method=copy --installdir=bin
ldd bin/pboy || otool -L bin/pboy || true
# - name: Compress binaries
# uses: svenstaro/upx-action@v2
# with:
# file: bin/pboy
# args: --best
# strip: true
- name: Prepare Publishing
if: startsWith(github.ref, 'refs/tags/')
run: |
cd bin
tar -czf ${{ matrix.artifact }} pboy
shasum -a 256 ${{ matrix.artifact }}
- name: Publish Release Binaries
if: startsWith(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bin/${{ matrix.artifact }}
tag: ${{ github.ref }}
prerelease: true
overwrite: true