Skip to content

Commit

Permalink
Merge pull request #584 from oasisprotocol/mz/changeLogFragments
Browse files Browse the repository at this point in the history
Init Change Log fragments
  • Loading branch information
buberdds authored Mar 12, 2024
2 parents ff929e6 + cdd8cf3 commit 63c86a7
Show file tree
Hide file tree
Showing 12 changed files with 1,589 additions and 31 deletions.
24 changes: 24 additions & 0 deletions .changelog/.markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json

# markdownlint configuration for Change Log fragments.

# For more information, see:
# https://github.com/DavidAnson/markdownlint#optionsconfig.

# Extend project's main configuration.
extends: ../.markdownlint.yml

line-length:
# Line length checking is not strict by default.
strict: true
# Change Log fragments will be listed as bullets indented by 2 spaces so they
# should be 2 characters shorter than ordinary lines.
line_length: 78

# Change Log fragments should not have a heading as the first line.
first-line-heading: false

ul-style:
# Enforce a uniform symbol for unordered lists across all Change Log
# fragments.
style: dash
8 changes: 8 additions & 0 deletions .changelog/584.process.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Add Change Log and the Change Log fragments process for assembling it

This follows the same Change Log fragments process as is used by [Oasis Core].

For more details, see [Change Log fragments].

[Oasis Core]: https://github.com/oasisprotocol/oasis-core
[Change Log fragments]: .changelog/README.md
16 changes: 16 additions & 0 deletions .changelog/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Change Log Fragments

This directory collects Change Log fragments:
short files that each contain a snippet of Markdown formatted text that will
be assembled using [towncrier] to form the [Change Log] section for the next
release.

This repository follows the same Change Log fragments style as the
[Oasis Core] repository.
Please, see [its Change Log fragments documentation] for more details.

[Change Log]: ../CHANGELOG.md
[towncrier]: https://github.com/oasisprotocol/towncrier
[Oasis Core]: https://github.com/oasisprotocol/oasis-core
[its Change Log fragments documentation]:
https://github.com/oasisprotocol/oasis-core/blob/master/.changelog/README.md
39 changes: 39 additions & 0 deletions .changelog/template.md.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{# This a Jinja2 template for preparing a new section of the Change Log with the towncrier utility.#}
## {{ versiondata.version }} ({{ versiondata.date }})
{% for section, _ in sections.items() %}

{% if sections[section] %}
{% for category, val in definitions.items() if category in sections[section] %}
{% if definitions[category]['showcontent'] %}
{{ "### " + definitions[category]['name'] }}

{% for text, values in sections[section][category].items() %}
{% set lines = text.splitlines() %}
{% set referenced_issues = "(" + values | join(',\n ') + ")" %}
{% if lines | length > 2 and lines[1] == "" %}
- {{ lines[0] }}
{{ referenced_issues }}

{{ lines[2:] | join('\n') }}
{% else %}
- {{ text }}
{{ referenced_issues }}
{% endif %}
{% if not loop.last %}

{% endif %}
{% endfor %}
{% endif %}
{% if sections[section][category]|length == 0 %}
No significant changes.

{% else %}
{% endif %}

{% endfor %}
{% else %}
No significant changes.


{% endif %}
{% endfor %}
21 changes: 21 additions & 0 deletions .github/workflows/ci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,27 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: '3.x'
# Needed for Towncrier fork to work with 3.12 and above
- name: Install setuptools
run: |
python -m pip install setuptools
- name: Install towncrier
run: |
python -m pip install https://github.com/oasisprotocol/towncrier/archive/oasis-master.tar.gz
- name: Check for presence of a Change Log fragment (only pull requests)
# NOTE: The pull request' base branch needs to be fetched so towncrier
# is able to compare the current branch with the base branch.
# Source: https://github.com/actions/checkout/#fetch-all-branches.
run: |
git fetch --no-tags origin +refs/heads/${BASE_BRANCH}:refs/remotes/origin/${BASE_BRANCH}
towncrier check --compare-with origin/${BASE_BRANCH}
env:
BASE_BRANCH: ${{ github.base_ref }}
- name: Lint Change Log fragments
run: |
make lint-changelog
# Always run this step so that all linting errors can be seen at once.
if: always()
- name: Set up Go
uses: actions/setup-go@v3
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ jobs:
run: |
make release-build
env:
# Instruct Make to create a real release.
NEXUS_REAL_RELEASE: "true"
# Pass automatically created GitHub App installation token to the action.
# For more info, see:
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Prepare the tagged Docker image.
Expand Down
29 changes: 0 additions & 29 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,9 @@ checksum:
snapshot:
name_template: "{{ incpatch .Version }}-next"

changelog:
sort: asc
use: github
filters:
exclude:
- Merge pull request
- Merge remote-tracking branch
- Merge branch
groups:
- title: Breaking changes
regexp: "^.*breaks[(\\w)]*:+.*$"
order: 0
- title: New Features
regexp: "^.*feat[(\\w)]*:+.*$"
order: 5
- title: Bug fixes
regexp: "^.*fix[(\\w)]*:+.*$"
order: 10
- title: Dependencies updates
regexp: "^.*deps[(\\w)]*:+.*$"
order: 500
- title: Other changes
order: 999

release:
name_template: "{{.ProjectName}} {{.Version}}"

# If set to auto, will mark the release as not ready for production
# in case there is an indicator for this in the tag e.g. v1.0.0-rc1.
prerelease: auto

footer: |
**Full Changelog**: https://github.com/oasisprotocol/nexus/compare/{{ .PreviousTag }}...{{ .Tag }}
### Running Nexus in Docker
https://github.com/oasisprotocol/nexus/blob/{{ .Tag }}/README.md#docker-development
20 changes: 20 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json

# markdownlint configuration.

# For more information, see:
# https://github.com/DavidAnson/markdownlint#optionsconfig.

# Enable all rules.
default: true

line-length:
# Line length checking is not strict by default.
strict: true
line_length: 80
# Allow longer lines for code blocks.
code_block_line_length: 100

# Do not always require language specifiers with fenced code blocks since they
# are not part of the Markdown spec.
fenced-code-language: false
Loading

0 comments on commit 63c86a7

Please sign in to comment.