Skip to content

Commit

Permalink
ci: put macos and linux release in same workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MrChico committed May 18, 2021
1 parent 01c27e5 commit 25253bb
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 93 deletions.
88 changes: 0 additions & 88 deletions .github/workflows/ci.yml

This file was deleted.

93 changes: 88 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,95 @@
name: "Release"
on:
workflow_run:
workflows: ["macOS Binary"]
types:
- completed
push:
tags:
- '[a-z]+/[0-9]+.[0-9]+.[0-9]+'

jobs:
release:
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@v2

- name: Cache Local
id: cache-local
uses: actions/cache@v1
with:
path: ~/.local/
key: ${{ runner.os }}-local-v3

- name: Cache Stack
id: cache-stack
uses: actions/cache@v1
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.6.12" "$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@v1
with:
name: hevm-${{ runner.os }}
path: hevm.tar.gz

linuxRelease:
name: Create Release
needs: macosRelease
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down

0 comments on commit 25253bb

Please sign in to comment.