Skip to content

Commit

Permalink
feat: add GitHub release config (#423)
Browse files Browse the repository at this point in the history
* feat: add GitHub release config

Signed-off-by: Henry Schreiner <[email protected]>

* chore: use cog

Signed-off-by: Henry Schreiner <[email protected]>

---------

Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii authored May 11, 2024
1 parent dcd523c commit 17c357f
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
changelog:
exclude:
authors:
- dependabot
- pre-commit-ci
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@ repos:
name: Cog the pages
language: python
entry: cog -P -r -I ./helpers
files: "^docs/pages/guides/(packaging_compiled|docs|tasks).md|^copier.yml"
files: "^docs/pages/guides/(packaging_compiled|docs|tasks|gha_basic).md|^copier.yml"
additional_dependencies: [cogapp, cookiecutter]
32 changes: 32 additions & 0 deletions docs/pages/guides/gha_basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ which consist of actions. Here are some of the workflows you will probably want
in your package. These should be in a file named `.github/workflows/main.yml` or
similar.

<!-- [[[cog
from cog_helpers import code_fence, render_cookie
with render_cookie() as package:
github_release_yaml = package.joinpath(".github/release.yml").read_text(encoding="utf-8").strip()
]]] -->
<!-- [[[end]]] -->

## Header

Your main CI workflow file should begin something like this:
Expand Down Expand Up @@ -710,3 +717,28 @@ everything in one job, you only need one of these.
>
> - [CLIUtils.github.io/CLI11](https://github.com/CLIUtils/CLI11/blob/main/.github/workflows/docs.yml)
> - [iris-hep.org](https://github.com/iris-hep/iris-hep.github.io/blob/master/.github/workflows/deploy.yml)

### Changelog generation

Not directly part of Actions, but also in `.github` is `.github/release.yml`,
which lets you [configure the changelog generation][gh-changelog] button when
you make a release. The following config will remove dependabot and
pre-commit-ci PRs for you:

<!-- [[[cog
with code_fence("yaml"):
print(github_release_yaml)
]]] -->
<!-- prettier-ignore-start -->
```yaml
changelog:
exclude:
authors:
- dependabot
- pre-commit-ci
```
<!-- prettier-ignore-end -->
<!-- [[[end]]] -->

[gh-changelog]:
https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
5 changes: 5 additions & 0 deletions {{cookiecutter.project_name}}/.github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
changelog:
exclude:
authors:
- dependabot
- pre-commit-ci

0 comments on commit 17c357f

Please sign in to comment.