Skip to content

Commit

Permalink
[2.1.0-SNAPSHOT]
Browse files Browse the repository at this point in the history
CI updated
  • Loading branch information
GoodforGod committed Oct 5, 2023
1 parent 3405883 commit 40059f4
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 15 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI Master

on:
release:
types: [ published ]

jobs:
publish-release:
runs-on: ubuntu-latest
name: Publish Release

steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'

- name: Build
run: './gradlew classes'

- name: Test
run: './gradlew test jacocoTestReport'
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_2 }}

- name: SonarQube
run: './gradlew sonar --info'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: Publish Release to GitHub Packages
run: './gradlew publishMavenJavaPublicationToGitHubPackagesRepository'
env:
RELEASE_VERSION: ${{ github.ref_name }}
GITHUB_TOKEN: ${{ secrets.OSS_GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSS_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSS_SIGNING_PASSWORD }}

- name: Publish Release to OSSRH
run: './gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository'
env:
RELEASE_VERSION: ${{ github.ref_name }}
OSS_USERNAME: ${{ secrets.OSS_USERNAME }}
OSS_PASSWORD: ${{ secrets.OSS_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSS_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSS_SIGNING_PASSWORD }}
44 changes: 44 additions & 0 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI Dev

on:
push:
paths:
- '**/workflows/*.yml'
- '**/java/**'
- '*.java'
- '*.gradle'
- '*.properties'
branches:
- dev

jobs:
publish-snapshot:
runs-on: ubuntu-latest
name: Publish Snapshot

steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'

- name: Code Style
run: './gradlew spotlessCheck'

- name: Build
run: './gradlew classes'

- name: Test
run: './gradlew test jacocoTestReport'
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_2 }}

- name: Publish Snapshot
run: './gradlew publish'
env:
OSS_USERNAME: ${{ secrets.OSS_USERNAME }}
OSS_PASSWORD: ${{ secrets.OSS_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSS_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSS_SIGNING_PASSWORD }}
34 changes: 19 additions & 15 deletions .github/workflows/gradle.yml → .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Java CI
name: CI Pull Request

on:
push:
branches:
- master
pull_request:
branches:
- master
Expand All @@ -15,37 +12,44 @@ jobs:
strategy:
matrix:
java: [ '11', '17' ]
name: Java ${{ matrix.java }} setup
name: Java ${{ matrix.java }} Pull Request setup

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v1

uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'

- name: Build
run: ./gradlew classes
- name: Code Style
run: './gradlew spotlessCheck'

- name: Codestyle
run: ./gradlew spotlessCheck
- name: Build
run: './gradlew classes'

- name: Test
if: matrix.java == '11'
run: ./gradlew test jacocoTestReport
run: './gradlew test jacocoTestReport'
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_1 }}

- name: Test
if: matrix.java == '17'
run: ./gradlew test jacocoTestReport
run: './gradlew test jacocoTestReport'
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_2 }}

- name: SonarQube
if: matrix.java == '17'
run: ./gradlew sonarqube
run: './gradlew sonar --info'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: Test Report
if: matrix.java == '17'
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: |
**/test-results/**/*.xml

0 comments on commit 40059f4

Please sign in to comment.