2020-06-22 10:24:59 +02:00
|
|
|
name: Builds
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [created]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
ghc: ['8.8.3']
|
2020-06-22 10:41:04 +02:00
|
|
|
os: [ubuntu-latest, macos-latest]
|
2020-06-22 10:24:59 +02:00
|
|
|
include: # GHC 8.8.3 fails to install on Windows
|
|
|
|
- ghc: '8.6.5'
|
2020-06-22 10:41:04 +02:00
|
|
|
os: windows-latest
|
2020-06-22 10:24:59 +02:00
|
|
|
|
2020-06-22 10:37:55 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
2020-06-22 10:24:59 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- uses: actions/setup-haskell@v1.1.1
|
|
|
|
with:
|
|
|
|
ghc-version: ${{ matrix.ghc }}
|
|
|
|
cabal-version: '3.2'
|
|
|
|
|
2020-06-22 11:49:47 +02:00
|
|
|
# - name: Freeze
|
|
|
|
# run: cabal freeze
|
|
|
|
|
|
|
|
# - name: Cache Cabal
|
|
|
|
# uses: actions/cache@v1.2.0
|
|
|
|
# with:
|
|
|
|
# path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
|
|
|
|
# key: ${{ runner.OS }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
|
2020-06-22 10:24:59 +02:00
|
|
|
|
|
|
|
- name: Build Myriad
|
|
|
|
run: cabal build -O2 myriad:exe:myriad
|
|
|
|
|
|
|
|
- name: Find Binary
|
|
|
|
id: find_binary
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
FOUND=$(find dist-newstyle \( -name 'myriad' -o -name 'myriad.exe' \) -type f)
|
2020-06-22 11:49:47 +02:00
|
|
|
cp $FOUND myriad
|
|
|
|
cp config.example.yaml config.yaml
|
|
|
|
strip myriad
|
|
|
|
tar -cvzf myriad-${{ github.event.release.name }}-${{ runner.OS }}-${{ matrix.ghc }}.tar.gz config.yaml languages myriad
|
2020-06-22 10:24:59 +02:00
|
|
|
|
|
|
|
- name: Upload Binary
|
|
|
|
uses: actions/upload-release-asset@v1.0.2
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ github.event.release.upload_url }}
|
2020-06-22 11:49:47 +02:00
|
|
|
asset_path: myriad-${{ github.event.release.name }}-${{ runner.OS }}-${{ matrix.ghc }}.tar.gz
|
|
|
|
asset_name: myriad-${{ github.event.release.name }}-${{ runner.OS }}-${{ matrix.ghc }}.tar.gz
|
2020-06-22 10:24:59 +02:00
|
|
|
asset_content_type: application/gzip
|