Skip to content
Closed
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
22 changes: 0 additions & 22 deletions .cardano-dev.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions .changes/20260327_185614_cardano-rpc_mateusz.galazyn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: unimportant refactoring
kind:
- refactoring
pr: 1234
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog fragment has a placeholder PR number (pr: 1234). Herald validation expects fragment pr to match the current PR number; please update it accordingly (and keep it consistent across all fragments in this PR).

Suggested change
pr: 1234
pr: 5678

Copilot uses AI. Check for mistakes.
project: cardano-rpc
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR changes files under cardano-api/, but there is no .changes/ fragment for project: cardano-api (only cardano-rpc / cardano-wasm). Per the new herald rules, each modified project needs at least one fragment, so add a cardano-api fragment (or adjust projects if the intent is different) to avoid CI validation failures.

Suggested change
project: cardano-rpc
project: cardano-api

Copilot uses AI. Check for mistakes.
5 changes: 5 additions & 0 deletions .changes/20260327_185614_cardano-wasm_mateusz.galazyn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: unimportant refactoring
kind:
- refactoring
pr: 1234
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog fragment has a placeholder PR number (pr: 1234). Herald validation expects fragment pr to match the current PR number; please update it accordingly (and keep it consistent across all fragments in this PR).

Suggested change
pr: 1234
pr: 5678

Copilot uses AI. Check for mistakes.
project: cardano-wasm
6 changes: 6 additions & 0 deletions .changes/20260327_185802_cardano-rpc_mateusz.galazyn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description: Fixed some bug
kind:
- bugfix
- compatible
pr: 1235
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog fragment has a placeholder PR number (pr: 1235). Herald validation (per the updated process) expects fragment pr to match the current PR number; please update it accordingly (and keep it consistent across all fragments in this PR).

Suggested change
pr: 1235
pr: 9999

Copilot uses AI. Check for mistakes.
project: cardano-rpc
16 changes: 16 additions & 0 deletions .changes/_TEMPLATE.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog fragment template - copy this file and fill in the fields.
# Or use 'herald new' for interactive creation.
#
# Files starting with _ are ignored by herald.
#
# Available projects and kinds are defined in .herald.yml

# Which project this change belongs to (see 'projects' in .herald.yml)
project: my-project
# Pull request number associated with this change
pr: 0
# One or more change kinds (see 'kinds' in .herald.yml)
kind:
- bugfix
description: |
Describe your change here.
37 changes: 16 additions & 21 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
# Changelog

```yaml
- description: |
<insert-changelog-description-here>
# uncomment types applicable to the change:
type:
# - feature # introduces a new feature
# - breaking # the API has changed in a breaking way
# - compatible # the API has changed but is non-breaking
# - optimisation # measurable performance improvements
# - refactoring # QoL changes
# - bugfix # fixes a defect
# - test # fixes/modifies tests
# - maintenance # not directly related to the code
# - release # related to a new release preparation
# - documentation # change in code docs, haddocks...
# uncomment at least one main project this PR is associated with
projects:
# - cardano-api
# - cardano-api-gen
# - cardano-rpc
# - cardano-wasm
Every PR needs a changelog fragment in `.changes/`. Create one with:

```bash
herald new
```

Or non-interactively:

```bash
herald new -p cardano-api -k bugfix -d "Fix something" --pr 1234
```

Available projects: `cardano-api`, `cardano-api-gen`, `cardano-rpc`, `cardano-wasm`
Available kinds: `breaking`, `feature`, `compatible`, `bugfix`, `optimisation`, `refactoring`, `test`, `maintenance`, `release`, `documentation`

See `.herald.yml` for full configuration. CI will validate your fragment automatically.

# Context

Additional context for the PR goes here. If the PR fixes a particular issue please provide a [link](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword=) to the issue.
Expand All @@ -36,6 +30,7 @@ Highlight important bits of the PR that will make the review faster. If there ar
- [ ] Commit sequence broadly makes sense and commits have useful messages
- [ ] New tests are added if needed and existing tests are updated. See [Running tests](https://github.com/input-output-hk/cardano-node-wiki/wiki/Running-tests) for more details
- [ ] Self-reviewed the diff
- [ ] Changelog fragment added in `.changes/`

<!--
### Note on CI ###
Expand Down
101 changes: 13 additions & 88 deletions .github/workflows/check-pr-changelog.yml
Original file line number Diff line number Diff line change
@@ -1,101 +1,26 @@
name: Check if PR changelog was filled correctly
name: Check changelog fragments

on:
merge_group:
pull_request:
types: [opened, edited, synchronize, ready_for_review]
types: [opened, synchronize, ready_for_review]

jobs:
check-changelog:
if: ${{ github.event_name != 'merge_group' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
if: ${{ github.event_name != 'merge_group' }}
with:
node-version: 22
fetch-depth: 0

- run: npm install js-yaml@4.1.0
if: ${{ github.event_name != 'merge_group' }}

- name: Fail if PR changelog is not correct
if: ${{ github.event_name != 'merge_group' }}
uses: actions/github-script@v8
id: check-changelog
- uses: cachix/install-nix-action@v30
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const yaml = require('js-yaml');
const fs = require('fs');
const execSync = require('child_process').execSync;

const prDescription = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});

const changelogRegex = /# Changelog[\s\S]*?```yaml([\s\S]*?)```/;
const changelogMatch = prDescription.data.body.match(changelogRegex);
const yamlContent = changelogMatch ? changelogMatch[1].trim() : '';
yamlContent || console.error('Failed to find changelog YAML section in the "Changelog" paragraph');

try {
changelog = yaml.load(yamlContent)[0];
} catch (e) {
console.error('Failed to parse YAML changelog as array:', yamlContent);
process.exit(1);
}

try {
config = yaml.load(fs.readFileSync('.cardano-dev.yaml', 'utf8'));
} catch (e) {
console.error('Failed to load .cardano-dev.yaml config:', e);
process.exit(1);
}

let isCompatibilityValid = false;
if (!changelog.compatibility) {
isCompatibilityValid = true;
}
if (!isCompatibilityValid) {
console.error('Changelog field "compatibility" is deprecated and no longer used. Please remove it.');
}

let isTypeValid = false;
const validTypeValues = Object.keys(config.changelog.options.type);
if (Array.isArray(changelog.type) && !!changelog.type) {
isTypeValid = changelog.type.every(value => validTypeValues.includes(value));
} else {
isTypeValid = validTypeValues.includes(changelog.type);
}
if (!isTypeValid) {
console.error(`PR changelog has invalid type: ${changelog.type}\nExpected one, or more of: ${validTypeValues}`)
}

let isProjectsValid = false;
// .filter(Boolean) is a trick that removes empty values from the array (see https://michaeluloth.com/javascript-filter-boolean/)
const validProjectsValues = execSync("ls */CHANGELOG* | cut -d/ -f1").toString().split('\n').filter(Boolean)
if (Array.isArray(changelog.projects) && !!changelog.projects) {
isProjectsValid = changelog.projects.every(value => validProjectsValues.includes(value));
} else {
isProjectsValid = validProjectsValue.includes(changelog.projects);
}
if (!isProjectsValid) {
console.error(`PR changelog has invalid project: ${changelog.projects}\nExpected one, or more of: ${validProjectsValues}`)
}

let isDescriptionValid = true;
if (changelog.description.trim() === '<insert-changelog-description-here>') {
console.error('PR changelog description has not been updated!')
isDescriptionValid = false;
} else if (!changelog.description.trim()) {
console.error('PR changelog description field is missing!')
isDescriptionValid = false;
}

if (!isCompatibilityValid || !isTypeValid || !isProjectsValid || !isDescriptionValid) {
console.error('Failed PR changelog checks!');
process.exit(1);
}
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
substituters = https://cache.iog.io/ https://cache.nixos.org/

- uses: input-output-hk/cardano-dev/herald/.github/actions/validate@mgalazyn/release-tool
with:
version: github:input-output-hk/cardano-dev/mgalazyn/release-tool
Comment on lines +24 to +26
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This uses an external action pinned to a moving branch (@mgalazyn/release-tool). Pin to a tag or commit SHA to avoid supply-chain risk and make CI reproducible.

Suggested change
- uses: input-output-hk/cardano-dev/herald/.github/actions/validate@mgalazyn/release-tool
with:
version: github:input-output-hk/cardano-dev/mgalazyn/release-tool
- uses: input-output-hk/cardano-dev/herald/.github/actions/validate@3b2f9c4d5e6a7b8c9d0e1f2a3b4c5d6e7f8a9b0
with:
version: github:input-output-hk/cardano-dev/mgalazyn/release-tool?ref=3b2f9c4d5e6a7b8c9d0e1f2a3b4c5d6e7f8a9b0

Copilot uses AI. Check for mistakes.
24 changes: 1 addition & 23 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,26 +164,4 @@ jobs:
echo 'Build complete'
fi

release:
needs: [build]
if: ${{ startsWith(github.ref, 'refs/tags') }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create Release Tag
id: create_release_tag
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_OUTPUT"

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
# Tag-triggered release moved to .github/workflows/release.yml
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
workflow_dispatch:
inputs:
package:
description: 'Package to release (must match a project in .herald.yml)'
required: true
type: choice
options:
- cardano-api
- cardano-api-gen
- cardano-rpc
- cardano-wasm
version:
description: 'Explicit version (A.B.C.D). Leave empty for auto-bump.'
required: false
type: string

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
substituters = https://cache.iog.io/ https://cache.nixos.org/

- uses: input-output-hk/cardano-dev/herald/.github/actions/release@mgalazyn/release-tool
with:
package: ${{ inputs.package }}
version: ${{ inputs.version }}
Comment on lines +41 to +42
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

${{ inputs.package }} / ${{ inputs.version }} won’t resolve in a normal workflow_dispatch workflow; use the github.event.inputs.* context instead so the selected inputs are passed to the release action.

Suggested change
package: ${{ inputs.package }}
version: ${{ inputs.version }}
package: ${{ github.event.inputs.package }}
version: ${{ github.event.inputs.version }}

Copilot uses AI. Check for mistakes.
herald-ref: github:input-output-hk/cardano-dev/mgalazyn/release-tool
Comment on lines +39 to +43
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow uses an external action and a herald-ref that point at a moving branch (@mgalazyn/release-tool). For supply-chain safety and reproducibility, pin these to an immutable tag or commit SHA (and keep herald-ref consistent with that pin).

Suggested change
- uses: input-output-hk/cardano-dev/herald/.github/actions/release@mgalazyn/release-tool
with:
package: ${{ inputs.package }}
version: ${{ inputs.version }}
herald-ref: github:input-output-hk/cardano-dev/mgalazyn/release-tool
- uses: input-output-hk/cardano-dev/herald/.github/actions/release@6d5f6e845214071c5b66f0cc8b015f0f8baf0da3
with:
package: ${{ inputs.package }}
version: ${{ inputs.version }}
herald-ref: github:input-output-hk/cardano-dev/6d5f6e845214071c5b66f0cc8b015f0f8baf0da3

Copilot uses AI. Check for mistakes.
76 changes: 76 additions & 0 deletions .herald.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Herald configuration
# Changelog and release automation for PVP-versioned Haskell projects

# Git repository in owner/repo format (used for PR links in changelogs)
git-repo: intersectmbo/cardano-api

# Directory for changelog fragments, relative to repo root
# Fragments are YAML files created by 'herald new' and consumed by 'herald batch'
changes-dir: .changes

# Change kinds and their properties
#
# Each kind defines:
# notable: if true, changes of this kind appear in the changelog
# if false, they still bump the version but are omitted from the changelog text
# bump: PVP version component to bump when this kind is present
# 0.1.0.0 = bump 2nd component (breaking changes)
# 0.0.1.0 = bump 3rd component (features, compatible changes)
# 0.0.0.1 = bump 4th component (patches, internal changes)
#
# The highest bump across all fragment kinds determines the final version bump.
kinds:
breaking:
bump: 0.1.0.0
description: the API has changed in a breaking way
bugfix:
bump: 0.0.0.1
description: fixes a defect
compatible:
bump: 0.0.1.0
description: the API has changed but is non-breaking
documentation:
notable: false
bump: 0.0.0.1
description: change in code docs, haddocks
feature:
bump: 0.0.1.0
description: introduces a new feature
maintenance:
notable: false
bump: 0.0.0.1
description: not directly related to the code
optimisation:
bump: 0.0.0.1
description: measurable performance improvements
refactoring:
notable: false
bump: 0.0.0.1
description: code quality improvements
release:
notable: false
bump: 0.0.0.1
description: related to a new release preparation
test:
notable: false
bump: 0.0.0.1
description: fixes or modifies tests

# Projects in this repository
#
# Each project needs:
# changelog: path to the project's CHANGELOG.md (relative to repo root)
# cabal-file: (optional) path to the project's .cabal file (version is read/updated here)
projects:
cardano-api:
changelog: cardano-api/CHANGELOG.md
cabal-file: cardano-api/cardano-api.cabal
cardano-api-gen:
changelog: cardano-api-gen/CHANGELOG.md
cabal-file: cardano-api-gen/cardano-api-gen.cabal
cardano-rpc:
changelog: cardano-rpc/CHANGELOG.md
cabal-file: cardano-rpc/cardano-rpc.cabal
cardano-wasm:
changelog: cardano-wasm/CHANGELOG.md
cabal-file: cardano-wasm/cardano-wasm.cabal
Loading
Loading