Skip to content

Commit ca97809

Browse files
author
Dai MIKURUBE
committed
Fix publishing from GitHub Actions
1 parent 5b6a439 commit ca97809

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,45 @@ formatter:
115115
```
116116
$ ./gradlew gem
117117
```
118+
119+
For Maintainers
120+
----------------
121+
122+
### Release
123+
124+
Modify `version` in `build.gradle` at a detached commit, and then tag the commit with an annotation.
125+
126+
```
127+
git checkout --detach master
128+
129+
(Edit: Remove "-SNAPSHOT" in "version" in build.gradle.)
130+
131+
git add build.gradle
132+
133+
git commit -m "Release vX.Y.Z"
134+
135+
git tag -a vX.Y.Z
136+
137+
(Edit: Write a tag annotation in the changelog format.)
138+
```
139+
140+
See [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) for the changelog format. We adopt a part of it for Git's tag annotation like below.
141+
142+
```
143+
## [X.Y.Z] - YYYY-MM-DD
144+
145+
### Added
146+
- Added a feature.
147+
148+
### Changed
149+
- Changed something.
150+
151+
### Fixed
152+
- Fixed a bug.
153+
```
154+
155+
Push the annotated tag, then. It triggers a release operation on GitHub Actions after approval.
156+
157+
```
158+
git push -u origin vX.Y.Z
159+
```

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,10 @@ publishing {
238238
}
239239

240240
signing {
241+
if (project.hasProperty("signingKey") && project.hasProperty("signingPassword")) {
242+
logger.lifecycle("Signing with an in-memory key.")
243+
useInMemoryPgpKeys(signingKey, signingPassword)
244+
}
241245
sign publishing.publications.maven
242246
}
243247

0 commit comments

Comments
 (0)