Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Workflow file for this run

name: Publish to NetflixOSS and Maven Central
on:
release:
types:
- released
- prereleased
permissions:
contents: read
jobs:
publish:
runs-on: ubuntu-latest
name: Gradle Build and Publish
steps:
- uses: actions/checkout@v3
- name: Set up Zulu JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Publish candidate
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-rc.')
run: ./gradlew -Prelease.useLastTag=true candidate --scan
env:
NETFLIX_OSS_SONATYPE_USERNAME: ${{ secrets.ORG_SONATYPE_USERNAME }}
NETFLIX_OSS_SONATYPE_PASSWORD: ${{ secrets.ORG_SONATYPE_PASSWORD }}
NETFLIX_OSS_SIGNING_KEY: ${{ secrets.ORG_SIGNING_KEY }}
NETFLIX_OSS_SIGNING_PASSWORD: ${{ secrets.ORG_SIGNING_PASSWORD }}
NETFLIX_OSS_REPO_USERNAME: ${{ secrets.ORG_NETFLIXOSS_USERNAME }}
NETFLIX_OSS_REPO_PASSWORD: ${{ secrets.ORG_NETFLIXOSS_PASSWORD }}
- name: Publish release
if: startsWith(github.ref, 'refs/tags/v') && (!contains(github.ref, '-rc.'))
run: ./gradlew -Prelease.useLastTag=true final --scan
env:
NETFLIX_OSS_SONATYPE_USERNAME: ${{ secrets.ORG_SONATYPE_USERNAME }}
NETFLIX_OSS_SONATYPE_PASSWORD: ${{ secrets.ORG_SONATYPE_PASSWORD }}
NETFLIX_OSS_SIGNING_KEY: ${{ secrets.ORG_SIGNING_KEY }}
NETFLIX_OSS_SIGNING_PASSWORD: ${{ secrets.ORG_SIGNING_PASSWORD }}
NETFLIX_OSS_REPO_USERNAME: ${{ secrets.ORG_NETFLIXOSS_USERNAME }}
NETFLIX_OSS_REPO_PASSWORD: ${{ secrets.ORG_NETFLIXOSS_PASSWORD }}
- name: Publish tag to community repo
if: startsWith(github.ref, 'refs/tags/v')
run: |
export TAG=$(git describe --tags --abbrev=0)
echo "Current release version is $TAG"
echo "Triggering community build"
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ secrets.COMMUNITY_REPO_TRIGGER }}" \
-X POST https://api.github.com/repos/Netflix/conductor-community/dispatches \
-d '{"event_type": "publish_build","client_payload": {"tag":"'"$TAG"'"}}'
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/test/TEST-*.xml'