Skip to content

Upgrade Haskel version (#1454) #1016

Upgrade Haskel version (#1454)

Upgrade Haskel version (#1454) #1016

Workflow file for this run

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@v4
- 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@v4
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@v4
- uses: actions/download-artifact@v4
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