Skip to content

Commit bfa10d7

Browse files
authored
Merge pull request #2 from strategyobject/feature/ci
CI/CD for the project
2 parents c864e80 + 4ed342f commit bfa10d7

File tree

93 files changed

+123
-36
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+123
-36
lines changed

.github/workflows/gradle-build.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
2+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
3+
4+
name: Gradle Build
5+
6+
on:
7+
push
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-20.04
13+
permissions:
14+
contents: read
15+
packages: write
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up JDK 8
20+
uses: actions/setup-java@v2
21+
with:
22+
java-version: '8'
23+
distribution: 'adopt'
24+
25+
- name: Build with Gradle
26+
run: gradle build
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
2+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
3+
4+
name: Gradle Package
5+
6+
## TODO it should be bound to releases
7+
on:
8+
workflow_dispatch
9+
10+
jobs:
11+
publish:
12+
13+
runs-on: ubuntu-20.04
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Set up JDK 8
21+
uses: actions/setup-java@v2
22+
with:
23+
java-version: '8'
24+
distribution: 'adopt'
25+
26+
- name: Build with Gradle
27+
run: gradle build
28+
29+
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
30+
# the publishing section of your build.gradle
31+
- name: Publish to GitHub Packages
32+
run: gradle publish
33+
env:
34+
USERNAME: ${{ github.actor }}
35+
TOKEN: ${{ secrets.GITHUB_TOKEN }}

build.gradle

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id 'io.freefair.lombok' version '6.1.0' apply false
3+
id 'maven-publish'
34
}
45

56
allprojects {
@@ -15,6 +16,7 @@ allprojects {
1516
subprojects {
1617
apply plugin: 'java'
1718
apply plugin: 'io.freefair.lombok'
19+
apply plugin: 'maven-publish'
1820

1921
targetCompatibility = '1.8'
2022
sourceCompatibility = '1.8'
@@ -34,4 +36,23 @@ subprojects {
3436
test {
3537
useJUnitPlatform()
3638
}
39+
40+
publishing {
41+
publications {
42+
gpr(MavenPublication) {
43+
from(components.java)
44+
}
45+
}
46+
47+
repositories {
48+
maven {
49+
name = "GitHubPackages"
50+
url = "https://maven.pkg.github.com/strategyobject/substrate-client-java"
51+
credentials {
52+
username = System.getenv("USERNAME")
53+
password = System.getenv("TOKEN")
54+
}
55+
}
56+
}
57+
}
3758
}

crypto/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ task compileRust {
1818
workingDir 'src/jni-crypto'
1919
commandLine 'cargo', 'build', '--release', '--target=x86_64-unknown-linux-gnu', '--target-dir=../../build/jni-crypto'
2020
}
21-
exec {
22-
workingDir 'src/jni-crypto'
23-
commandLine 'cargo', 'build', '--release', '--target=x86_64-pc-windows-gnu', '--target-dir=../../build/jni-crypto'
24-
}
21+
// TODO the build of the native library will be moved out of the project
22+
// exec {
23+
// workingDir 'src/jni-crypto'
24+
// commandLine 'cargo', 'build', '--release', '--target=x86_64-pc-windows-gnu', '--target-dir=../../build/jni-crypto'
25+
// }
2526
}
2627
}
2728

rpc/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies {
22
implementation project(':transport')
3-
implementation project(':rpc:sections')
4-
implementation project(':rpc:core')
5-
implementation project(':rpc:codegen')
3+
implementation project(':rpc:rpc-sections')
4+
implementation project(':rpc:rpc-core')
5+
implementation project(':rpc:rpc-codegen')
66
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies {
22
implementation project(':common')
3-
implementation project(':rpc:core')
3+
implementation project(':rpc:rpc-core')
44
implementation project(':scale')
55
implementation project(':scale:scale-codegen')
66
implementation project(':transport')
@@ -12,7 +12,7 @@ dependencies {
1212
testImplementation 'com.google.testing.compile:compile-testing:0.19'
1313
testImplementation 'com.google.code.gson:gson:2.8.8'
1414

15-
testCompileOnly project(':rpc:codegen')
16-
testAnnotationProcessor project(':rpc:codegen')
15+
testCompileOnly project(':rpc:rpc-codegen')
16+
testAnnotationProcessor project(':rpc:rpc-codegen')
1717
testAnnotationProcessor project(':scale:scale-codegen')
1818
}

rpc/codegen/src/main/java/com/strategyobject/substrateclient/rpc/codegen/Constants.java renamed to rpc/rpc-codegen/src/main/java/com/strategyobject/substrateclient/rpc/codegen/Constants.java

File renamed without changes.

rpc/codegen/src/main/java/com/strategyobject/substrateclient/rpc/codegen/decoder/DecoderCompositor.java renamed to rpc/rpc-codegen/src/main/java/com/strategyobject/substrateclient/rpc/codegen/decoder/DecoderCompositor.java

File renamed without changes.

rpc/codegen/src/main/java/com/strategyobject/substrateclient/rpc/codegen/decoder/RpcDecoderAnnotatedClass.java renamed to rpc/rpc-codegen/src/main/java/com/strategyobject/substrateclient/rpc/codegen/decoder/RpcDecoderAnnotatedClass.java

File renamed without changes.

rpc/codegen/src/main/java/com/strategyobject/substrateclient/rpc/codegen/decoder/RpcDecoderProcessor.java renamed to rpc/rpc-codegen/src/main/java/com/strategyobject/substrateclient/rpc/codegen/decoder/RpcDecoderProcessor.java

File renamed without changes.

0 commit comments

Comments
 (0)