generated from cybozu-go/neco-template
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add release flow #14
Merged
Merged
Add release flow #14
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,30 @@ | ||
changelog: | ||
exclude: | ||
labels: | ||
- ignore-for-release | ||
- ci | ||
- documentation | ||
- refactoring | ||
- test | ||
categories: | ||
- title: Features | ||
labels: | ||
- enhancement | ||
- title: Bug Fixes | ||
labels: | ||
- bug | ||
- title: Deprecated | ||
labels: | ||
- deprecate | ||
- title: Removed | ||
labels: | ||
- remove | ||
- title: Security | ||
labels: | ||
- security | ||
- title: Dependencies | ||
labels: | ||
- dependencies | ||
- title: Others | ||
labels: | ||
- "*" |
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
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,49 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
jobs: | ||
image: | ||
name: Push Container Image | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: linux/amd64 | ||
- uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ inputs.github_token }} | ||
- name: Build necoperf-cli and necoperf-daemon image | ||
run: make docker-build | ||
- name: Push necoperf-cli and necoperf-daemon image | ||
run: | | ||
IMAGE_TAG=${GITHUB_REF#refs/tags/v} # Remove "v" prefix. | ||
docker tag necoperf-cli:dev ghcr.io/cybozu-go/necoperf-cli:$IMAGE_TAG | ||
docker push ghcr.io/cybozu-go/necoperf-cli:$IMAGE_TAG | ||
docker tag necoperf-daemon:dev ghcr.io/cybozu-go/necoperf-daemon:$IMAGE_TAG | ||
docker push ghcr.io/cybozu-go/necoperf-daemon:$IMAGE_TAG | ||
release: | ||
name: Release on GitHub | ||
needs: image | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: 'go.mod' | ||
- name: GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,53 @@ | ||
builds: | ||
- id: necoperf-cli | ||
main: ./cmd/necoperf-cli | ||
binary: necoperf-cli | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
- id: necoperf-daemon | ||
main: ./cmd/necoperf-daemon | ||
binary: necoperf-daemon | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
|
||
archives: | ||
- id: necoperf-cli | ||
builds: [necoperf-cli] | ||
name_template: "necoperf-cli_{{ .Tag }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" | ||
wrap_in_directory: false | ||
format: tar.gz | ||
files: | ||
- LICENSE | ||
|
||
- id: necoperf-daemon | ||
builds: [necoperf-daemon] | ||
name_template: "necoperf-daemon_{{ .Tag }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" | ||
wrap_in_directory: false | ||
format: tar.gz | ||
files: | ||
- LICENSE | ||
|
||
checksum: | ||
name_template: "checksums.txt" | ||
|
||
changelog: | ||
use: github-native | ||
|
||
release: | ||
github: | ||
owner: zeroalphat | ||
name: necoperf-cli | ||
prerelease: auto | ||
name_template: "Release {{ .Tag }}" |
This file was deleted.
Oops, something went wrong.
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 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -3,30 +3,15 @@ Release procedure | |||||||||||
|
||||||||||||
This document describes how to release a new version. | ||||||||||||
|
||||||||||||
## 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] | ||||||||||||
## Labeling | ||||||||||||
|
||||||||||||
### Added | ||||||||||||
- Implement ... (#35) | ||||||||||||
Release notes are automatically generated based on PRs included in the release. | ||||||||||||
Those PRs are categorized based on the label assigned to them. | ||||||||||||
Please refer to `.github/release.yml` for the kind of labels. | ||||||||||||
|
||||||||||||
### Changed | ||||||||||||
- Fix a bug in ... (#33) | ||||||||||||
|
||||||||||||
### Removed | ||||||||||||
- Deprecated `-option` is removed ... (#39) | ||||||||||||
## Versioning | ||||||||||||
|
||||||||||||
(snip) | ||||||||||||
``` | ||||||||||||
Follow [semantic versioning 2.0.0][semver] to choose the new version number. | ||||||||||||
|
||||||||||||
## Bump version | ||||||||||||
|
||||||||||||
|
@@ -38,40 +23,13 @@ It should look like: | |||||||||||
$ echo $VERSION | ||||||||||||
``` | ||||||||||||
|
||||||||||||
2. Make a branch to release | ||||||||||||
2. Add a git tag to the main HEAD, then push it. | ||||||||||||
|
||||||||||||
```console | ||||||||||||
$ git neco dev "bump-$VERSION" | ||||||||||||
git checkout main | ||||||||||||
git tag -a -m "Release v$VERSION" "v$VERSION" | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be good to ensure the freshness of the local HEAD.
Suggested change
|
||||||||||||
git tag -ln | grep $VERSION | ||||||||||||
git push origin v$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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used for test in your repository?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I was left with the settings I used for testing.