Skip to content

3.4.3

3.4.3 #52

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
version:
required: true
description: Package version to publish under
skipGradlePluginPortal:
description: Should we skip publishing to Gradle Plugin Portal
required: false
default: "true"
skipGitHub:
description: Should we skip publishing to GitHub
required: false
default: "true"
skipMavenCentral:
description: Should we skip publishing to Maven Central
required: false
default: "true"
skipPages:
description: Should we skip publishing to GitHub Pages
required: false
default: "true"
release:
types: [ created ]
env:
VERSION: ${{ github.event.release.tag_name }}
jobs:
version:
name: Resolve Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.resolve.outputs.version }}
steps:
- name: resolve
id: resolve
run: |
VERSION=${VERSION:=${{ github.event.inputs.version }}}
VERSION=${VERSION/v}
echo "VERSION=${VERSION//v}" >> $GITHUB_ENV
echo "::set-output name=version::${VERSION//v}"
- name: report
run: |
echo "VERSION=${{ env.VERSION }}"
echo "steps.resolve.outputs.version=${{ steps.resolve.outputs.version }}"
check:
uses: ./.github/workflows/check.yml
release-Pages:
name: "Release: GitHub Pages"
needs: [ check, version ]
if: ${{ github.event.inputs.skipPages != 'true' }}
uses: ./.github/workflows/deploy-pages.yml
with:
version: ${{ needs.version.outputs.version }}
release-GradlePluginPortal:
name: "Release: GradlePluginPortal"
runs-on: ubuntu-latest
needs: [ check, version ]
if: ${{ github.event.inputs.skipGradlePluginPortal != 'true' }}
env:
VERSION: ${{ needs.version.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Restore Gradle cache
id: cache
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: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'
- name: Publish to Gradle Plugin Portal
shell: bash
run: |
./gradlew publishPlugins \
-Pgradle.publish.key="${{ secrets.GRADLE_PUBLISH_KEY }}" \
-Pgradle.publish.secret="${{ secrets.GRADLE_PUBLISH_SECRET }}" \
-Pversion="${{ env.VERSION }}"
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
release-GitHub:
name: "Release: GitHub"
runs-on: ubuntu-latest
needs: [ check, version ]
if: ${{ github.event.inputs.skipGitHub != 'true' }}
continue-on-error: true
env:
VERSION: ${{ needs.version.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Restore Gradle cache
id: cache
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: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'
- name: Publish to GitHub Packages
shell: bash
run: |
./gradlew publishAllPublicationsToGitHubRepository \
-Pversion="${{ env.VERSION }}"
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
GH_USERNAME: ${{ github.actor }}
GH_PASSWORD: ${{ github.token }}
release-MavenCentral:
name: "Release: MavenCentral"
runs-on: ubuntu-latest
needs: [ check, version ]
if: ${{ github.event.inputs.skipMavenCentral != 'true' }}
env:
VERSION: ${{ needs.version.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Restore Gradle cache
id: cache
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: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'
- name: Publish to MavenCentral
shell: bash
run: |
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository \
-Pversion="${{ env.VERSION }}"
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}