Skip to content

Allow filepath-1.5, bump CI to GHC 9.10 (#41) #69

Allow filepath-1.5, bump CI to GHC 9.10 (#41)

Allow filepath-1.5, bump CI to GHC 9.10 (#41) #69

Workflow file for this run

name: Binaries
on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
workflow_dispatch:
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
stack: ["2.9.3"]
ghc: ["9.2.5"]
steps:
- name: Get the version
id: get_version
run: 'echo ::set-output name=version::${GITHUB_REF#refs/tags/}'
- uses: actions/checkout@v2
- uses: actions/cache@v2
name: Cache ~/.stack
with:
path: |
~/.stack
.stack-work
key: "${{ runner.os }}-stack-${{ matrix.stack }}-ghc-${{ matrix.ghc }}-${{ hashFiles('goldplate.cabal', 'stack.yaml', 'stack.yaml.lock') }}"
restore-keys: "${{ runner.os }}-stack-${{ matrix.stack }}-ghc-${{ matrix.ghc }}-"
- name: Setup Haskell Stack
uses: haskell/actions/setup@v1
with:
enable-stack: true
stack-no-global: true
- name: Build
run: stack build
- name: Create artifact
if: startsWith(github.ref, 'refs/tags/v')
run: |
PLATFORM=$(uname | tr 'A-Z' 'a-z')
VERSION=${{ steps.get_version.outputs.version }}
cp $(stack path --local-install-root)/bin/goldplate goldplate
tar -czf goldplate.tar.gz goldplate
mkdir -p artifacts
mv goldplate.tar.gz artifacts/goldplate-$VERSION-$PLATFORM-x86_64.tar.gz
- uses: actions/upload-artifact@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
path: artifacts/*
name: artifacts
release:
name: Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Get the version
id: get_version
run: 'echo ::set-output name=version::${GITHUB_REF#refs/tags/}'
- uses: actions/download-artifact@v2
with:
name: artifacts
- name: Display structure of downloaded files
run: ls -R
- uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.version }}
release_name: ${{ steps.get_version.outputs.version }}
- name: Upload Linux Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./goldplate-${{ steps.get_version.outputs.version }}-linux-x86_64.tar.gz
asset_name: goldplate-${{ steps.get_version.outputs.version }}-linux-x86_64.tar.gz
asset_content_type: application/gzip
- name: Upload MacOS Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./goldplate-${{ steps.get_version.outputs.version }}-darwin-x86_64.tar.gz
asset_name: goldplate-${{ steps.get_version.outputs.version }}-darwin-x86_64.tar.gz
asset_content_type: application/zip