Builds must pass with Haddock enabled and no warnings in order for your PR to be accepted.
Make sure you have yarn
installed via corepack.
This way the version of yarn used in building the package is managed by the attribute packageManager
in package.json
.
# First, build the graphql-codegen Typescript code
yarn install
yarn build
stack build
# with haddock
stack build --haddock
The following linters must pass CI in order for your PR to be accepted.
-
HLint
cabal install hlint-3.5 hlint .
-
fourmolu
cabal install fourmolu-0.13.0.0 fourmolu -i .
-
ESLint
yarn lint .
You can install pre-commit to run these linters as a git commit hook.
All tests must pass CI in order for your PR to be accepted.
stack test
yarn graphql-codegen test
All code should be fully documented, whether it's adding comments for future developers or adding Haddock docs for functionality exposed in Haddock.
Changes that affect users should be mentioned in CHANGELOG.md
. When doing so,
add an entry under under the Unreleased
header containing:
- A description of the change
- The type of change (breaking, bugfix, etc.)
- If applicable,
- How to migrate existing code
- When it should be used
- What it supersedes
The format is not important, as the list will be curated when releasing.
Follow these steps to release this project:
-
Create a new branch
- Bump version in
package.yaml
- All version bumps should follow PvP
- Curate
CHANGELOG.md
, creating a new section for this version and moving everything previously inUnreleased
into the new section (keepingUnreleased
as a section) - Add comments to new features indicating when it was added (e.g.
-- @since v2.0.0
) - Run
stack haddock graphql-client
and skim through documentation
- Bump version in
-
Create PR as usual and merge into
main
- In the
check_sdist
CI job, check the output of thestack sdist
step for any warnings.
- In the
-
Ensure your Hackage token is set in Settings > Secrets > Actions as
HACKAGE_TOKEN_<github_username>
(replace any non alphanumeric characters in username with_
).- Generate a token from
https://hackage.haskell.org/user/<hackage_username>/manage
- Generate a token from
-
Go to the GitHub Actions page, click on the "Release" workflow, and click "Run workflow" on the main branch
-
Publish the candidate: https://hackage.haskell.org/package/graphql-client/candidates
-
Publish the GitHub release: https://github.com/brandonchinn178/graphql-client/releases