Add DFP endpoints (#68) #60
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
publish: | |
name: Release build and publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: zulu | |
java-version: 11 | |
- name: Get version | |
id: version | |
run: | | |
VERSION=$(./gradlew -q printVersion) | |
echo "release_tag=$VERSION" >> $GITHUB_OUTPUT | |
- name: Get changed files | |
id: files | |
uses: jitterbit/get-changed-files@v1 | |
- name: Check for version.gradle.kts diff | |
id: diff | |
run: | | |
FOUND=0 | |
for changed_file in ${{ steps.files.outputs.all }}; do | |
if [[ $changed_file == "version.gradle.kts" ]]; then | |
FOUND=1 | |
fi | |
done | |
echo "diff=$FOUND" >> $GITHUB_OUTPUT | |
- name: Release build | |
if: steps.diff.outputs.diff != 0 || ${{ github.event_name == 'workflow_dispatch' }} | |
run: ./gradlew assemble | |
- name: Source jar | |
if: steps.diff.outputs.diff != 0 || ${{ github.event_name == 'workflow_dispatch' }} | |
run: ./gradlew kotlinSourcesJar | |
- name: Publish to Maven Central | |
if: steps.diff.outputs.diff != 0 || ${{ github.event_name == 'workflow_dispatch' }} | |
run: ./gradlew --info publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository | |
env: | |
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} | |
- name: Create release | |
if: steps.diff.outputs.diff != 0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release create "${{ steps.version.outputs.release_tag }}" --generate-notes |