Skip to content

Publish to the Gradle Plugin Portal #23

Publish to the Gradle Plugin Portal

Publish to the Gradle Plugin Portal #23

Workflow file for this run

# A workflow for publishing the plugin to the Gradle Plugin Portal
#
# Release Process:
# 1. Update the version number in root build.gradle to the next non-SNAPSHOT version.
# e.g. replace `version '1.2.3-SNAPSHOT' with '1.2.3'
# 2. Replace all references to the last release number with the new release number.
# e.g. search for `1.2.2` and replace with `1.2.3`.
# 3. Commit changes in PR and merge.
# 4. Run this workflow to publish the plugin.
# 5. Update the version number in root build.gradle to the next -SNAPSHOT version.
# e.g. replace `version '1.2.3' with '1.2.4-SNAPSHOT'
# 6. Add the new release to the Compatibility Matrix in the README.md file.
# 7. Commit changes in PR and merge.
name: Publish to the Gradle Plugin Portal
on: [workflow_dispatch]
jobs:
publish:
runs-on: ubuntu-latest
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
steps:
- name: Git checkout
uses: actions/checkout@v7.0.1
- name: Set up JDK 17
uses: actions/setup-java@v6.0.0
with:
cache: gradle
distribution: microsoft
java-version: 17
- name: Create gradle.properties
run: echo -e "gradle.publish.key=$GRADLE_PUBLISH_KEY\ngradle.publish.secret=$GRADLE_PUBLISH_SECRET" > gradle.properties
- name: Build with Gradle
run: ./gradlew build -x test publishPlugins
create-gh-release:
needs: [publish]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v3.0.0
- name: Create GitHut Release
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v0.1.15
with:
generate_release_notes: true