Auto submodule update: cmake - add CODEOWNERS (#161) (#1353) #832
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Haskell | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
- staging | |
tags: | |
- "*" | |
pull_request: | |
paths: | |
- "haskell/**" | |
- .github/workflows/haskell.yaml | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v3 | |
name: Cache ~/.stack | |
with: | |
path: ~/.stack | |
key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-stack-global- | |
- uses: actions/cache@v3 | |
name: Cache .stack-work | |
with: | |
path: .stack-work | |
key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('**/*.hs') }} | |
restore-keys: | | |
${{ runner.os }}-stack-work- | |
- uses: haskell/actions/setup@v1 | |
with: | |
enable-stack: true | |
- name: Build binaries | |
id: build | |
working-directory: ./haskell | |
run: | | |
VERSION="$(git describe --always --tags --dirty)" | |
BUILD_TRIPLET="$(cc -dumpmachine)" | |
ARTIFACT_NAME="sbp_tools_haskell-${VERSION}-${BUILD_TRIPLET}.zip" | |
mkdir ./bins | |
stack install --local-bin-path ./bins | |
cd ./bins | |
zip ../$ARTIFACT_NAME \ | |
sbp2json \ | |
sbp2prettyjson \ | |
sbp2yaml \ | |
json2sbp \ | |
json2json \ | |
sbp2nmea | |
echo "::set-output name=artifact_name::$ARTIFACT_NAME" | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ steps.build.outputs.artifact_name }} | |
path: ./haskell/${{ steps.build.outputs.artifact_name }} | |
publish: | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: [build] | |
name: Publish github release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v2 | |
with: | |
path: artifacts | |
- name: Upload Release | |
uses: svenstaro/upload-release-action@v1-release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: "artifacts/*/*.zip" | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true |