Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit b9a2fce

Browse files
authored
Merge pull request #17 from CallFire/develop
CI-24571 - added script for automatic release uploading to github
2 parents fc61e35 + a598ab4 commit b9a2fce

File tree

4 files changed

+54
-3
lines changed

4 files changed

+54
-3
lines changed

Changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
EzTexting API client Changelog
22
=============================
3+
Version 1.1.1 - July 05 2018
4+
- added script for automatic release uploading to github
5+
36
Version 1.1.0 - May 23 2018
47
- added file upload to create media file API
58

EzTextingApiClient.nuspec

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?><package>
22
<metadata>
33
<id>EzTextingApiClient</id>
4-
<version>1.0.1</version>
4+
<version>1.1.1</version>
55
<title>EzTexting REST API client</title>
66
<authors>
77
Vladimir Mikhailov
@@ -14,8 +14,13 @@
1414
<description>C# client library for integration with EzTexting REST API services</description>
1515
<releaseNotes>EzTexting API client Changelog
1616
=============================
17+
Version 1.1.1 - July 05 2018
18+
- added script for automatic release uploading to github
19+
20+
Version 1.1.0 - May 23 2018
21+
- added file upload to create media file API
1722

18-
Version 1.0.1 - Apr 16 2016
23+
Version 1.0.1 - May 30 2016
1924
- package fixes
2025

2126
Version 1.0.0 - Apr 15 2016

build.gradle

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ plugins {
77
id 'com.ullink.nunit' version '1.4'
88
id 'com.ullink.opencover' version '1.2'
99
id 'net.researchgate.release' version '2.3.4'
10+
id "co.riiid.gradle" version '0.4.2'
1011
}
1112

1213
archivesBaseName = 'EzTextingApiClient'
@@ -97,4 +98,46 @@ nugetPush {
9798
serverUrl = 'https://www.nuget.org/api/v2/package'
9899
apiKey = System.properties[ 'NUGET_API_KEY' ] ?: "key not set"
99100
nupkgFile = nugetPack.packageFile
101+
}
102+
103+
task prepareReleaseData {
104+
doLast {
105+
try {
106+
println("${gitHubOwner}")
107+
println("${gitHubToken}")
108+
} catch(Exception ex) {
109+
println("GitHub Owner and/or Token are empty, you can't run github release task, set them with -PgitHubOwner/-PgitHubToken options")
110+
}
111+
}
112+
}
113+
prepareReleaseData.dependsOn nugetPack
114+
115+
task configureCustomGitHubRelease {
116+
doLast {
117+
github {
118+
owner = "${gitHubOwner}"
119+
repo = 'eztexting-api-client-csharp'
120+
token = "${gitHubToken}"
121+
tagName = project.version
122+
targetCommitish = 'master'
123+
name = project.version
124+
body = releaseDescription()
125+
assets = [
126+
'build/dist/EzTextingApiClient-' + project.version + '.zip',
127+
'build/dist/EzTextingApiClient.' + project.version + '.nupkg'
128+
]
129+
}
130+
}
131+
}
132+
configureCustomGitHubRelease.dependsOn prepareReleaseData
133+
githubRelease.dependsOn configureCustomGitHubRelease
134+
135+
def releaseDescription() {
136+
String releaseNotes = file("Changelog.txt").text
137+
String firstVersionEntry = releaseNotes.find(~/Version.*/)
138+
Integer start = releaseNotes.indexOf(firstVersionEntry) + firstVersionEntry.size()
139+
releaseNotes = releaseNotes.substring(start, releaseNotes.size())
140+
String secondVersionEntry = releaseNotes.find(~/Version.*/)
141+
String currentReleaseChanges = releaseNotes.substring(0, (secondVersionEntry == null ? releaseNotes.size() - 1 : releaseNotes.indexOf(secondVersionEntry))).trim()
142+
"$currentReleaseChanges"
100143
}

src/EzTextingApiClient/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
1414
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
1515

16-
[assembly: AssemblyVersion("1.1.0.*")]
16+
[assembly: AssemblyVersion("1.1.1.*")]
1717

1818
// The following attributes are used to specify the signing key for the assembly,
1919
// if desired. See the Mono documentation for more information about signing.

0 commit comments

Comments
 (0)