Skip to content

Release Pipeline

Release Pipeline #80

Workflow file for this run

# 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: Release Pipeline
on: workflow_dispatch
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
JDK_VER: 11
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PWD }}
JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: dapr.io
JRELEASER_NEXUS2_MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_USER_PASS }}
JRELEASER_DEPLOY_MAVEN_NEXUS2_USERNAME: ${{ secrets.OSSRH_USER_TOKEN }}
JRELEASER_DEPLOY_MAVEN_NEXUS2_TOKEN: ${{ secrets.OSSRH_PWD_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'microsoft'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build with Gradle
run: ./gradlew build -x test
- name: Run SpotBugs
run: ./gradlew spotbugsMain spotbugsTest
continue-on-error: false
- name: Upload SpotBugs reports
uses: actions/upload-artifact@v4
with:
name: SpotBugs Reports
path: '**/build/reports/spotbugs'
if-no-files-found: ignore
- name: Run Unit Tests with Gradle
run: |
./gradlew clean test || echo "UNIT_TEST_FAILED=true" >> $GITHUB_ENV
continue-on-error: true
- name: Upload test reports if tests failed
if: env.UNIT_TEST_FAILED == 'true'
uses: actions/upload-artifact@v4
with:
name: Unit Test Reports
path: '**/build/reports/tests/test'
if-no-files-found: ignore # Prevents errors if no reports exist
- name: Fail the job if unit tests fail
if: env.UNIT_TEST_FAILED == 'true'
run: exit 1
- name: Upload JAR output
uses: actions/upload-artifact@v4
with:
name: Package
path: client/build/libs
- name: Publish with Gradle
run: ./gradlew publish --stacktrace
- name: Publish to ossrh
run: |
./gradlew jreleaserFullRelease --stacktrace
curl -X POST https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/io.dapr