You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MAINTAINING.md
+96-99Lines changed: 96 additions & 99 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,13 +25,13 @@ Merge pull-request #PULLREQUEST-ID from cboehme/fix-xy
25
25
# Releasing
26
26
27
27
We shall make releases quarterly. Approximate timetable is every Januar, April, July, October.
28
-
We may publish `master-SNAPSHOT` builds more frequently.
29
28
30
29
Releasing involves to first make and test the release candidate before actually making the release. Note that we provide a *GitHub release for manual download* as well as a *release on Maven central* to be consumed as a library.
31
30
32
-
It's good habit to use semantic versioning in release numbers `A`.`B`.`C`, i.e. increase `A` when it's a major release breaking backward compatibility; increase `B` when it got new features; increase `C` indicating bug-fixes. A suffix like `rcN` (where `N` is a number) indicates a release candidate (`rc`).
31
+
It's good habit to use semantic versioning in release numbers `A`.`B`.`C`, i.e. increase `A` when it's a major release breaking backward compatibility; increase `B` when it got new features; increase `C` indicating bug-fixes.
33
32
34
-
To upload to Sonatype you need (as well for the release candidate as for the release) a `gradle.properties` in the root directory that looks like this:
33
+
## Signing
34
+
To upload to Sonatype we need to sign the artifacts. Adjust `gradle.properties` in the root directory that like this:
These are done more often, in irregular intervals. They are not considered stable and may break your application, so be cautious when using them.
49
+
To be able to authorize at central.sonatype you first have to "Generate User
50
+
Token" at https://central.sonatype.com/usertoken (must be logged in). Copy/add the
51
+
snippet you will be provided when creating the token to `~/.m2/settings.xml`.
56
52
57
-
The process is identical to making a release candidate, but without making any tags:
53
+
!This is also needed when testing the uploaded deployment bundle (see below).!
58
54
59
-
1. Switch to the `master` branch:
60
-
```
61
-
git switch master
62
-
```
63
-
1. Proceed as described in [Release candidate - Upload to Sonatype](#upload-to-sonatype), but omit the `publishVersion` parameter in order to build and upload the `master-SNAPSHOT`.
I.e. you first upload a release and before publishing it you test it.
72
+
73
+
### Upload
74
+
75
+
a) It's going from your local Git repository to central.sonatype.com to Maven Central. Each station requires some manual actions so you can double check that everything is ok. b) A release should also be published to GitHub.
76
+
77
+
1. Make an annotated signed tag for the release:
76
78
```
77
-
Release candidate 5.7.0
79
+
git tag -s metafacture-core-A.B.C
78
80
```
79
-
1. Optionally, you can now test the build locally by invoking a Gradle target:
81
+
1. When prompted, add a sensible tag message. For instance, something like:
80
82
```
81
-
./gradlew assemble -PpublishVersion=A.B.C-rcN
83
+
Release A.B.C
82
84
```
83
-
84
-
### Upload to Sonatype
85
-
86
85
1. Make sure to have a *clean* Git directory (otherwise the build will fail with the error message `Working copy has modifications`):
87
86
```
88
87
git status
89
88
```
90
-
1. Now you can build and upload the release candidate to Sonatype (note that `./gradlew` should inform you to make a "snapshot build". If the version doesn't end with `-SNAPSHOT` the artifacts will not be uploaded to Sonatype's snapshot repository!):
1. Go to [Sonatype's snapshot repository](https://oss.sonatype.org/index.html#nexus-search;gav~org.metafacture) and type in the correct `Version` to see if it is already available there (can take some minutes). [Example for `5.5.1-rc1-SNAPSHOT`](https://oss.sonatype.org/index.html#nexus-search;gav~org.metafacture~~5.5.1*~~)(if you don't see a `5.5.1-rc1-SNAPSHOT.jar` there check it at https://oss.sonatype.org/content/repositories/snapshots/org/metafacture/metafacture-biblio/5.5.1-rc1-SNAPSHOT/).
95
-
96
-
### Publish to [GitHub Packages](https://github.com/orgs/metafacture/packages?repo_name=metafacture-core)
97
-
98
-
1. Push the annotated signed tag to GitHub:
89
+
1. Now you can build and upload the release to Sonatype:
The publishing to GitHub packages is triggered then via the GitHub Actions workflow.
93
+
### Test
103
94
104
-
Note that `Packages` is not the same as [`Releases`](https://github.com/metafacture/metafacture-core/releases).
95
+
_As a fallback and for build systems where the below does not work:
96
+
git checkout the release tag resp. the branch, build locally and consume locally. You don't need
97
+
to have a login then, no special configs etc._
105
98
106
-
### Consume the SNAPSHOT
99
+
If you decide to test what is actually in the pipeline you need some
100
+
prerequisites;
101
+
You need to have a login at central.sonatype.com and be added as a
102
+
maintainer of the namespace `org.metafacture`.
103
+
Follow the section "Authorize at central sonatype" to be able to test the
104
+
deployment bundle.
107
105
108
-
1. See e.g. [5.5.1-rc1-SNAPSHOT](https://oss.sonatype.org/index.html#nexus-search;gav~org.metafacture~~5.5.1*~~) for how to configure the dependency.
109
-
1. Configure your build system to use Sonatype's Snapshot Repository to be able to load the dependencies of the release candidate (or `master-SNAPSHOT`).
110
-
For Maven update your `pom.xml` (after `</dependencies>`):
111
-
```xml
112
-
<repositories>
106
+
You have to add this into you `~/.m2/settings.xml`:
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
138
-
```
131
+
</repositories>
132
+
</profile>
133
+
</profiles>
134
+
```
135
+
where `basencodedUsernameAndPassword` is created like this:
136
+
```
137
+
printf "$usernameToken:$passwordToken" | base64
138
+
```
139
+
(note the semicolon `:`).
139
140
140
-
## Making a release
141
+
If you have a maven project you can now update the dependencies in the
142
+
`pom.xml` and download the like:
141
143
142
-
a) It's going from your local Git repository to Sonatype to Maven Central. Each station requires some manual actions so you can double check that everything is ok. b) A release should also be published to GitHub.
144
+
```
145
+
mvn -debug -Pcentral.manual.testing install
146
+
```
143
147
144
-
1. Ensure that the approved release candidate tag exactly matches `master` (should output `metafacture-core-A.B.C-rcN`):
1. When prompted, add a sensible commit message. For instance, something like:
153
-
```
154
-
Release 5.7.0
155
-
```
156
-
1. Push the annotated signed tag to GitHub:
148
+
### Publish
149
+
150
+
If the tests went well we can publish.
151
+
We publish the Metafacture libraries as modules to maven central and a
152
+
Metafactur standalone runner at GitHub releases.
153
+
154
+
#### Publish Metafacture Runner to Github Releases
155
+
156
+
This provides the standalone runner.
157
+
158
+
1. Push the annotated signed tag you have created in the "Upload" section to GitHub:
157
159
```
158
160
git push origin metafacture-core-A.B.C
159
161
```
160
-
1. Make sure to have a *clean* Git directory (otherwise the build will fail with the error message `Working copy has modifications`):
161
-
```
162
-
git status
163
-
```
164
162
1. Now the tag is available on GitHub. You can manually choose to [draft a new release on GitHub](https://github.com/metafacture/metafacture-core/releases/new). The signed `*-dist.*` files must be uploaded manually. They are produced like this:
1. Finally, go to [oss.sonatype.org](https://oss.sonatype.org), log in, check the [Staging Repositories](https://oss.sonatype.org/#stagingRepositories) and when it's finished, click on `Close`. If everything is good, publish with clicking on `Release` - attention, because once published it can't be removed. The artifacts are uploaded to Maven Central (which may take some time; have a look at e.g. [metafacture-biblio](https://repo1.maven.org/maven2/org/metafacture/metafacture-biblio/)). You can check that it's actually in the publishing pipeline by clicking on `Views/Repositories->Releases`, then type in the `Path lookup` field `org/metafacture/` and click on version.
167
+
168
+
#### Publish to Maven Central
169
+
170
+
1. Finally, go to [central.sonatype.com](https://central.sonatype.com/publishing), log in, check the namespace (if you maintain more than one repo). Attention, because once published it can't be removed. If sure, click on "Publish". The artifacts are uploaded to Maven Central (which may take some time; have a look at e.g. [metafacture-biblio](https://repo1.maven.org/maven2/org/metafacture/metafacture-biblio/)).i
0 commit comments