Skip to content

Commit b6f7ac8

Browse files
committed
Split module versioning with independent publish workflow
Remove shared version from root build.gradle and subprojects block python-embed-runtime: version = 1.0.2-SNAPSHOT python-embed-spring-boot-starter: version = 1.0.1 Add tag-prefix based independent publish workflow (runtime-v*, starter-v*, plugin-v*)
1 parent 1811743 commit b6f7ac8

4 files changed

Lines changed: 104 additions & 2 deletions

File tree

.github/workflows/publish.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags: ['runtime-v*', 'starter-v*', 'plugin-v*']
6+
workflow_dispatch:
7+
inputs:
8+
module:
9+
description: 'Module to publish'
10+
required: true
11+
type: choice
12+
options:
13+
- runtime
14+
- starter
15+
- plugin
16+
17+
jobs:
18+
runtime-maven-central:
19+
name: Publish Runtime to Maven Central
20+
if: ${{ startsWith(github.ref, 'refs/tags/runtime-v') || (github.event_name == 'workflow_dispatch' && inputs.module == 'runtime') }}
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up JDK 17
26+
uses: actions/setup-java@v4
27+
with:
28+
java-version: '17'
29+
distribution: 'temurin'
30+
31+
- name: Set up Gradle
32+
uses: gradle/actions/setup-gradle@v4
33+
34+
- name: Build
35+
run: ./gradlew :python-embed-runtime:build
36+
37+
- name: Publish to Maven Central
38+
run: ./gradlew :python-embed-runtime:publishToMavenCentral --no-configuration-cache
39+
env:
40+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
41+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
42+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }}
43+
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_IN_MEMORY_KEY_ID }}
44+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }}
45+
46+
starter-maven-central:
47+
name: Publish Starter to Maven Central
48+
if: ${{ startsWith(github.ref, 'refs/tags/starter-v') || (github.event_name == 'workflow_dispatch' && inputs.module == 'starter') }}
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v4
52+
53+
- name: Set up JDK 17
54+
uses: actions/setup-java@v4
55+
with:
56+
java-version: '17'
57+
distribution: 'temurin'
58+
59+
- name: Set up Gradle
60+
uses: gradle/actions/setup-gradle@v4
61+
62+
- name: Build
63+
run: ./gradlew :python-embed-spring-boot-starter:build
64+
65+
- name: Publish to Maven Central
66+
run: ./gradlew :python-embed-spring-boot-starter:publishToMavenCentral --no-configuration-cache
67+
env:
68+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
69+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
70+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }}
71+
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_IN_MEMORY_KEY_ID }}
72+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }}
73+
74+
gradle-plugin-portal:
75+
name: Publish to Gradle Plugin Portal
76+
if: ${{ startsWith(github.ref, 'refs/tags/plugin-v') || (github.event_name == 'workflow_dispatch' && inputs.module == 'plugin') }}
77+
runs-on: ubuntu-latest
78+
defaults:
79+
run:
80+
working-directory: python-embed-gradle-plugin
81+
steps:
82+
- uses: actions/checkout@v4
83+
84+
- name: Set up JDK 17
85+
uses: actions/setup-java@v4
86+
with:
87+
java-version: '17'
88+
distribution: 'temurin'
89+
90+
- name: Set up Gradle
91+
uses: gradle/actions/setup-gradle@v4
92+
93+
- name: Build
94+
run: ./gradlew build
95+
96+
- name: Publish to Gradle Plugin Portal
97+
run: ./gradlew publishPlugins
98+
env:
99+
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
100+
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}

build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ plugins {
44
}
55

66
group = 'io.github.howtis'
7-
version = '1.0.2-SNAPSHOT'
87

98
repositories {
109
mavenCentral()
1110
}
1211

1312
subprojects {
1413
group = rootProject.group
15-
version = rootProject.version
1614

1715
apply plugin: 'java'
1816
apply plugin: 'com.vanniktech.maven.publish'

python-embed-runtime/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ plugins {
22
id 'io.github.howtis.python-embed'
33
}
44

5+
version = '1.0.2-SNAPSHOT'
6+
57
dependencies {
68
implementation 'org.msgpack:msgpack-core:0.9.8'
79
implementation 'org.slf4j:slf4j-api:2.0.16'

python-embed-spring-boot-starter/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
compileJava.options.encoding = 'UTF-8'
22
compileTestJava.options.encoding = 'UTF-8'
33

4+
version = '1.0.1'
5+
46
dependencies {
57
implementation project(':python-embed-runtime')
68

0 commit comments

Comments
 (0)