Skip to content

Commit bead534

Browse files
authored
Merge pull request #3 from salaboy/gradle-release
Updating package name to use dapr.io
2 parents 85b7b05 + 9cf9935 commit bead534

5 files changed

Lines changed: 177 additions & 147 deletions

File tree

.github/workflows/build-validation.yml

Lines changed: 62 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -18,109 +18,20 @@ jobs:
1818

1919
runs-on: ubuntu-latest
2020

21-
steps:
22-
- uses: actions/checkout@v2
23-
24-
- name: Set up JDK 11
25-
uses: actions/setup-java@v2
26-
with:
27-
java-version: '11'
28-
distribution: 'microsoft'
29-
30-
- name: set JDK_11 environment variable test compiling and running
31-
env:
32-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
33-
run: echo ::set-env name=JDK_11::$(echo $JAVA_HOME)
34-
35-
- name: Set up JDK 8
36-
uses: actions/setup-java@v2
37-
with:
38-
java-version: '8'
39-
distribution: 'temurin'
40-
41-
- name: Setup Gradle
42-
uses: gradle/gradle-build-action@v2
43-
44-
- name: Build with Gradle
45-
run: ./gradlew build -x test
46-
47-
- name: Run SpotBugs
48-
run: ./gradlew spotbugsMain spotbugsTest
49-
continue-on-error: false
50-
51-
- name: Upload SpotBugs reports
52-
uses: actions/upload-artifact@v4
53-
with:
54-
name: SpotBugs Reports
55-
path: '**/build/reports/spotbugs'
56-
if-no-files-found: ignore
57-
58-
- name: Run Unit Tests with Gradle
59-
run: |
60-
export JAVA_HOME=$JDK_11
61-
./gradlew clean test || echo "UNIT_TEST_FAILED=true" >> $GITHUB_ENV
62-
continue-on-error: true
63-
64-
- name: Upload test reports if tests failed
65-
if: env.UNIT_TEST_FAILED == 'true'
66-
uses: actions/upload-artifact@v4
67-
with:
68-
name: Unit Test Reports
69-
path: '**/build/reports/tests/test'
70-
if-no-files-found: ignore # Prevents errors if no reports exist
71-
72-
- name: Fail the job if unit tests failed
73-
if: env.UNIT_TEST_FAILED == 'true'
74-
run: exit 1
75-
76-
# TODO: Move the sidecar into a central image repository
77-
- name: Initialize Durable Task Sidecar
78-
run: docker run --name durabletask-sidecar -p 4001:4001 --env 'DURABLETASK_SIDECAR_LOGLEVEL=Debug' -d peterstone2019/durabletask-sidecar:latest start --backend Emulator
79-
80-
- name: Display Durable Task Sidecar Logs
81-
run: nohup docker logs --since=0 durabletask-sidecar > durabletask-sidecar.log 2>&1 &
82-
83-
# wait for 10 seconds, so sidecar container can be fully up, this will avoid intermittent failing issues for integration tests causing by failed to connect to sidecar
84-
- name: Wait for 10 seconds
85-
run: sleep 10
86-
87-
- name: Integration Tests with Gradle
88-
run: ./gradlew integrationTest || echo "TEST_FAILED=true" >> $GITHUB_ENV
89-
continue-on-error: true
90-
91-
- name: Kill Durable Task Sidecar
92-
run: docker kill durabletask-sidecar
93-
94-
- name: Upload Durable Task Sidecar Logs
95-
uses: actions/upload-artifact@v4
96-
with:
97-
name: Durable Task Sidecar Logs
98-
path: durabletask-sidecar.log
99-
100-
- name: Archive test report
101-
uses: actions/upload-artifact@v4
102-
with:
103-
name: Integration test report
104-
path: client/build/reports/tests/integrationTest
105-
106-
- name: Upload JAR output
107-
uses: actions/upload-artifact@v4
108-
with:
109-
name: Package
110-
path: client/build/libs
111-
112-
- name: Fail the job if tests failed
113-
if: env.TEST_FAILED == 'true'
114-
run: exit 1
115-
116-
functions-e2e-tests:
117-
118-
needs: build
119-
runs-on: ubuntu-latest
120-
12121
steps:
12222
- uses: actions/checkout@v2
12323

24+
- name: Set up JDK 11
25+
uses: actions/setup-java@v2
26+
with:
27+
java-version: '11'
28+
distribution: 'microsoft'
29+
30+
- name: set JDK_11 environment variable test compiling and running
31+
env:
32+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
33+
run: echo ::set-env name=JDK_11::$(echo $JAVA_HOME)
34+
12435
- name: Set up JDK 8
12536
uses: actions/setup-java@v2
12637
with:
@@ -130,63 +41,74 @@ jobs:
13041
- name: Setup Gradle
13142
uses: gradle/gradle-build-action@v2
13243

133-
- name: Publish to local
134-
run: ./gradlew publishToMavenLocal -PskipSigning
135-
136-
- name: Build azure functions sample
137-
run: ./gradlew azureFunctionsPackage
138-
continue-on-error: true
44+
- name: Build with Gradle
45+
run: ./gradlew build -x test
13946

140-
- name: Setup azure functions runtime
141-
run: endtoendtests/e2e-test-setup.ps1 -DockerfilePath endtoendtests/Dockerfile
142-
shell: pwsh
47+
- name: Run SpotBugs
48+
run: ./gradlew spotbugsMain spotbugsTest
49+
continue-on-error: false
14350

144-
- name: End to End Tests with Gradle
145-
uses: gradle/gradle-build-action@v2
51+
- name: Upload SpotBugs reports
52+
uses: actions/upload-artifact@v4
14653
with:
147-
arguments: endToEndTest
54+
name: SpotBugs Reports
55+
path: '**/build/reports/spotbugs'
56+
if-no-files-found: ignore
57+
58+
- name: Run Unit Tests with Gradle
59+
run: |
60+
export JAVA_HOME=$JDK_11
61+
./gradlew clean test || echo "UNIT_TEST_FAILED=true" >> $GITHUB_ENV
62+
continue-on-error: true
14863

149-
- name: Archive test report
64+
- name: Upload test reports if tests failed
65+
if: env.UNIT_TEST_FAILED == 'true'
15066
uses: actions/upload-artifact@v4
15167
with:
152-
name: Integration test report
153-
path: client/build/reports/tests/endToEndTest
154-
155-
functions-sample-tests:
156-
157-
needs: build
158-
runs-on: ubuntu-latest
68+
name: Unit Test Reports
69+
path: '**/build/reports/tests/test'
70+
if-no-files-found: ignore # Prevents errors if no reports exist
15971

160-
steps:
161-
- uses: actions/checkout@v2
72+
- name: Fail the job if unit tests failed
73+
if: env.UNIT_TEST_FAILED == 'true'
74+
run: exit 1
16275

163-
- name: Set up JDK 8
164-
uses: actions/setup-java@v2
165-
with:
166-
java-version: '8'
167-
distribution: 'temurin'
76+
# TODO: Move the sidecar into a central image repository
77+
- name: Initialize Durable Task Sidecar
78+
run: docker run --name durabletask-sidecar -p 4001:4001 --env 'DURABLETASK_SIDECAR_LOGLEVEL=Debug' -d peterstone2019/durabletask-sidecar:latest start --backend Emulator
16879

169-
- name: Setup Gradle
170-
uses: gradle/gradle-build-action@v2
80+
- name: Display Durable Task Sidecar Logs
81+
run: nohup docker logs --since=0 durabletask-sidecar > durabletask-sidecar.log 2>&1 &
17182

172-
- name: Publish to local
173-
run: ./gradlew publishToMavenLocal -PskipSigning
83+
# wait for 10 seconds, so sidecar container can be fully up, this will avoid intermittent failing issues for integration tests causing by failed to connect to sidecar
84+
- name: Wait for 10 seconds
85+
run: sleep 10
17486

175-
- name: Build azure functions sample
176-
run: ./gradlew azureFunctionsPackage
87+
- name: Integration Tests with Gradle
88+
run: ./gradlew integrationTest || echo "TEST_FAILED=true" >> $GITHUB_ENV
17789
continue-on-error: true
17890

179-
- name: Setup azure functions runtime
180-
run: samples-azure-functions/e2e-test-setup.ps1 -DockerfilePath samples-azure-functions/Dockerfile
181-
shell: pwsh
91+
- name: Kill Durable Task Sidecar
92+
run: docker kill durabletask-sidecar
18293

183-
- name: Sample Tests with Gradle
184-
uses: gradle/gradle-build-action@v2
94+
- name: Upload Durable Task Sidecar Logs
95+
uses: actions/upload-artifact@v4
18596
with:
186-
arguments: sampleTest
97+
name: Durable Task Sidecar Logs
98+
path: durabletask-sidecar.log
18799

188100
- name: Archive test report
189101
uses: actions/upload-artifact@v4
190102
with:
191103
name: Integration test report
192-
path: client/build/reports/tests/endToEndTest
104+
path: client/build/reports/tests/integrationTest
105+
106+
- name: Upload JAR output
107+
uses: actions/upload-artifact@v4
108+
with:
109+
name: Package
110+
path: client/build/libs
111+
112+
- name: Fail the job if tests failed
113+
if: env.TEST_FAILED == 'true'
114+
run: exit 1

.github/workflows/release.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
7+
8+
name: Release Pipeline
9+
10+
on: workflow_dispatch
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 30
16+
env:
17+
JDK_VER: 11
18+
OSSRH_USER_TOKEN: ${{ secrets.OSSRH_USER_TOKEN }}
19+
OSSRH_PWD_TOKEN: ${{ secrets.OSSRH_PWD_TOKEN }}
20+
GPG_KEY: ${{ secrets.GPG_KEY }}
21+
GPG_PWD: ${{ secrets.GPG_PWD }}
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: Set up JDK 11
25+
uses: actions/setup-java@v2
26+
with:
27+
java-version: '11'
28+
distribution: 'microsoft'
29+
30+
- name: set JDK_11 environment variable test compiling and running
31+
env:
32+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
33+
run: echo ::set-env name=JDK_11::$(echo $JAVA_HOME)
34+
35+
- name: Set up JDK 8
36+
uses: actions/setup-java@v2
37+
with:
38+
java-version: '8'
39+
distribution: 'temurin'
40+
41+
- name: Setup Gradle
42+
uses: gradle/gradle-build-action@v2
43+
44+
- name: Build with Gradle
45+
run: ./gradlew build -x test
46+
47+
- name: Run SpotBugs
48+
run: ./gradlew spotbugsMain spotbugsTest
49+
continue-on-error: false
50+
51+
- name: Upload SpotBugs reports
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: SpotBugs Reports
55+
path: '**/build/reports/spotbugs'
56+
if-no-files-found: ignore
57+
58+
- name: Run Unit Tests with Gradle
59+
run: |
60+
export JAVA_HOME=$JDK_11
61+
./gradlew clean test || echo "UNIT_TEST_FAILED=true" >> $GITHUB_ENV
62+
continue-on-error: true
63+
64+
- name: Upload test reports if tests failed
65+
if: env.UNIT_TEST_FAILED == 'true'
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: Unit Test Reports
69+
path: '**/build/reports/tests/test'
70+
if-no-files-found: ignore # Prevents errors if no reports exist
71+
72+
- name: Fail the job if unit tests failed
73+
if: env.UNIT_TEST_FAILED == 'true'
74+
run: exit 1
75+
76+
- name: Upload JAR output
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: Package
80+
path: client/build/libs
81+
82+
- name: Publish to ossrh
83+
run: |
84+
echo ${{ secrets.GPG_PRIVATE_KEY }} | base64 -d > private-key.gpg
85+
export GPG_TTY=$(tty)
86+
gpg --batch --import private-key.gpg
87+
./gradlew publish

client/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ plugins {
88
id 'com.github.spotbugs' version '5.2.1'
99
}
1010

11-
group 'com.microsoft'
12-
version = '1.5.1'
11+
group 'io.dapr'
12+
version = '1.5.2'
1313
archivesBaseName = 'durabletask-client'
1414

1515
def grpcVersion = '1.59.0'

settings.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
rootProject.name = 'durabletask-java'
22

33
include ":client"
4-
include ":azurefunctions"
5-
include ":azuremanaged"
6-
include ":samples"
7-
include ":samples-azure-functions"
8-
include ":endtoendtests"
94

settings.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!--
2+
OSSRH_USER_TOKEN and OSSRH-PWD_TOKEN: The username and password tokens for your OSSRH account
3+
GPG_KEY: the name of the GPG key file to use for signing e.g. F784FAB8
4+
GPG_PWD: the password to access the GPG key
5+
-->
6+
7+
<settings>
8+
<servers>
9+
<server>
10+
<id>ossrh</id>
11+
<username>${env.OSSRH_USER_TOKEN}</username>
12+
<password>${env.OSSRH_PWD_TOKEN}</password>
13+
</server>
14+
</servers>
15+
<profiles>
16+
<profile>
17+
<activation>
18+
<activeByDefault>true</activeByDefault>
19+
</activation>
20+
<properties>
21+
<gpg.keyname>${env.GPG_KEY}</gpg.keyname>
22+
<gpg.passphrase>${env.GPG_PWD}</gpg.passphrase>
23+
</properties>
24+
</profile>
25+
</profiles>
26+
</settings>

0 commit comments

Comments
 (0)