Skip to content

Commit 763bd1f

Browse files
Mateusz Rzeszutekaurbiztondo-splunk
Mateusz Rzeszutek
andauthored
Add the release tagging script (#347)
* Add the release tagging script * Update RELEASING.md Co-authored-by: Anna U <[email protected]>
1 parent 11593bd commit 763bd1f

File tree

2 files changed

+53
-17
lines changed

2 files changed

+53
-17
lines changed

RELEASING.md

+19-17
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,30 @@
22

33
## Releasing a new version
44

5-
Releasing of splunk-otel-android is done via a private Splunk gitlab installation.
5+
splunk-otel-android is released via a private Splunk gitlab installation.
66

77
This is the process to use to do a release:
88

9-
1) Use the _Github_ UI to create a tag for the version (by creating a pre-release, for example),
10-
pointing at the commit SHA on the main branch that you want to release.
11-
The format of the tag should be "vx.y.z" or it won't be picked
12-
up by gitlab as a release tag. You can also create a tag via the command line and push it to github
13-
if you are more comfortable with that process.
9+
1) Make sure that all the required changes are merged. This includes updating the upstream OTel
10+
libraries' versions, and making sure that the project version in the `gradle.properties` file is
11+
correctly set to the next planned release version.
1412

15-
2) Wait for gitlab to run the release job.
13+
2) Run the `scripts/tag-release.sh` script to create and push a signed release tag. Note that it
14+
assumes that the remote is named `origin`, if you named yours differently you might have to push
15+
the tag manually.
1616

17-
3) Log in to oss.sonatype.org with a login that has permissions to see and release the `com.splunk`
18-
staging repository.
17+
3) Wait for gitlab to run the release job.
1918

20-
4) Close the staging repository, and then release it via the oss.sonatype.org UI.
21-
Ideally, verify that the publishing worked by pulling down the dependency in some sample project and
22-
build an application against it, as a double-check that it is a working release.
19+
4) Log in to `oss.sonatype.org` with a profile that has permissions to see and release the `com.splunk`
20+
staging repository.
2321

24-
5) Create a PR that will update the version in the `gradle.properties` to the next one that will be being worked on.
25-
This PR can and probably should also include updating any documentation (CHANGELOG.md, README.md, etc)
26-
that mentions the previous version.
22+
5) Close the staging repository, and then release it via the oss.sonatype.org UI.
23+
Ideally, verify that publishing worked by pulling down the dependency in some sample project
24+
and build an application against it. This will double-check that it's a working release.
2725

28-
6) Once this PR is merged, create a release in Github that points at the newly created version, make sure
29-
to provide release notes that at least mirror the contents of the CHANGELOG.md
26+
6) Create a PR to update the version in the `gradle.properties` to the next development
27+
version. This PR can and probably should also include updating any documentation (CHANGELOG.md,
28+
README.md, etc) that mentions the previous version.
29+
30+
7) Once this PR is merged, create a release in Github that points at the newly created version,
31+
and make sure to provide release notes that at least mirror the contents of the CHANGELOG.md

scripts/tag-release.sh

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6+
ROOT_DIR="${SCRIPT_DIR}/../"
7+
cd ${ROOT_DIR}
8+
9+
print_usage() {
10+
cat <<EOF
11+
Usage: $(basename $0) release_version
12+
13+
All versions MUST NOT begin with 'v'. Example: 1.2.3.
14+
EOF
15+
}
16+
17+
if [[ $# < 1 ]]
18+
then
19+
print_usage
20+
exit 1
21+
fi
22+
23+
release_version=$1
24+
release_tag="v$1"
25+
26+
if [[ ! $release_version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]
27+
then
28+
echo "Invalid release version: $release_version"
29+
echo "Release version must follow the pattern major.minor.patch, e.g. 1.2.3"
30+
exit 1
31+
fi
32+
33+
git tag -m "Release $release_version" -s "$release_tag"
34+
git push origin "$release_tag"

0 commit comments

Comments
 (0)