diff --git a/.github/workflows/snapshot.yml b/.github/workflows/develop.yml similarity index 70% rename from .github/workflows/snapshot.yml rename to .github/workflows/develop.yml index 8113431..6f35ad6 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/develop.yml @@ -1,13 +1,29 @@ -name: Publish Snapshot +name: Build and Publish Snapshot on: push: - branches: - - develop + branches: [ develop ] jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + java-package: jdk + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build + publish-snapshot: + needs: build runs-on: ubuntu-latest steps: diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 1ff7482..6aff882 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -1,4 +1,4 @@ -name: Build and Coverage +name: Build, Coverage and Publish Release on: push: @@ -10,19 +10,47 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - java-package: jdk - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew build - - name: JaCoco Test Report - run: ./gradlew jacocoTestReport - - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./Library/build/reports/jacoco/test/jacocoTestReport.xml + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + java-package: jdk + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build + - name: JaCoco Test Report + run: ./gradlew jacocoTestReport + - uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./Library/build/reports/jacoco/test/jacocoTestReport.xml + + publish-release: + + needs: build-and-coverage + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Gradle Maven Publish + run: | + ./gradlew publishMavenJavaPublicationToMavenRepository + env: + IS_RELEASE: "YES" + PGP_KEY: ${{ secrets.PGP_KEY }} + PGP_PWD: ${{ secrets.PGP_PWD }} + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + - name: Gradle Plugin Publish + run: | + ./gradlew publishPlugins -Pgradle.publish.key=$GRADLE_PUBLISH_KEY -Pgradle.publish.secret=$GRADLE_PUBLISH_SECRET + env: + IS_RELEASE: "YES" + GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} + GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 7ae570f..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Publish Release - -on: - push: - branches: - - release/* - -jobs: - publish-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Gradle Maven Publish - run: | - ./gradlew publishMavenJavaPublicationToMavenRepository - env: - IS_RELEASE: "YES" - PGP_KEY: ${{ secrets.PGP_KEY }} - PGP_PWD: ${{ secrets.PGP_PWD }} - OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} - OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - - name: Gradle Plugin Publish - run: | - ./gradlew publishPlugins -Pgradle.publish.key=$GRADLE_PUBLISH_KEY -Pgradle.publish.secret=$GRADLE_PUBLISH_SECRET - env: - IS_RELEASE: "YES" - GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} - GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} diff --git a/README.md b/README.md index 66cc33e..567d805 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ [![Touch Portal Plugin SDK](https://raw.githubusercontent.com/ChristopheCVB/TouchPortalPluginSDK/master/resources/TP%20Plugin%20SDK%20Logo.png)](#touch-portal-plugin-sdk) -[![Build and Coverage](https://github.com/ChristopheCVB/TouchPortalPluginSDK/workflows/Build%20and%20Coverage/badge.svg)](#touch-portal-plugin-sdk) +[![Build, Coverage and Publish Release](https://github.com/ChristopheCVB/TouchPortalPluginSDK/workflows/Build,%20Coverage%20and%20Publish%20Release/badge.svg)](#touch-portal-plugin-sdk) +[![Build and Publish Snapshot](https://github.com/ChristopheCVB/TouchPortalPluginSDK/workflows/Build%20and%20Publish%20Snapshot/badge.svg)](#touch-portal-plugin-sdk) [![Code Coverage](https://codecov.io/gh/ChristopheCVB/TouchPortalPluginSDK/branch/master/graph/badge.svg)](https://codecov.io/gh/ChristopheCVB/TouchPortalPluginSDK) [![Language gradle: Java](https://img.shields.io/lgtm/grade/java/g/ChristopheCVB/TouchPortalPluginSDK.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ChristopheCVB/TouchPortalPluginSDK/context:java)