From f8272382cb1dfdb624d78f9337a7822cfd32ccd6 Mon Sep 17 00:00:00 2001 From: drlkf Date: Sun, 25 Oct 2026 20:52:34 +0100 Subject: [PATCH] ci: backport same ci as `megaparsec-utils` --- .github/workflows/semantic-release.yml | 11 +++-- .github/workflows/stack-build.yml | 15 ++++-- .gitignore | 1 + .releaserc.mjs | 11 +++-- api/megaparsec-time.api | 9 ++++ megaparsec-time.cabal | 67 -------------------------- stack-lts-22.yaml.lock | 19 ++++++++ stack-lts-23.yaml.lock | 19 ++++++++ 8 files changed, 72 insertions(+), 80 deletions(-) create mode 100644 api/megaparsec-time.api delete mode 100644 megaparsec-time.cabal create mode 100644 stack-lts-22.yaml.lock create mode 100644 stack-lts-23.yaml.lock diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml index 6093625..4cbe35a 100644 --- a/.github/workflows/semantic-release.yml +++ b/.github/workflows/semantic-release.yml @@ -10,6 +10,9 @@ jobs: build: name: Semantic release runs-on: ubuntu-latest + if: >- + github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.event == 'push' steps: - uses: actions/checkout@v4 with: @@ -26,26 +29,24 @@ jobs: uses: cycjimmy/semantic-release-action@v4 env: GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}" - HACKAGE_KEY: "${{ secrets.HACKAGE_TOKEN }}" with: - ci: ${{ github.ref == github.event.repository.default_branch }} extra_plugins: | conventional-changelog-conventionalcommits @semantic-release/changelog @semantic-release/git github:haskell-github-trust/semantic-release-haddock-since - semantic-release-stack-upload - name: Semantic release output + env: + RELEASE_NOTES: "${{ steps.semantic.outputs.new_release_notes }}" run: | echo ref: ${{ github.ref }} - echo dry_run: ${{ github.ref_name != github.event.repository.default_branch }} echo published: ${{ steps.semantic.outputs.new_release_published }} echo last_release: ${{ steps.semantic.outputs.last_release_version }} echo new_version: ${{ steps.semantic.outputs.new_release_version }} echo git_head: ${{ steps.semantic.outputs.new_release_git_head }} echo release_notes: - echo "${{ steps.semantic.outputs.new_release_notes }}" + echo "$RELEASE_NOTES" ... diff --git a/.github/workflows/stack-build.yml b/.github/workflows/stack-build.yml index 7838a8b..21a7228 100644 --- a/.github/workflows/stack-build.yml +++ b/.github/workflows/stack-build.yml @@ -20,16 +20,21 @@ jobs: - id: generate uses: freckle/stack-action/generate-matrix@v5 + single-constraints: + name: Single constraint per line + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: "! grep -rnPzo '\\([^()]*,[^()]*\\)\\s*=>' src test" + build: name: ${{ matrix.stack-yaml }} / ${{ matrix.os }} needs: generate - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.os == 'macos' && 'macos-15' || format('{0}-latest', matrix.os) }} strategy: fail-fast: false matrix: - # macos-15 pinned, macos-latest breaks GHC linking - # https://github.com/actions/runner-images/issues/14940 - os: [ubuntu-latest, macos-15, windows-latest] + os: [ubuntu, macos, windows] stack-yaml: ${{ fromJSON(needs.generate.outputs.stack-yamls) }} env: STACK_YAML: ${{ matrix.stack-yaml }} @@ -43,5 +48,5 @@ jobs: continue-on-error: true - name: Build documentation - run: stack haddock + run: stack haddock --no-haddock-deps ... diff --git a/.gitignore b/.gitignore index 1c231fa..8cc17ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +megaparsec-time.cabal .stack-work/ *~ dist-newstyle/ diff --git a/.releaserc.mjs b/.releaserc.mjs index 4bc58c8..4dbec04 100644 --- a/.releaserc.mjs +++ b/.releaserc.mjs @@ -13,7 +13,13 @@ export default { }, ], "@semantic-release/release-notes-generator", - "semantic-release-haddock-since", + [ + "semantic-release-haddock-since", + { + versionFiles: ["package.yaml"], + baseline: "api/megaparsec-time.api", + }, + ], [ "@semantic-release/changelog", { @@ -24,10 +30,9 @@ export default { [ "@semantic-release/git", { - assets: ["CHANGELOG.md", "*.cabal", "package.yaml", "api/*.api", "src/**/*.hs"], + assets: ["package.yaml", "CHANGELOG.md", "api/*.api", "src/**/*.hs"], }, ], "@semantic-release/github", - "semantic-release-stack-upload", ], } diff --git a/api/megaparsec-time.api b/api/megaparsec-time.api new file mode 100644 index 0000000..9abb237 --- /dev/null +++ b/api/megaparsec-time.api @@ -0,0 +1,9 @@ +Text.Megaparsec.Time.DayResult +Text.Megaparsec.Time.dateParser +Text.Megaparsec.Time.dayParser +Text.Megaparsec.Time.durationParser +Text.Megaparsec.Time.gregorianDayParser +Text.Megaparsec.Time.hoursParser +Text.Megaparsec.Time.minutesParser +Text.Megaparsec.Time.secondsParser +Text.Megaparsec.Time.timeParser diff --git a/megaparsec-time.cabal b/megaparsec-time.cabal deleted file mode 100644 index 6cd4ef7..0000000 --- a/megaparsec-time.cabal +++ /dev/null @@ -1,67 +0,0 @@ -cabal-version: 1.12 - --- This file has been generated from package.yaml by hpack version 0.39.6. --- --- see: https://github.com/sol/hpack - -name: megaparsec-time -version: 0.0.0.0-dev -synopsis: Parsers and utilities for the Megaparsec library. -description: Common parsers and utilities to use with the Megaparsec library. -category: Parsing -homepage: https://github.com/haskell-github-trust/megaparsec-time -bug-reports: https://github.com/haskell-github-trust/megaparsec-time/issues -author: drlkf -maintainer: drlkf@drlkf.net -copyright: 2025 drlkf -license: GPL-3 -license-file: LICENSE -build-type: Simple -tested-with: - GHC == 9.10 - , GHC == 9.8 - , GHC == 9.6 -extra-source-files: - README.md - CHANGELOG.md - -source-repository head - type: git - location: https://github.com/haskell-github-trust/megaparsec-time - -library - exposed-modules: - Text.Megaparsec.Time - other-modules: - Paths_megaparsec_time - hs-source-dirs: - src - ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints - build-depends: - base >=4.7 && <5 - , megaparsec >=9.0 && <10 - , megaparsec-utils >=0.1 && <1 - , parser-combinators >=1.0 && <2 - , time >=1.10 && <2 - default-language: Haskell2010 - -test-suite megaparsec-time-test - type: exitcode-stdio-1.0 - main-is: Spec.hs - other-modules: - Text.Megaparsec.TimeSpec - Paths_megaparsec_time - hs-source-dirs: - test - ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N - build-depends: - QuickCheck - , base >=4.7 && <5 - , hspec - , megaparsec >=9.0 && <10 - , megaparsec-time - , megaparsec-utils >=0.1 && <1 - , parser-combinators >=1.0 && <2 - , time >=1.10 && <2 - default-language: Haskell2010 - build-tool-depends: hspec-discover:hspec-discover == 2.* diff --git a/stack-lts-22.yaml.lock b/stack-lts-22.yaml.lock new file mode 100644 index 0000000..ff164c6 --- /dev/null +++ b/stack-lts-22.yaml.lock @@ -0,0 +1,19 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/topics/lock_files + +packages: +- completed: + hackage: megaparsec-utils-0.2.0.0@sha256:6934c23b0ae24392ad21fd5c9382e4466ce75223244ca4d6fcb235c36bc8f39b,2262 + pantry-tree: + sha256: 99b4518330360212e34c17ee59c0b942ded2861d541375997e9484564142be29 + size: 661 + original: + hackage: megaparsec-utils-0.2.0.0 +snapshots: +- completed: + sha256: 238fa745b64f91184f9aa518fe04bdde6552533d169b0da5256670df83a0f1a9 + size: 721141 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/44.yaml + original: lts-22.44 diff --git a/stack-lts-23.yaml.lock b/stack-lts-23.yaml.lock new file mode 100644 index 0000000..262c52f --- /dev/null +++ b/stack-lts-23.yaml.lock @@ -0,0 +1,19 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/topics/lock_files + +packages: +- completed: + hackage: megaparsec-utils-0.2.0.0@sha256:6934c23b0ae24392ad21fd5c9382e4466ce75223244ca4d6fcb235c36bc8f39b,2262 + pantry-tree: + sha256: 99b4518330360212e34c17ee59c0b942ded2861d541375997e9484564142be29 + size: 661 + original: + hackage: megaparsec-utils-0.2.0.0 +snapshots: +- completed: + sha256: 7e724f347d5969cb5e8dde9f9aae30996e3231c29d1dafd45f21f1700d4c4fcb + size: 684460 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/28.yaml + original: lts-23.28