Skip to content

Merge pull request #86 from goncalossilva/renovate/buildconfig #201

Merge pull request #86 from goncalossilva/renovate/buildconfig

Merge pull request #86 from goncalossilva/renovate/buildconfig #201

name: Build and publish
on:
push:
branches: [ main ]
tags: [ v* ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- run: ./gradlew build
publish-library:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: macos-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- run: ./gradlew :resources-library:assemble
- run: ./gradlew :resources-library:publishToSonatype :resources-library:closeAndReleaseSonatypeStagingRepository
env:
ORG_GRADLE_PROJECT_version: ${{ env.VERSION }}
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
publish-plugin:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- run: ./gradlew :resources-plugin:assemble
- run: ./gradlew :resources-plugin:publish
env:
ORG_GRADLE_PROJECT_version: ${{ env.VERSION }}
ORG_GRADLE_PROJECT_gradlePublishKey: ${{ secrets.GRADLE_PUBLISH_KEY }}
ORG_GRADLE_PROJECT_gradlePublishSecret: ${{ secrets.GRADLE_PUBLISH_SECRET }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
release:
needs: [publish-plugin, publish-library]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}