java-sdk/.github/workflows/merge.yml

50 lines
1.7 KiB
YAML

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: on-merge
on:
push:
branches: [ master, main ]
permissions:
packages: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
- name: Build with Gradle
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
with:
arguments: build
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
directory: lib/build
flags: unittests # optional
name: coverage # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
# the publishing section of your build.gradle
- name: Publish to Sonatype (Maven)
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
with:
arguments: publish -PossrhUsername=${{ secrets.OSSRH_USERNAME }} -PossrhPassword=${{ secrets.OSSRH_PASSWORD }}
env:
REPOSITORY_URL: https://s01.oss.sonatype.org/content/repositories/snapshots/