Skip to content

Commit c80f46a

Browse files
feeblefakiejnmt
andauthored
Backport to branch(3) : Add release flows for HashStore and TableStore (#272)
Co-authored-by: Jun Nemoto <[email protected]>
1 parent ad27297 commit c80f46a

File tree

14 files changed

+187
-47
lines changed

14 files changed

+187
-47
lines changed

.github/workflows/create-release-notes.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,32 @@ jobs:
7878
asset_name: scalardl-java-client-sdk-${{ steps.version.outputs.version }}.zip
7979
asset_content_type: application/zip
8080

81+
- name: Build HashStore client SDK zip
82+
run: ./gradlew :hash-store:distZip
83+
84+
- name: Upload HashStore client SDK zip
85+
uses: actions/upload-release-asset@v1
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GH_PROJECT_ACCESS_TOKEN }}
88+
with:
89+
upload_url: ${{ steps.create_release.outputs.upload_url }}
90+
asset_path: hash-store/build/distributions/scalardl-hashstore-java-client-sdk-${{ steps.version.outputs.version }}.zip
91+
asset_name: scalardl-hashstore-java-client-sdk-${{ steps.version.outputs.version }}.zip
92+
asset_content_type: application/zip
93+
94+
- name: Build TableStore client SDK zip
95+
run: ./gradlew :table-store:distZip
96+
97+
- name: Upload TableStore client SDK zip
98+
uses: actions/upload-release-asset@v1
99+
env:
100+
GITHUB_TOKEN: ${{ secrets.GH_PROJECT_ACCESS_TOKEN }}
101+
with:
102+
upload_url: ${{ steps.create_release.outputs.upload_url }}
103+
asset_path: table-store/build/distributions/scalardl-tablestore-java-client-sdk-${{ steps.version.outputs.version }}.zip
104+
asset_name: scalardl-tablestore-java-client-sdk-${{ steps.version.outputs.version }}.zip
105+
asset_content_type: application/zip
106+
81107
- name: Build zip for generic contracts and functions
82108
run: ./gradlew :generic-contracts:distZip
83109

.github/workflows/release-snapshot.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
if: contains(steps.version.outputs.version, '-SNAPSHOT')
3535
run: ./gradlew publish
3636

37-
- name: Upload the SNAPSHOT versions of scalardl-ledger, scalardl-java-client-sdk, scalardl-common, and scalardl-rpc to Maven Central Repository
37+
- name: Upload the SNAPSHOT versions of scalardl-* libraries to Maven Central Repository
3838
if: contains(steps.version.outputs.version, '-SNAPSHOT')
3939
env:
4040
JRELEASER_NEXUS2_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Prepare artifacts in staging-deploy directories
3636
run: ./gradlew publish
3737

38-
- name: Upload scalardl-ledger, scalardl-java-client-sdk, scalardl-common, and scalardl-rpc to Maven Central Repository
38+
- name: Upload scalardl-* libraries to Maven Central Repository
3939
env:
4040
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
4141
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

.github/workflows/scalar.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ jobs:
156156
name: integration_test_reports_for_generic_contracts
157157
path: generic-contracts/build/reports/tests/integrationTest
158158

159-
integration-test-for-hash-store:
160-
name: Integration test for hash store
159+
integration-test-for-hashstore:
160+
name: Integration test for HashStore
161161
runs-on: ubuntu-latest
162162

163163
services:
@@ -190,8 +190,8 @@ jobs:
190190
name: integration_test_reports_for_hash_store
191191
path: hash-store/build/reports/tests/integrationTest
192192

193-
integration-test-for-table-store:
194-
name: Integration test for table store
193+
integration-test-for-tablestore:
194+
name: Integration test for TableStore
195195
runs-on: ubuntu-latest
196196

197197
services:

hash-store/archive.gradle

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
apply plugin: 'maven-publish'
2+
3+
publishing {
4+
publications {
5+
mavenJava(MavenPublication) {
6+
artifactId = 'scalardl-hashstore-java-client-sdk'
7+
from components.java
8+
artifact distTar
9+
artifact distZip
10+
artifact javadocJar
11+
artifact sourcesJar
12+
pom {
13+
name = 'ScalarDL HashStore Java Client SDK'
14+
description = 'A client-side Java library to interact with ScalarDL HashStore.'
15+
url = 'https://github.com/scalar-labs/scalardl'
16+
licenses {
17+
license {
18+
name = 'Apache License, Version 2.0'
19+
url = 'http://www.apache.org/licenses/LICENSE-2.0'
20+
}
21+
}
22+
developers {
23+
developer {
24+
id = 'hiroyuki'
25+
name = 'Hiroyuki Yamada'
26+
27+
}
28+
developer {
29+
id = 'jnmt'
30+
name = 'Jun Nemoto'
31+
32+
}
33+
}
34+
scm {
35+
connection = 'scm:git:https://github.com/scalar-labs/scalardl.git'
36+
developerConnection = 'scm:git:https://github.com/scalar-labs/scalardl.git'
37+
url = 'https://github.com/scalar-labs/scalardl'
38+
}
39+
}
40+
}
41+
}
42+
repositories {
43+
maven {
44+
url = layout.buildDirectory.dir('staging-deploy')
45+
}
46+
}
47+
}

hash-store/build.gradle

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ dependencies {
4747

4848
task HashStore(type: CreateStartScripts) {
4949
mainClass = 'com.scalar.dl.hashstore.client.tool.HashStoreCommandLine'
50-
applicationName = 'scalardl-hash-store'
50+
applicationName = 'scalardl-hashstore'
5151
outputDir = new File(project.buildDir, 'tmp')
5252
classpath = jar.outputs.files + project.configurations.runtimeClasspath
5353
}
@@ -102,3 +102,26 @@ task sourcesJar(type: Jar) {
102102
classifier = 'sources'
103103
from sourceSets.main.allSource
104104
}
105+
106+
javadoc {
107+
title = "ScalarDL HashStore Java Client SDK ${version}"
108+
source += sourceSets.main.java
109+
source += project(':client').sourceSets.main.java
110+
source += project(':common').sourceSets.main.java
111+
include "com/scalar/dl/hashstore/**"
112+
include "com/scalar/dl/client/exception/*.java"
113+
include "com/scalar/dl/ledger/model/*.java"
114+
}
115+
116+
distZip {
117+
archiveFileName = "scalardl-hashstore-java-client-sdk-${project.version}.zip"
118+
}
119+
120+
archivesBaseName = "scalardl-hashstore-java-client-sdk"
121+
122+
// for archiving and uploading to maven central
123+
if (!project.gradle.startParameter.taskNames.isEmpty() &&
124+
(project.gradle.startParameter.taskNames[0].endsWith('publish') ||
125+
project.gradle.startParameter.taskNames[0].endsWith('publishToMavenLocal'))) {
126+
apply from: 'archive.gradle'
127+
}

hash-store/src/main/java/com/scalar/dl/hashstore/client/tool/HashStoreCommandLine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import picocli.CommandLine.HelpCommand;
1515

1616
@Command(
17-
name = "scalardl-hash-store",
17+
name = "scalardl-hashstore",
1818
subcommands = {
1919
HelpCommand.class,
2020
Bootstrap.class,
@@ -28,7 +28,7 @@
2828
CollectionHistoryGet.class,
2929
LedgerValidation.class,
3030
},
31-
description = {"These are ScalarDL Hash Store commands used in various situations:"})
31+
description = {"These are ScalarDL HashStore commands used in various situations:"})
3232
public class HashStoreCommandLine {
3333

3434
public static void main(String[] args) {

hash-store/src/test/java/com/scalar/dl/hashstore/client/tool/HashStoreCommandLineTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ void displaysGroupedSubcommands() {
3636
String expected =
3737
String.join(
3838
System.lineSeparator(),
39-
"Usage: scalardl-hash-store [COMMAND]",
40-
"These are ScalarDL Hash Store commands used in various situations:",
39+
"Usage: scalardl-hashstore [COMMAND]",
40+
"These are ScalarDL HashStore commands used in various situations:",
4141
"",
4242
"bootstrap the hash store",
4343
" bootstrap Bootstrap the hash store by registering identity and",
@@ -76,7 +76,7 @@ void setup() {
7676
@Test
7777
@DisplayName("member values are properly set")
7878
void memberValuesAreProperlySet() {
79-
assertThat(command.name()).isEqualTo("scalardl-hash-store");
79+
assertThat(command.name()).isEqualTo("scalardl-hashstore");
8080
assertThat(command.subcommands())
8181
.isEqualTo(
8282
new Class[] {
@@ -114,7 +114,7 @@ public void parseCommandSucceeds() {
114114
// Verify that the argument contains only the top-level command.
115115
assertThat(parsed.size()).isEqualTo(1);
116116

117-
// Verify that the top-level command is "scalardl-hash-store".
117+
// Verify that the top-level command is "scalardl-hashstore".
118118
assertThat(parsed.get(0).getCommand().getClass()).isEqualTo(HashStoreCommandLine.class);
119119
}
120120
}

table-store/archive.gradle

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
apply plugin: 'maven-publish'
2+
3+
publishing {
4+
publications {
5+
mavenJava(MavenPublication) {
6+
artifactId = 'scalardl-tablestore-java-client-sdk'
7+
from components.java
8+
artifact distTar
9+
artifact distZip
10+
artifact javadocJar
11+
artifact sourcesJar
12+
pom {
13+
name = 'ScalarDL TableStore Java Client SDK'
14+
description = 'A client-side Java library to interact with ScalarDL TableStore.'
15+
url = 'https://github.com/scalar-labs/scalardl'
16+
licenses {
17+
license {
18+
name = 'Apache License, Version 2.0'
19+
url = 'http://www.apache.org/licenses/LICENSE-2.0'
20+
}
21+
}
22+
developers {
23+
developer {
24+
id = 'hiroyuki'
25+
name = 'Hiroyuki Yamada'
26+
27+
}
28+
developer {
29+
id = 'jnmt'
30+
name = 'Jun Nemoto'
31+
32+
}
33+
}
34+
scm {
35+
connection = 'scm:git:https://github.com/scalar-labs/scalardl.git'
36+
developerConnection = 'scm:git:https://github.com/scalar-labs/scalardl.git'
37+
url = 'https://github.com/scalar-labs/scalardl'
38+
}
39+
}
40+
}
41+
}
42+
repositories {
43+
maven {
44+
url = layout.buildDirectory.dir('staging-deploy')
45+
}
46+
}
47+
}

table-store/build.gradle

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ dependencies {
4646

4747
task TableStore(type: CreateStartScripts) {
4848
mainClass = 'com.scalar.dl.tablestore.client.tool.TableStoreCommandLine'
49-
applicationName = 'scalardl-table-store'
49+
applicationName = 'scalardl-tablestore'
5050
outputDir = new File(project.buildDir, 'tmp')
5151
classpath = jar.outputs.files + project.configurations.runtimeClasspath
5252
}
@@ -101,3 +101,26 @@ task sourcesJar(type: Jar) {
101101
classifier = 'sources'
102102
from sourceSets.main.allSource
103103
}
104+
105+
javadoc {
106+
title = "ScalarDL TableStore Java Client SDK ${version}"
107+
source += sourceSets.main.java
108+
source += project(':client').sourceSets.main.java
109+
source += project(':common').sourceSets.main.java
110+
include "com/scalar/dl/tablestore/**"
111+
include "com/scalar/dl/client/exception/*.java"
112+
include "com/scalar/dl/ledger/model/*.java"
113+
}
114+
115+
distZip {
116+
archiveFileName = "scalardl-tablestore-java-client-sdk-${project.version}.zip"
117+
}
118+
119+
archivesBaseName = "scalardl-tablestore-java-client-sdk"
120+
121+
// for archiving and uploading to maven central
122+
if (!project.gradle.startParameter.taskNames.isEmpty() &&
123+
(project.gradle.startParameter.taskNames[0].endsWith('publish') ||
124+
project.gradle.startParameter.taskNames[0].endsWith('publishToMavenLocal'))) {
125+
apply from: 'archive.gradle'
126+
}

0 commit comments

Comments
 (0)