-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (111 loc) · 4.64 KB
/
release.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: srtols Release
on:
# Trigger the workflow on the new 'v*' tag created
push:
tags:
- "v*"
jobs:
create_release:
name: Create Github Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
build_artifact:
needs: [create_release]
name: ${{ matrix.os }}/GHC ${{ matrix.ghc }}/${{ github.ref }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest]
ghc:
- 9.10.1
cabal: ["3.14.1.1"]
defaults:
run:
shell: bash
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set tag name
uses: olegtarasov/[email protected]
id: tag
with:
tagRegex: "v(.*)"
tagRegexGroup: 1
- name: Setup Haskell
uses: haskell-actions/setup@v2
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Cache ~/.cabal/store
uses: actions/cache@v2
with:
key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-${{ github.sha }}
path: ~/.cabal/store
- if: matrix.os == 'ubuntu-latest'
name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libnlopt-dev libnlopt0
- if: matrix.os == 'macOS-latest'
name: Install dependencies
run: |
brew install nlopt
ls $(brew --prefix)/Cellar/nlopt/2.9.1/lib/
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}"
echo "PKG_CONFIG_PATH=$(brew --prefix)/Cellar/nlopt/2.9.1/lib/pkgconfig" >> "${GITHUB_ENV}"
- if: matrix.os == 'windows-latest'
name: Build windows binary
run: |
stack exec -- pacman --noconfirm -Sy msys2-keyring
stack exec -- pacman --noconfirm -S mingw-w64-x86_64-pkgconf
stack exec -- pacman --noconfirm -S mingw-w64-x86_64-nlopt
mkdir dist
stack build srtree:egraphGP --copy-bins --local-bin-path=dist
stack build srtree:egraphSearch --copy-bins --local-bin-path=dist
stack build srtree:srtools --copy-bins --local-bin-path=dist
stack build srtree:rEGGression --copy-bins --local-bin-path=dist
stack build srtree:srsimplify --copy-bins --local-bin-path=dist
- if: matrix.os != 'windows-latest'
name: Build binary
run: |
mkdir dist
stack build srtree:egraphGP --copy-bins --local-bin-path=dist --flag nlopt:use-pkg-config
stack build srtree:egraphSearch --copy-bins --local-bin-path=dist --flag nlopt:use-pkg-config
stack build srtree:srtools --copy-bins --local-bin-path=dist --flag nlopt:use-pkg-config
stack build srtree:rEGGression --copy-bins --local-bin-path=dist --flag nlopt:use-pkg-config
stack build srtree:srsimplify --copy-bins --local-bin-path=dist --flag nlopt:use-pkg-config
- if: matrix.os == 'windows-latest'
name: Set extension to .exe on Windows
run: echo "EXT=.exe" >> $GITHUB_ENV
- name: Set binary path name
run: |
echo "BINARY_PATH1=./dist/srsimplify${{ env.EXT }}" >> $GITHUB_ENV
echo "BINARY_PATH2=./dist/srtools${{ env.EXT }}" >> $GITHUB_ENV
echo "BINARY_PATH2=./dist/egraphGP${{ env.EXT }}" >> $GITHUB_ENV
echo "BINARY_PATH2=./dist/egraphSearch${{ env.EXT }}" >> $GITHUB_ENV
echo "BINARY_PATH2=./dist/rEGGression${{ env.EXT }}" >> $GITHUB_ENV
- name: Upload Release Asset
id: upload-release-asset
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
${{ env.BINARY_PATH1 }}/srsimplify-${{ steps.tag.outputs.tag }}-${{ runner.os }}-ghc-${{ matrix.ghc }}${{ env.EXT }}
${{ env.BINARY_PATH2 }}/srtools-${{ steps.tag.outputs.tag }}-${{ runner.os }}-ghc-${{ matrix.ghc }}${{ env.EXT }}
${{ env.BINARY_PATH2 }}/egraphSearch-${{ steps.tag.outputs.tag }}-${{ runner.os }}-ghc-${{ matrix.ghc }}${{ env.EXT }}
${{ env.BINARY_PATH2 }}/egraphGP-${{ steps.tag.outputs.tag }}-${{ runner.os }}-ghc-${{ matrix.ghc }}${{ env.EXT }}
${{ env.BINARY_PATH2 }}/rEGGression-${{ steps.tag.outputs.tag }}-${{ runner.os }}-ghc-${{ matrix.ghc }}${{ env.EXT }}