Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update releasing instructions and add changelog #6

Merged
merged 1 commit into from
Aug 29, 2024
Merged
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
12 changes: 12 additions & 0 deletions .github_changelog_generator
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
output=CHANGELOG.md
user=sdb9696
project=firebase-messaging
release-branch=main
base=HISTORY.md
since-tag=0.2.1
usernames-as-github-logins=true
add-sections={"docs":{"prefix":"**Documentation updates:**","labels":["documentation"]},"maintenance":{"prefix":"**Project maintenance:**","labels":["maintenance"]}}
exclude-labels=duplicate,question,invalid,wontfix,release-prep,stale,bug
issues-wo-labels=false
bug-labels=bugfix
breaking-label=**Breaking change pull requests:**
83 changes: 83 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Changelog

## [0.3.0](https://github.com/sdb9696/firebase-messaging/tree/0.3.0) (2024-03-26)

[Full Changelog](https://github.com/sdb9696/firebase-messaging/compare/0.2.1...0.3.0)

**Merged pull requests:**

- Make checkin async [\#2](https://github.com/sdb9696/firebase-messaging/pull/2) (@sdb9696)

## [0.2.1](https://github.com/sdb9696/firebase-messaging/releases/tag/0.2.1) - 2024-03-19

<small>[Compare with 0.2.0](https://github.com/sdb9696/firebase-messaging/compare/0.2.0...0.2.1)</small>

### Added

- Add typing ([ae3bc88](https://github.com/sdb9696/firebase-messaging/commit/ae3bc8821c1ca16fc6da00af0f0655851f6f848f) by sdb9696).
- Add ruff pre-commit hook ([bd98a4e](https://github.com/sdb9696/firebase-messaging/commit/bd98a4eea43ab0d63112f15f2ea3e2aa6c12f7c7) by sdb9696).
- Publisher verbose ([98cd5c4](https://github.com/sdb9696/firebase-messaging/commit/98cd5c4a40b12a42fc234d61076560a21bf46666) by sdb9696).

### Fixed

- Fix publisher ([6347dc2](https://github.com/sdb9696/firebase-messaging/commit/6347dc262df7f409099807df18db3e4550316106) by sdb9696).
- Fix cryptography warning in key generation ([5d4685b](https://github.com/sdb9696/firebase-messaging/commit/5d4685b9be3b66c3bff38ae6b4049094ba116ffb) by sdb9696).
- Fix broken proto file ([1bf3625](https://github.com/sdb9696/firebase-messaging/commit/1bf36259cd508bf6a58dc9f16138294aef235068) by sdb9696).

### Merged

- Merge pull request #1 from sdb9696/add_typing ([919eb97](https://github.com/sdb9696/firebase-messaging/commit/919eb97750dc3481130056ed6a4b9f4773b8da15) by Steven B).

## [0.2.0](https://github.com/sdb9696/firebase-messaging/releases/tag/0.2.0) - 2023-10-31

<small>[Compare with 0.1.4](https://github.com/sdb9696/firebase-messaging/compare/0.1.4...0.2.0)</small>

- Bump to 0.2.0, rename entry points and add run state for stability ([e3cbfda](https://github.com/sdb9696/firebase-messaging/commit/e3cbfda2f753e11029c437ec66720d836ccc0595) by sdb9696).

### Removed

- Remove need to be created in an event loop ([87daa6b](https://github.com/sdb9696/firebase-messaging/commit/87daa6b0078ef17131c3e64519b3042c559e3630) by sdb9696).

## [0.1.4](https://github.com/sdb9696/firebase-messaging/releases/tag/0.1.4) - 2023-10-25

<small>[Compare with 0.1.3](https://github.com/sdb9696/firebase-messaging/compare/0.1.3...0.1.4)</small>

- Relax protobuf dependency for HA ([9ac0bc6](https://github.com/sdb9696/firebase-messaging/commit/9ac0bc6d8212ea9a4fb4aa6cc412e7e760414dae) by sdb9696).

## [0.1.3](https://github.com/sdb9696/firebase-messaging/releases/tag/0.1.3) - 2023-10-25

<small>[Compare with 0.1.2](https://github.com/sdb9696/firebase-messaging/compare/0.1.2...0.1.3)</small>

- Bugfix python 3.9 async lock ([c2ee681](https://github.com/sdb9696/firebase-messaging/commit/c2ee68123ee4b8d5d62060b80ed746b2ec639b29) by sdb9696).

## [0.1.2](https://github.com/sdb9696/firebase-messaging/releases/tag/0.1.2) - 2023-10-25

<small>[Compare with 0.1.1](https://github.com/sdb9696/firebase-messaging/compare/0.1.1...0.1.2)</small>

### Fixed

- Update handling of no event loop and bump version ([29f3841](https://github.com/sdb9696/firebase-messaging/commit/29f38414eba0ed5893578c382eae558a826475de) by sdb9696).

## [0.1.1](https://github.com/sdb9696/firebase-messaging/releases/tag/0.1.1) - 2023-10-23

<small>[Compare with 0.1.0](https://github.com/sdb9696/firebase-messaging/compare/0.1.0...0.1.1)</small>

### Fixed

- Fix gcm checkin with credentials ([4c51098](https://github.com/sdb9696/firebase-messaging/commit/4c5109816b0d3fa266329bb36ec6fdfb02598ca3) by sdb9696).

## [0.1.0](https://github.com/sdb9696/firebase-messaging/releases/tag/0.1.0) - 2023-10-23

<small>[Compare with first commit](https://github.com/sdb9696/firebase-messaging/compare/acf9b784788d68026d64d2f6d39a23274dbd663e...0.1.0)</small>

### Added

- Add tests and docs and refactor ([77c225c](https://github.com/sdb9696/firebase-messaging/commit/77c225c142f1173ca2746c7a07de250b7d46e610) by sdb9696).

### Fixed

- Fix publish workflow ([447d379](https://github.com/sdb9696/firebase-messaging/commit/447d37922aa2589e79b3952036ef10b02debb01a) by sdb9696).



\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
3 changes: 0 additions & 3 deletions CHANGELOG.rst

This file was deleted.

69 changes: 69 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
## [0.2.1](https://github.com/sdb9696/firebase-messaging/releases/tag/0.2.1) - 2024-03-19

<small>[Compare with 0.2.0](https://github.com/sdb9696/firebase-messaging/compare/0.2.0...0.2.1)</small>

### Added

- Add typing ([ae3bc88](https://github.com/sdb9696/firebase-messaging/commit/ae3bc8821c1ca16fc6da00af0f0655851f6f848f) by sdb9696).
- Add ruff pre-commit hook ([bd98a4e](https://github.com/sdb9696/firebase-messaging/commit/bd98a4eea43ab0d63112f15f2ea3e2aa6c12f7c7) by sdb9696).
- Publisher verbose ([98cd5c4](https://github.com/sdb9696/firebase-messaging/commit/98cd5c4a40b12a42fc234d61076560a21bf46666) by sdb9696).

### Fixed

- Fix publisher ([6347dc2](https://github.com/sdb9696/firebase-messaging/commit/6347dc262df7f409099807df18db3e4550316106) by sdb9696).
- Fix cryptography warning in key generation ([5d4685b](https://github.com/sdb9696/firebase-messaging/commit/5d4685b9be3b66c3bff38ae6b4049094ba116ffb) by sdb9696).
- Fix broken proto file ([1bf3625](https://github.com/sdb9696/firebase-messaging/commit/1bf36259cd508bf6a58dc9f16138294aef235068) by sdb9696).

### Merged

- Merge pull request #1 from sdb9696/add_typing ([919eb97](https://github.com/sdb9696/firebase-messaging/commit/919eb97750dc3481130056ed6a4b9f4773b8da15) by Steven B).

## [0.2.0](https://github.com/sdb9696/firebase-messaging/releases/tag/0.2.0) - 2023-10-31

<small>[Compare with 0.1.4](https://github.com/sdb9696/firebase-messaging/compare/0.1.4...0.2.0)</small>

- Bump to 0.2.0, rename entry points and add run state for stability ([e3cbfda](https://github.com/sdb9696/firebase-messaging/commit/e3cbfda2f753e11029c437ec66720d836ccc0595) by sdb9696).

### Removed

- Remove need to be created in an event loop ([87daa6b](https://github.com/sdb9696/firebase-messaging/commit/87daa6b0078ef17131c3e64519b3042c559e3630) by sdb9696).

## [0.1.4](https://github.com/sdb9696/firebase-messaging/releases/tag/0.1.4) - 2023-10-25

<small>[Compare with 0.1.3](https://github.com/sdb9696/firebase-messaging/compare/0.1.3...0.1.4)</small>

- Relax protobuf dependency for HA ([9ac0bc6](https://github.com/sdb9696/firebase-messaging/commit/9ac0bc6d8212ea9a4fb4aa6cc412e7e760414dae) by sdb9696).

## [0.1.3](https://github.com/sdb9696/firebase-messaging/releases/tag/0.1.3) - 2023-10-25

<small>[Compare with 0.1.2](https://github.com/sdb9696/firebase-messaging/compare/0.1.2...0.1.3)</small>

- Bugfix python 3.9 async lock ([c2ee681](https://github.com/sdb9696/firebase-messaging/commit/c2ee68123ee4b8d5d62060b80ed746b2ec639b29) by sdb9696).

## [0.1.2](https://github.com/sdb9696/firebase-messaging/releases/tag/0.1.2) - 2023-10-25

<small>[Compare with 0.1.1](https://github.com/sdb9696/firebase-messaging/compare/0.1.1...0.1.2)</small>

### Fixed

- Update handling of no event loop and bump version ([29f3841](https://github.com/sdb9696/firebase-messaging/commit/29f38414eba0ed5893578c382eae558a826475de) by sdb9696).

## [0.1.1](https://github.com/sdb9696/firebase-messaging/releases/tag/0.1.1) - 2023-10-23

<small>[Compare with 0.1.0](https://github.com/sdb9696/firebase-messaging/compare/0.1.0...0.1.1)</small>

### Fixed

- Fix gcm checkin with credentials ([4c51098](https://github.com/sdb9696/firebase-messaging/commit/4c5109816b0d3fa266329bb36ec6fdfb02598ca3) by sdb9696).

## [0.1.0](https://github.com/sdb9696/firebase-messaging/releases/tag/0.1.0) - 2023-10-23

<small>[Compare with first commit](https://github.com/sdb9696/firebase-messaging/compare/acf9b784788d68026d64d2f6d39a23274dbd663e...0.1.0)</small>

### Added

- Add tests and docs and refactor ([77c225c](https://github.com/sdb9696/firebase-messaging/commit/77c225c142f1173ca2746c7a07de250b7d46e610) by sdb9696).

### Fixed

- Fix publish workflow ([447d379](https://github.com/sdb9696/firebase-messaging/commit/447d37922aa2589e79b3952036ef10b02debb01a) by sdb9696).
168 changes: 168 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# Releasing

## Requirements
* [github client](https://github.com/cli/cli#installation)
* [gitchub_changelog_generator](https://github.com/github-changelog-generator)
* [github access token](https://github.com/github-changelog-generator/github-changelog-generator#github-token)

## Export changelog token

```bash
export CHANGELOG_GITHUB_TOKEN=token
```

## Set release information

```bash
export NEW_RELEASE=x.x.x
```

## Normal releases from main

### Create a branch for the release

```bash
git checkout main
git fetch upstream main
git rebase upstream/main
git checkout -b release/$NEW_RELEASE
```

### Update the version number

```bash
poetry version $NEW_RELEASE
```

### Update dependencies

```bash
poetry install --all-extras --sync
poetry update
```

### Run pre-commit and tests

```bash
pre-commit run --all-files
pytest
```

### Create release summary (skip for dev releases)

Write a short and understandable summary for the release. Can include images.

#### Create $NEW_RELEASE milestone in github

If not already created

#### Create new issue linked to the milestone

```bash
gh issue create --label "release-summary" --milestone $NEW_RELEASE --title "$NEW_RELEASE Release Summary" --body "**Release highlights:**"
```

You can exclude the --body option to get an interactive editor or go into the issue on github and edit there.

#### Close the issue

Either via github or:

```bash
gh issue close ISSUE_NUMBER
```

### Generate changelog

Configuration settings are in `.github_changelog_generator`

#### For pre-release

EXCLUDE_TAGS will exclude all dev tags except for the current release dev tags.

Regex should be something like this `^((?!0\.9\.0)(.*dev\d))+`. The first match group negative matches on the current release and the second matches on releases ending with dev.

```bash
EXCLUDE_TAGS=${NEW_RELEASE%.dev*}; EXCLUDE_TAGS=${EXCLUDE_TAGS//"."/"\."}; EXCLUDE_TAGS="^((?!"$EXCLUDE_TAGS")(.*dev\d))+"
echo "$EXCLUDE_TAGS"
github_changelog_generator --future-release $NEW_RELEASE --exclude-tags-regex "$EXCLUDE_TAGS"
```

#### For production

```bash
github_changelog_generator --future-release $NEW_RELEASE --exclude-tags-regex 'dev\d$'
```

You can ignore warnings about missing PR commits like below as these relate to PRs to branches other than main:
```
Warning: PR 111 merge commit was not found in the release branch or tagged git history and no rebased SHA comment was found
```


### Export new release notes to variable

```bash
export RELEASE_NOTES=$(grep -Poz '(?<=\# Changelog\n\n)(.|\n)+?(?=\#\#)' CHANGELOG.md | tr '\0' '\n' )
echo "$RELEASE_NOTES" # Check the output and copy paste if neccessary
```

### Commit and push the changed files

```bash
git commit --all --verbose -m "Prepare $NEW_RELEASE"
git push upstream release/$NEW_RELEASE -u
```

### Create a PR for the release, merge it, and re-fetch the main

#### Create the PR
```
gh pr create --title "Prepare $NEW_RELEASE" --body "$RELEASE_NOTES" --label release-prep --base main
```

#### Merge the PR once the CI passes

Create a squash commit and add the markdown from the PR description to the commit description.

```bash
gh pr merge --squash --body "$RELEASE_NOTES"
```

### Rebase local main

```bash
git checkout main
git fetch upstream main
git rebase upstream/main
```

### Create a release tag

Note, add changelog release notes as the tag commit message so `gh release create --notes-from-tag` can be used to create a release draft.

```bash
git tag --annotate $NEW_RELEASE -m "$RELEASE_NOTES" # to create a signed tag replace --annotate with --sign
git push upstream $NEW_RELEASE
```

### Create release

N.B. the `--notes-from-tag` option requires gh cli version >= 2.35.0

#### Pre-releases

```bash
gh release create "$NEW_RELEASE" --verify-tag --notes-from-tag --title "$NEW_RELEASE" --draft --latest=false --prerelease

```

#### Production release

```bash
gh release create "$NEW_RELEASE" --verify-tag --notes-from-tag --title "$NEW_RELEASE" --draft --latest=true
```

### Manually publish the release

Go to the linked URL, verify the contents, and click "release" button to trigger the release CI.
1 change: 1 addition & 0 deletions docs/source/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:::{include} ../../CHANGELOG.md
1 change: 0 additions & 1 deletion docs/source/changelog.rst

This file was deleted.

5 changes: 5 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
"sphinx.ext.todo",
"myst_parser",
]

myst_enable_extensions = [
"colon_fence",
]

templates_path = ["_templates"]
Expand Down
Loading