This repository was archived by the owner on Mar 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: morimoto-cybozu <[email protected]>
- Loading branch information
1 parent
7c81e8b
commit d39df3e
Showing
2 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: release | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
jobs: | ||
release: | ||
name: Release on GitHub | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Create release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
version=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g") | ||
if echo $version | grep -q -e '-'; then prerelease=-p; fi | ||
gh release create $version $prerelease \ | ||
-t "Release $version" \ | ||
-n "See [CHANGELOG.md](./CHANGELOG.md) for details." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
Release procedure | ||
================= | ||
|
||
This document describes how to release a new version of log. | ||
|
||
Versioning | ||
---------- | ||
|
||
Follow [semantic versioning 2.0.0][semver] to choose the new version number. | ||
|
||
Prepare change log entries | ||
-------------------------- | ||
|
||
Add notable changes since the last release to [CHANGELOG.md](CHANGELOG.md). | ||
It should look like: | ||
|
||
```markdown | ||
(snip) | ||
## [Unreleased] | ||
|
||
### Added | ||
- Implement ... (#35) | ||
|
||
### Changed | ||
- Fix a bug in ... (#33) | ||
|
||
### Removed | ||
- Deprecated `-option` is removed ... (#39) | ||
|
||
(snip) | ||
``` | ||
|
||
Bump version | ||
------------ | ||
|
||
1. Determine a new version number. Then set `VERSION` variable. | ||
|
||
```console | ||
# Set VERSION and confirm it. It should not have "v" prefix. | ||
$ VERSION=x.y.z | ||
$ echo $VERSION | ||
``` | ||
|
||
2. Make a branch to release | ||
|
||
```console | ||
$ git neco dev "bump-$VERSION" | ||
``` | ||
|
||
3. Edit `CHANGELOG.md` for the new version ([example][]). | ||
4. Commit the change and push it. | ||
|
||
```console | ||
$ git commit -a -m "Bump version to $VERSION" | ||
$ git neco review | ||
``` | ||
|
||
5. Merge this branch. | ||
6. Add a git tag to the main HEAD, then push it. | ||
|
||
```console | ||
# Set VERSION again. | ||
$ VERSION=x.y.z | ||
$ echo $VERSION | ||
|
||
$ git checkout main | ||
$ git pull | ||
$ git tag -a -m "Release v$VERSION" "v$VERSION" | ||
|
||
# Make sure the release tag exists. | ||
$ git tag -ln | grep $VERSION | ||
|
||
$ git push origin "v$VERSION" | ||
``` | ||
|
||
GitHub actions will build and push artifacts such as container images and | ||
create a new GitHub release. | ||
|
||
[semver]: https://semver.org/spec/v2.0.0.html | ||
[example]: https://github.com/cybozu-go/etcdpasswd/commit/77d95384ac6c97e7f48281eaf23cb94f68867f79 |