Skip to content

Commit d71a034

Browse files
authored
prepare release 1.4.1 (#64)
* prepare release 1.4.0 * fix pom dependencies issue * remove v prefix in tag * update version in constants * update readme and releasing * update version to 1.4.1 * fix artifact not found * fix release workflow job name * update version code * update RELEASING.md
1 parent 9ee4369 commit d71a034

File tree

7 files changed

+44
-28
lines changed

7 files changed

+44
-28
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Release
33
on:
44
push:
55
tags:
6-
- 'v*.*.*'
6+
- '*.*.*'
77

88
jobs:
9-
snapshot:
9+
release:
1010
runs-on: ubuntu-latest
1111
environment: deployment
1212
steps:
@@ -17,7 +17,7 @@ jobs:
1717
- name: Verify tag
1818
run: |
1919
VERSION=$(grep VERSION_NAME gradle.properties | awk -F= '{ print $2 }' | sed "s/-SNAPSHOT//")
20-
if [ "${{ steps.vars.outputs.tag }}" != "v$VERSION" ]; then {
20+
if [ "${{ steps.vars.outputs.tag }}" != "$VERSION" ]; then {
2121
echo "Tag ${{ steps.vars.outputs.tag }} does not match the package version ($VERSION)"
2222
exit 1
2323
} fi

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Analytics-Kotlin
2-
[![](https://jitpack.io/v/segmentio/analytics-kotlin.svg)](https://jitpack.io/#segmentio/analytics-kotlin)
2+
[![maven](https://img.shields.io/maven-central/v/com.segment.analytics.kotlin/android)](https://repo1.maven.org/maven2/com/segment/analytics/kotlin/)
33
[![](https://github.com/segmentio/analytics-kotlin/actions/workflows/build.yml/badge.svg)](https://github.com/segmentio/analytics-kotlin/actions)
44
[![codecov](https://codecov.io/gh/segmentio/analytics-kotlin/branch/main/graph/badge.svg?token=U5FDRBZOXO)](https://codecov.io/gh/segmentio/analytics-kotlin)
55
[![Known Vulnerabilities](https://snyk.io/test/github/segmentio/analytics-kotlin/badge.svg)](https://snyk.io/test/github/segmentio/analytics-kotlin)

RELEASING.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1+
Update Version
2+
=========
3+
1. Update VERSION_CODE in `gradle.properties`
4+
2. Update VERSION_NAME in `gradle.properties`
5+
3. Update LIBRARY_VERSION in `core/Constants.kt`
6+
17
Releasing
28
=========
39

410
1. Create a new branch called `release/X.Y.Z`
511
2. `git checkout -b release/X.Y.Z`
6-
3. Change the version in `gradle.properties` to your desired release version
7-
4. `git commit -am "Create release X.Y.Z."` (where X.Y.Z is the new version)
12+
3. Change the version to your desired release version (see `Update Version`)
13+
4. `git commit -am "Prepare release X.Y.Z."` (where X.Y.Z is the new version)
814
5. `git tag -a X.Y.Z -m "Version X.Y.Z"` (where X.Y.Z is the new version)
9-
6. Upgrade to next version by changing version in `gradle.properties`
10-
7. `git commit -am "Prepare snapshot X.Y.Z-SNAPSHOT"`
11-
8. `git push && git push --tags`
12-
9. Create a PR to merge the new branch into `main`
13-
10. The CI pipeline will recognize the tag and upload, close and promote the artifacts, and generate changelog automatically
15+
6. `git push && git push --tags`
16+
7. The CI pipeline will recognize the tag and upload, close and promote the artifacts, and generate changelog automatically
17+
8. Create a PR to merge the new branch into `main`
18+
9. The CI pipeline will trigger a snapshot workflow and upload the artifact.
1419

1520
Example (stable release)
1621
========
17-
1. Current VERSION_NAME in `gradle.properties` = 1.3.0
22+
1. Current version is 1.3.0
1823
2. `git checkout -b release/1.3.1`
19-
3. Change VERSION_NAME = 1.3.1 (next higher version)
20-
4. `git commit -am "Create release 1.3.1"`
24+
3. Change version to 1.3.1 (next higher version, see `Update Version`)
25+
4. `git commit -am "Prepare release 1.3.1"`
2126
5. `git tag -a 1.3.1 -m "Version 1.3.1"`
22-
6. `git push && git push --tags`
23-
7. Change VERSION_NAME = 1.3.2 (next higher version)
24-
8. `git commit -am "Prepare snapshot 1.3.2-SNAPSHOT"`
25-
9. `git push && git push --tags`
26-
10. Merging PR main will create a snapshot release 1.3.2-SNAPSHOT and tag push will create stable release 1.3.1 with auto-generated changelog
27+
6. `git push && git push --tags`. This tag push will create stable release 1.3.1 with auto-generated changelog
28+
8. Create a PR to merge the new branch into `main`. Merging PR main will create a snapshot release 1.3.1-SNAPSHOT

build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ allprojects {
3131
maven { url "https://kotlin.bintray.com/kotlinx" }
3232
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
3333
}
34+
35+
group GROUP
36+
version VERSION_NAME
3437
}
3538

3639
snyk {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.segment.analytics.kotlin.core
22

33
object Constants {
4-
const val LIBRARY_VERSION = "1.3.0"
4+
const val LIBRARY_VERSION = "1.4.1"
55
const val DEFAULT_API_HOST = "api.segment.io/v1"
66
const val DEFAULT_CDN_HOST = "cdn-settings.segment.com/v1"
77
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ kotlin.code.style=official
2323
# Deployment variables
2424
GROUP=com.segment.analytics.kotlin
2525

26-
VERSION_CODE=130
27-
VERSION_NAME=1.3.0
26+
VERSION_CODE=141
27+
VERSION_NAME=1.4.1
2828

2929
POM_NAME=Segment for Kotlin
3030
POM_DESCRIPTION=The hassle-free way to add analytics to your Kotlin app.

gradle/mvn-publish.gradle

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ publishing {
1414
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
1515
}
1616
else {
17-
artifact("$buildDir/libs/${project.getName()}.jar")
17+
artifact("$buildDir/libs/${project.getName()}-${VERSION_NAME}.jar")
1818
}
1919
artifact sourcesJar
2020
artifact javadocJar
@@ -50,13 +50,24 @@ publishing {
5050
// that the library builds upon
5151
withXml {
5252
def dependenciesNode = asNode().appendNode('dependencies')
53+
ext.addDependency = { Dependency dep, String scope ->
54+
if (dep.group == null || dep.version == null || dep.name == null || dep.name == "unspecified")
55+
return // invalid dependencies should be ignored
5356

54-
project.configurations.implementation.allDependencies.each {
55-
def dependencyNode = dependenciesNode.appendNode('dependency')
56-
dependencyNode.appendNode('groupId', it.group)
57-
dependencyNode.appendNode('artifactId', it.name)
58-
dependencyNode.appendNode('version', it.version)
57+
final dependencyNode = dependenciesNode.appendNode('dependency')
58+
dependencyNode.appendNode('artifactId', dep.name)
59+
if (dep.version == 'unspecified') {
60+
dependencyNode.appendNode('groupId', project.ext.pomGroupID)
61+
dependencyNode.appendNode('version', project.ext.pomVersion)
62+
} else {
63+
dependencyNode.appendNode('groupId', dep.group)
64+
dependencyNode.appendNode('version', dep.version)
65+
}
66+
dependencyNode.appendNode('scope', scope)
5967
}
68+
69+
configurations.api.getDependencies().each { dep -> addDependency(dep, "compile") }
70+
configurations.implementation.getDependencies().each { dep -> addDependency(dep, "runtime") }
6071
}
6172
}
6273
}

0 commit comments

Comments
 (0)