Skip to content

Commit

Permalink
Publishing to Gradle plugin portal
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtechhabarta committed Sep 28, 2022
1 parent 5d41bfc commit 982e9ea
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release-gradle-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

name: Release to Gradle plugin portal

on:
workflow_dispatch:
inputs:
version:
description: typescript-generator version
required: true
type: string

jobs:
release:
runs-on: windows-latest
steps:

- name: Checkout workflow
uses: actions/checkout@v3

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17

- name: Execute Gradle publish
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.5.1
build-root-directory: build\typescript-generator-gradle-plugin-publisher
arguments: printVersion publishPlugins
env:
ORG_GRADLE_PROJECT_version: ${{ inputs.version }}
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ release.properties
/sample-gradle-spring/.nb-gradle/
/sample-gradle-spring/bin/
/sample-gradle-spring/build/
.gradle
gradlew*
gradle-wrapper*

Expand Down
40 changes: 40 additions & 0 deletions build/typescript-generator-gradle-plugin-publisher/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

plugins {
id 'com.gradle.plugin-publish' version '1.0.0'
id 'java-library'
}

group = 'cz.habarta.typescript-generator'

repositories {
mavenCentral()
mavenLocal()
}

dependencies {
api "cz.habarta.typescript-generator:typescript-generator-gradle-plugin:${version}"
api "cz.habarta.typescript-generator:typescript-generator-spring:${version}"
}

task printVersion {
doLast {
println "Releasing 'cz.habarta.typescript-generator' Gradle plugin version ${project.version}..."
}
}

pluginBundle {
website = 'https://github.com/vojtechhabarta/typescript-generator'
vcsUrl = 'https://github.com/vojtechhabarta/typescript-generator'
tags = ['java', 'kotlin', 'json', 'typescript', 'typescript-generator', 'jackson', 'jakarta', 'rest', 'client', 'spring']
}

gradlePlugin {
plugins {
typescriptGeneratorPlugin {
id = 'cz.habarta.typescript-generator'
displayName = 'Typescript-generator Gradle plugin'
description = 'Generates TypeScript from Java - JSON declarations, REST service client'
implementationClass = 'cz.habarta.typescript.generator.gradle.TypeScriptGeneratorPublishedPlugin'
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

package cz.habarta.typescript.generator.gradle;

public class TypeScriptGeneratorPublishedPlugin extends TypeScriptGeneratorPlugin {
}

0 comments on commit 982e9ea

Please sign in to comment.