Skip to content

Bump svenstaro/upload-release-action from 1.pre.release to 2.9.0 #989

Bump svenstaro/upload-release-action from 1.pre.release to 2.9.0

Bump svenstaro/upload-release-action from 1.pre.release to 2.9.0 #989

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/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: "artifacts/*/*.zip"
tag: ${{ github.ref }}
overwrite: true
file_glob: true