Skip to content

Commit a4d81f7

Browse files
authored
Separate publish option (#175)
1 parent e5eaabd commit a4d81f7

File tree

2 files changed

+109
-30
lines changed

2 files changed

+109
-30
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: 'Publish modules'
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
target-module:
7+
required: true
8+
type: string
9+
target-ref:
10+
required: true
11+
type: string
12+
13+
jobs:
14+
publish:
15+
name: Publish artifacts with Gradle
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout the repository
20+
uses: actions/checkout@v4
21+
with:
22+
ref: ${{ inputs.target-ref }}
23+
24+
- name: Set up JDK 17
25+
uses: actions/setup-java@v3
26+
with:
27+
distribution: 'zulu'
28+
java-version: '17'
29+
30+
- name: Verify source integrity
31+
run: |
32+
./gradlew ${{ inputs.target-module }}:clean ${{ inputs.target-module }}:build -x check
33+
34+
- name: Publish artifacts
35+
run: |
36+
./gradlew ${{ inputs.target-module }}:jreleaserConfig \
37+
${{ inputs.target-module }}:publish \
38+
${{ inputs.target-module }}:jreleaserDeploy
39+
env:
40+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
41+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
42+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
43+
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_CENTRAL_USERNAME }}
44+
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_CENTRAL_PASSWORD }}
45+
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.JRELEASER_CENTRAL_USERNAME }}
46+
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.JRELEASER_CENTRAL_PASSWORD }}
47+
JRELEASER_GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }}

.github/workflows/publish.yml

Lines changed: 62 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,65 @@ on:
1010
type: string
1111

1212
jobs:
13-
publish:
14-
name: Publish artifacts with Gradle
15-
runs-on: ubuntu-latest
16-
17-
steps:
18-
- name: Checkout the repository
19-
uses: actions/checkout@v4
20-
with:
21-
ref: ${{ github.event.inputs.tag }}
22-
23-
- name: Set up JDK 17
24-
uses: actions/setup-java@v3
25-
with:
26-
distribution: 'zulu'
27-
java-version: '17'
28-
29-
- name: Verify source integrity
30-
run: ./gradlew clean build -x check
31-
32-
- name: Publish artifacts
33-
run: ./gradlew jreleaserConfig publish jreleaserDeploy --stacktrace
34-
env:
35-
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
36-
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
37-
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
38-
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_CENTRAL_USERNAME }}
39-
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_CENTRAL_PASSWORD }}
40-
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.JRELEASER_CENTRAL_USERNAME }}
41-
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.JRELEASER_CENTRAL_PASSWORD }}
42-
JRELEASER_GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }}
13+
spring-boot-autoconfigure-data-jdbc-plus:
14+
uses: ./.github/workflows/publish-module.yml
15+
secrets: inherit
16+
with:
17+
target-module: 'spring-boot-autoconfigure-data-jdbc-plus'
18+
target-ref: ${{ github.event.inputs.tag }}
19+
20+
spring-boot-starter-data-jdbc-plus-repository:
21+
uses: ./.github/workflows/publish-module.yml
22+
secrets: inherit
23+
with:
24+
target-module: 'spring-boot-starter-data-jdbc-plus-repository'
25+
target-ref: ${{ github.event.inputs.tag }}
26+
27+
spring-boot-starter-data-jdbc-plus-sql:
28+
uses: ./.github/workflows/publish-module.yml
29+
secrets: inherit
30+
with:
31+
target-module: 'spring-boot-starter-data-jdbc-plus-sql'
32+
target-ref: ${{ github.event.inputs.tag }}
33+
34+
spring-data-jdbc-plus-repository:
35+
uses: ./.github/workflows/publish-module.yml
36+
secrets: inherit
37+
with:
38+
target-module: 'spring-data-jdbc-plus-repository'
39+
target-ref: ${{ github.event.inputs.tag }}
40+
41+
spring-data-jdbc-plus-sql:
42+
uses: ./.github/workflows/publish-module.yml
43+
secrets: inherit
44+
with:
45+
target-module: 'spring-data-jdbc-plus-sql'
46+
target-ref: ${{ github.event.inputs.tag }}
47+
48+
spring-data-jdbc-plus-support:
49+
uses: ./.github/workflows/publish-module.yml
50+
secrets: inherit
51+
with:
52+
target-module: 'spring-data-jdbc-plus-support'
53+
target-ref: ${{ github.event.inputs.tag }}
54+
55+
spring-data-plus-sql-gen:
56+
uses: ./.github/workflows/publish-module.yml
57+
secrets: inherit
58+
with:
59+
target-module: 'spring-data-plus-sql-gen'
60+
target-ref: ${{ github.event.inputs.tag }}
61+
62+
spring-jdbc-plus-commons:
63+
uses: ./.github/workflows/publish-module.yml
64+
secrets: inherit
65+
with:
66+
target-module: 'spring-jdbc-plus-commons'
67+
target-ref: ${{ github.event.inputs.tag }}
68+
69+
spring-jdbc-plus-support:
70+
uses: ./.github/workflows/publish-module.yml
71+
secrets: inherit
72+
with:
73+
target-module: 'spring-jdbc-plus-support'
74+
target-ref: ${{ github.event.inputs.tag }}

0 commit comments

Comments
 (0)