Skip to content

Commit

Permalink
Added GitHub Actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
616slayer616 committed Jul 12, 2021
1 parent a53fde8 commit fb32f6d
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 84 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'Develop'

on:
push:
branches:
- 'develop'

jobs:
build-feature:
runs-on: ubuntu-latest

steps:

- name: git checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: build
run: ./gradlew clean assemble

- name: test
run: ./gradlew check

- name: sonar analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonarqube
31 changes: 31 additions & 0 deletions .github/workflows/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'Feature'

on:
push:
branches-ignore:
- 'develop'
- 'master'

jobs:
build-feature:
runs-on: ubuntu-latest

steps:

- name: git checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: build
run: ./gradlew clean assemble

- name: test
run: ./gradlew check

- name: sonar analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonarqube

41 changes: 41 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 'Develop'

on:
push:
branches:
- 'master'

jobs:
build-feature:
runs-on: ubuntu-latest

steps:

- name: git checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: build
run: ./gradlew clean assemble

- name: test
run: ./gradlew check

- name: sonar analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonarqube

- name: Decode secret key
run: |
echo "${{secrets.SIGNING_SECRET_KEY_RING_FILE}}" > secring.gpg.b64
base64 -d secring.gpg.b64 > secring.gpg
- name: Publish to the Maven Central Repository
run: ./gradlew publish -Psigning.keyId=${{secrets.OSSRH_GPG_SECRET_KEY_ID}} -Psigning.password=${{secrets.OSSRH_GPG_SECRET_KEY_PASSWORD}} -Psigning.secretKeyRingFile=$(echo secring.gpg)
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

61 changes: 0 additions & 61 deletions Jenkinsfile

This file was deleted.

34 changes: 21 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id 'maven-publish'
id 'signing'
id 'jacoco'
id "org.sonarqube" version "2.8"
id "org.sonarqube" version "3.3"
}

group 'org.padler'
Expand All @@ -18,7 +18,7 @@ test {
test.finalizedBy jacocoTestReport

jacoco {
toolVersion = "0.8.5"
toolVersion = "0.8.7"
}

jacocoTestReport {
Expand All @@ -33,17 +33,19 @@ repositories {

dependencies {
// https://mvnrepository.com/artifact/org.assertj/assertj-core
testImplementation 'org.assertj:assertj-core:3.15.0'
testImplementation 'org.assertj:assertj-core:3.20.2'
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
}

sonarqube {
properties {
property "sonar.projectName", "Natorder"
property "sonar.projectKey", "616slayer616_natorder"
property("sonar.projectName", "Natorder")
property("sonar.projectKey", "616slayer616_natorder")
property("sonar.organization", "616slayer616-github")
property("sonar.host.url", "https://sonarcloud.io")
}
}

Expand Down Expand Up @@ -99,12 +101,19 @@ publishing {
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
name = "OSSRH"
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = project.hasProperty("sonatypeUsername") ? sonatypeUsername : ""
password = project.hasProperty("sonatypePassword") ? sonatypePassword : ""
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/616slayer616/natorder"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
Expand All @@ -114,7 +123,6 @@ signing {
sign publishing.publications.mavenJava
}


javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
Expand Down

0 comments on commit fb32f6d

Please sign in to comment.