Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/haskell.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Haskell CI
name: CI

on:
push:
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Publish

on:
release:
types: [published]

permissions:
contents: write

env:
# <layer name>|<features>
# WARNING: Don't put spaces around the | character.
LAYERS: |
LH0|B
LH1|B D
LH2|P B L
# TODO: These are placeholders. Later on, we will decide on what each layer should provide.

jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
name: linux
ext: ""
archive: tar.gz
- os: windows-latest
name: win
ext: ".exe"
archive: zip
- os: macos-latest
name: osx
ext: ""
archive: tar.gz
runs-on: ${{ matrix.os }}
env:
FOLDER: LayeredHaskell-${{ matrix.name }}
ARCHIVE: LayeredHaskell-${{ matrix.name }}.${{ matrix.archive }}

steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
with:
ghc-version: '9.6.7'
cabal-version: '3.12.1.0'

- name: Build all layers
shell: bash
run: |
cabal update
mkdir -p "dist/$FOLDER"
while IFS='|' read -r name features; do
[ -z "$name" ] && continue
cabal run LayeredHaskell-make -- set $features < /dev/null
cabal build exe:LayeredHaskell < /dev/null
cp "$(cabal list-bin exe:LayeredHaskell)" "dist/$FOLDER/$name${{ matrix.ext }}"
done <<< "$LAYERS"

- name: Create archive
shell: bash
run: |
cd dist
if [ "${{ matrix.archive }}" = "zip" ]; then
7z a "../$ARCHIVE" "$FOLDER"
else
tar -czf "../$ARCHIVE" "$FOLDER"
fi

- name: Attach to release
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload "${{ github.event.release.tag_name }}" "$ARCHIVE"
28 changes: 18 additions & 10 deletions LayeredHaskell-make/LayeredHaskell-make.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,14 @@ tested-with: GHC == 9.6.7

-- Extra source files to be distributed with the package, such as examples, or a tutorial module.
extra-source-files:
src/LH/Feature/Features
src/LH/Feature/**/*.hs
src/LH/Feature/**/*.y
src/LHMake/Feature/Features
src/LHMake/Feature/**/*.hs
src/LHMake/Feature/**/*.y

source-repository head
type: git
location: https://github.com/hshkk/LayeredHaskell
subdir: LayeredHaskell-make

common warnings
ghc-options: -Wall
Expand All @@ -86,13 +91,13 @@ library

-- Other library packages from which modules are imported.
build-depends:
, base ^>=4.18.3.0
, containers ^>=0.6.7
, directory ^>=1.3.8
, filepath ^>=1.4.301
, happy-lib ^>=2.2
, haskell-src ^>=1.0.4
, text ^>=2.0.2
, base ^>=4.18.3.0
, containers ^>=0.6.7
, directory ^>=1.3.8
, filepath ^>=1.4.301
, happy-lib ^>=2.2
, haskell-src-exts ^>=1.24.0
, text ^>=2.0.2

-- Directories containing source files.
hs-source-dirs: src
Expand All @@ -111,6 +116,9 @@ executable LayeredHaskell-make
other-modules:
Paths_LayeredHaskell_make

autogen-modules:
Paths_LayeredHaskell_make

-- LANGUAGE extensions used by modules in this package.
-- other-extensions:

Expand Down
Loading
Loading