Skip to content

Commit 1b63144

Browse files
author
Justin Abrahms
authored
Merge pull request #25 from open-feature/move-to-maven
Move to maven
2 parents e6c9ea3 + dcb7f9f commit 1b63144

Some content is hidden

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

57 files changed

+351
-504
lines changed

.github/workflows/merge.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,28 @@ jobs:
2727
with:
2828
java-version: '8'
2929
distribution: 'temurin'
30-
- name: Build with Gradle
31-
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
30+
cache: maven
31+
server-id: ossrh
32+
server-username: ${{ secrets.OSSRH_USERNAME }}
33+
server-password: ${{ secrets.OSSRH_PASSWORD }}
34+
35+
- name: Cache local Maven repository
36+
uses: actions/cache@v2
3237
with:
33-
arguments: build
38+
path: ~/.m2/repository
39+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
40+
restore-keys: |
41+
${{ runner.os }}-maven-
42+
43+
- name: Configure GPG Key
44+
run: |
45+
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
46+
env:
47+
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
48+
49+
- name: Build with Maven
50+
run: mvn --batch-mode --update-snapshots verify
51+
3452
- name: Upload coverage to Codecov
3553
uses: codecov/codecov-action@v2
3654
with:
@@ -39,11 +57,9 @@ jobs:
3957
name: coverage # optional
4058
fail_ci_if_error: true # optional (default = false)
4159
verbose: true # optional (default = false)
42-
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
43-
# the publishing section of your build.gradle
44-
- name: Publish to Sonatype (Maven)
45-
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
46-
with:
47-
arguments: publish -PossrhUsername=${{ secrets.OSSRH_USERNAME }} -PossrhPassword=${{ secrets.OSSRH_PASSWORD }}
60+
- run: mkdir staging && cp target/*.jar staging
61+
- name: Publish package
62+
run: mvn --batch-mode deploy
4863
env:
49-
REPOSITORY_URL: https://s01.oss.sonatype.org/content/repositories/snapshots/
64+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
65+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

.github/workflows/pullrequest.yml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,45 @@
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-
81
name: PR
9-
102
on:
113
pull_request:
124
branches: [ master, main ]
13-
145
permissions:
156
packages: write
167
contents: read
178

189
jobs:
1910
build:
20-
2111
runs-on: ubuntu-latest
22-
2312
steps:
24-
- uses: actions/checkout@v3
13+
- name: Check out the code
14+
uses: actions/checkout@v3
2515
- name: Set up JDK 8
2616
uses: actions/setup-java@v3
2717
with:
2818
java-version: '8'
2919
distribution: 'temurin'
30-
- name: Build with Gradle
31-
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
20+
cache: maven
21+
22+
- name: Cache local Maven repository
23+
uses: actions/cache@v2
3224
with:
33-
arguments: build
25+
path: ~/.m2/repository
26+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
27+
restore-keys: |
28+
${{ runner.os }}-maven-
29+
30+
- name: Configure GPG Key
31+
run: |
32+
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
33+
env:
34+
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
35+
36+
- name: Build with Maven
37+
run: mvn --batch-mode --update-snapshots verify
38+
3439
- name: Upload coverage to Codecov
3540
uses: codecov/codecov-action@v2
3641
with:
37-
directory: lib/build
3842
flags: unittests # optional
39-
name: pr coverage # optional
43+
name: coverage # optional
4044
fail_ci_if_error: true # optional (default = false)
4145
verbose: true # optional (default = false)

.github/workflows/release.yml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
66
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
77

8+
# maven deploy commands via via https://tech.clevertap.com/automate-releases-to-maven-central-via-github-actions/
9+
810
name: Release
911

1012
on:
@@ -26,16 +28,34 @@ jobs:
2628
with:
2729
java-version: '8'
2830
distribution: 'temurin'
29-
- name: Build with Gradle
30-
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
31-
with:
32-
arguments: build
33-
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
34-
# the publishing section of your build.gradle
35-
- name: Publish to Sonatype (Maven)
36-
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
31+
cache: maven
32+
server-id: ossrh
33+
server-username: ${{ secrets.OSSRH_USERNAME }}
34+
server-password: ${{ secrets.OSSRH_PASSWORD }}
35+
36+
- name: Configure GPG Key
37+
run: |
38+
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
39+
env:
40+
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
41+
42+
- name: Build with Maven
43+
run: mvn --batch-mode --update-snapshots verify
44+
45+
- name: Upload coverage to Codecov
46+
uses: codecov/codecov-action@v2
3747
with:
38-
arguments: publish -PossrhUsername=${{ secrets.OSSRH_USERNAME }} -PossrhPassword=${{ secrets.OSSRH_PASSWORD }}
48+
directory: lib/build
49+
flags: unittests # optional
50+
name: coverage # optional
51+
fail_ci_if_error: true # optional (default = false)
52+
verbose: true # optional (default = false)
53+
- name: Deploy
54+
run: |
55+
mvn -P gpg_verify \
56+
--no-transfer-progress \
57+
--batch-mode \
58+
--file pom.xml -s release/m2-settings.xml verify deploy
3959
env:
40-
release: true
41-
REPOSITORY_URL: https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
60+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
61+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
build
66
.idea
77
specification.json
8+
target
9+
.DS_Store

gradle/wrapper/gradle-wrapper.jar

-58.4 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)