Skip to content

Commit

Permalink
chore: pre-release tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Anut-py committed Oct 11, 2024
1 parent 8a3d2af commit c61a930
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 55 deletions.
69 changes: 30 additions & 39 deletions .github/workflows/cabal-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,74 +17,65 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
ghc-version: ['9.8', '9.2']
ghc-version: ["9.8", "9.6", "9.2"]
exclude:
- os: macos-latest
ghc-version: "9.2"

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up GHC ${{ matrix.ghc-version }}
uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc-version }}
# Defaults, added for clarity:
cabal-version: 'latest'
cabal-version: "latest"
cabal-update: true

- name: Install dependencies on ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt update
sudo apt install -y x11proto-xext-dev libx11-dev xorg-dev freeglut3-dev
# - name: Install dependencies on windows
# if: startsWith(matrix.os, 'windows')
# run: |
# choco install mingw

# - name: Install dependencies on macOS
# if: startsWith(matrix.os, 'macOS')
# run: |
# brew install ...

- name: Configure the build
run: |
cabal configure --enable-tests --enable-benchmarks --disable-documentation
cabal build --dry-run
# The last step generates dist-newstyle/cache/plan.json for the cache key.

- name: Restore cached dependencies
uses: actions/cache/restore@v4
id: cache
env:
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-
# IMPT: Uncomment when adding steps after cabal build
# - name: Restore cached dependencies
# uses: actions/cache/restore@v4
# id: cache
# env:
# key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
# with:
# path: ${{ steps.setup.outputs.cabal-store }}
# key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
# restore-keys: ${{ env.key }}-

- name: Install dependencies
run: cabal build all --only-dependencies
# - name: Install dependencies
# run: cabal build all --only-dependencies

# Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
- name: Save cached dependencies
uses: actions/cache/save@v4
# Caches are immutable, trying to save with the same key would error.
if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}
# # Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
# - name: Save cached dependencies
# uses: actions/cache/save@v4
# # Caches are immutable, trying to save with the same key would error.
# if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
# with:
# path: ${{ steps.setup.outputs.cabal-store }}
# key: ${{ steps.cache.outputs.cache-primary-key }}

- name: Build
run: cabal build all

- name: Run tests
run: cabal test all
# - name: Run tests
# run: cabal test all

- name: Check cabal file
run: cabal check

- name: Build documentation
run: cabal haddock all
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# h-raylib changelog

## Changelog guidelines (apply to `5.5.0.0` onward)

Changes ported from the upstream raylib code are not mentioned unless they are breaking changes. Changes and bug fixes in the h-raylib API are mentioned, breaking and non-breaking. Internal changes that do not change the API or affect functionality are not mentioned (e.g. performance improvements).

### Versioning scheme

h-raylib's version numbers do not follow the usual format. The first two numbers in the version track the underlying C raylib version. For example, `5.1.x.x` versions use raylib 5.1 under the hood. The third number represents breaking changes (renamed/deleted functions or modules). The last number represents non-breaking changes (new functions or modules, bug fixes, etc). The safest version bound format to use is `h-raylib >=x.y.z.w && <x.y.(z+1)` (instead of the usual `^>=` bound).

## Version 5.5.1.0
_11 October 2024_

- **BREAKING CHANGE**: `set*Callback` functions are no longer managed and do not return `IO C'*Callback` values
- **BREAKING CHANGE**: Removed `loadImageSvg` (upstream change in raylib)
- \[[#58](https://github.com/Anut-py/h-raylib/issues/58)\] Added support for `setTraceLogCallback`

## Version 5.5.0.0
_12 July 2024_

Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@ You can use `./devtools.js [options]` (on Linux) or `node devtools.js [options]`

[DOCUMENTATION.md](https://github.com/Anut-py/h-raylib/blob/master/DOCUMENTATION.md) has information that is specific to h-raylib.

# h-raylib roadmap
## h-raylib roadmap

This is a list of features that may be added to this project. Contributors are welcome to help implement these.

## Pending
### Pending

Items which have not yet been worked on. Feel free to work on one of these.

- Bind `rgestures`

## In progress
### In progress

- Add web build support \[[#4](https://github.com/Anut-py/h-raylib/issues/4)\]

## Implemented
### Implemented

Items which have been completed but not published to hackage.

(none)

## Published
### Published

Items which have been published to hackage.

Expand Down
27 changes: 16 additions & 11 deletions h-raylib.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.4
name: h-raylib
version: 5.5.0.0
version: 5.5.1.0
synopsis: Raylib bindings for Haskell
category: graphics
description:
Expand All @@ -17,6 +17,10 @@ extra-doc-files:
DOCUMENTATION.md
README.md

-- Requires >= 9.6.5 on Mac because this bug fix is required: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12079
-- Works with >= 9.2.8 on Windows
tested-with: GHC >= 9.6.5

extra-source-files:
default.nix
flake.nix
Expand Down Expand Up @@ -108,14 +112,13 @@ common example-options
, base
, h-raylib

other-modules: Paths_h_raylib
autogen-modules: Paths_h_raylib

other-modules: Paths_h_raylib
autogen-modules: Paths_h_raylib
other-extensions:
BangPatterns
TemplateHaskell
ghc-options: -Wall

ghc-options: -Wall

if flag(platform-web)
ghc-options:
Expand Down Expand Up @@ -257,8 +260,8 @@ library
ScopedTypeVariables
TemplateHaskell
TemplateHaskellQuotes
ghc-options: -Wall

ghc-options: -Wall

if (flag(platform-windows) || (flag(detect-platform) && os(windows)))
if flag(mingw-cross)
Expand Down Expand Up @@ -310,8 +313,8 @@ library

else

-- Unsupported OS, do nothing. If you can get it working on an
-- OS that isn't listed here, please add it here.
-- Unsupported OS, do nothing. If you can get it working on an
-- OS that isn't listed here, please add it here.
if flag(platform-nixos)
extra-libraries: raylib

Expand All @@ -322,7 +325,9 @@ library
c-sources: lib/web.c

else
cc-options: -DPLATFORM_DESKTOP_GLFW -Wno-int-to-void-pointer-cast -Wno-int-conversion
cc-options:
-DPLATFORM_DESKTOP_GLFW -Wno-int-to-void-pointer-cast

c-sources:
lib/rgui_bindings.c
lib/rl_bindings.c
Expand Down

0 comments on commit c61a930

Please sign in to comment.