forked from dapphub/dapptools
-
Notifications
You must be signed in to change notification settings - Fork 1
121 lines (103 loc) · 3.28 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
name: "Release"
on:
push:
tags:
- '[a-z]+/[0-9]+.[0-9]+.[0-9]+'
jobs:
macosRelease:
runs-on: ${{ matrix.os }}
name: macosRelease
strategy:
matrix:
os:
- macos-latest
include:
- os: macos-latest
brew: automake
steps:
- name: Workaround for actions/cache#403
if: runner.os == 'macOS'
run: |
brew install gnu-tar
echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
- name: Get Packages
uses: mstksg/get-package@v1
with:
brew: ${{ matrix.brew }}
apt-get: ${{ matrix.apt-get }}
- name: Checkout
uses: actions/checkout@v3
- name: Cache Local
id: cache-local
uses: actions/cache@v3
with:
path: ~/.local/
key: ${{ runner.os }}-local-v3
- name: Cache Stack
id: cache-stack
uses: actions/cache@v3
with:
path: ~/.stack
key: ${{ runner.os }}-stack-v3
- name: Build Binaries
run: |
.github/scripts/install-solc.sh
.github/scripts/install-z3.sh
.github/scripts/install-cvc4.sh
env:
HOST_OS: ${{ runner.os }}
- name: Build Libraries
run: |
.github/scripts/install-libsecp256k1.sh
.github/scripts/install-libff.sh
env:
HOST_OS: ${{ runner.os }}
- name: Build Dependencies
run: |
cd src/hevm && stack build --ghc-options="-Werror" --extra-include-dirs=$HOME/.local/include --extra-lib-dirs=$HOME/.local/lib --only-dependencies && cd ../..
- name: Build and install hevm
run: |
cd src/hevm && stack install --extra-include-dirs=$HOME/.local/include --extra-lib-dirs=$HOME/.local/lib && cd ../..
- name: Test
run: |
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:$HOME/.local/lib"
export PATH="${PATH}:$HOME/.local/bin"
cp "$HOME/.local/bin/solc-0.8.6" "$HOME/.local/bin/solc"
cd src/hevm && stack test --extra-include-dirs=$HOME/.local/include --extra-lib-dirs=$HOME/.local/lib && cd ../..
- name: Amend and compress binaries (macOS)
if: runner.os == 'macOS'
run: .github/scripts/build-macos-release.sh
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: hevm-${{ runner.os }}
path: hevm.tar.gz
linuxRelease:
name: Create Release
needs: macosRelease
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# v22
- uses: cachix/install-nix-action@v22
# v12
- uses: cachix/cachix-action@v12
with:
name: dapp
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: nix-build -A hevmUnwrapped --out-link hevmLinux
- uses: actions/download-artifact@v3
with:
name: hevm-macOS
path: hevm-macOS
- name: Rename macOS artifact
run: |
mv ./hevm-macOS/hevm.tar.gz ./hevm-macOS/hevm-macOS.tar.gz
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./hevmLinux/bin/hevm
./hevm-macOS/hevm-macOS.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}