Skip to content

Commit c17a4cb

Browse files
committed
Decouple deploy from ci
1 parent 8050ff4 commit c17a4cb

File tree

4 files changed

+48
-23
lines changed

4 files changed

+48
-23
lines changed

.github/workflows/ci-4.x.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,11 @@ jobs:
6060
profile: ${{ matrix.profile }}
6161
deploy: ${{ matrix.jdk == '8' && matrix.os == 'ubuntu-latest' }}
6262
secrets: inherit
63+
Deploy:
64+
name: Deploy to OSSRH
65+
if: ${{ github.repository_owner == 'eclipse-vertx' && (github.event_name == 'push' || github.event_name == 'schedule') }}
66+
uses: ./.github/workflows/deploy.yml
67+
with:
68+
branch: 4.x
69+
jdk: 8
70+
secrets: inherit

.github/workflows/ci-5.x.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,11 @@ jobs:
6969
profile: ${{ matrix.profile }}
7070
deploy: ${{ matrix.jdk == '8' && matrix.os == 'ubuntu-latest' }}
7171
secrets: inherit
72+
Deploy:
73+
name: Deploy to OSSRH
74+
if: ${{ github.repository_owner == 'eclipse-vertx' && (github.event_name == 'push' || github.event_name == 'schedule') }}
75+
uses: ./.github/workflows/deploy.yml
76+
with:
77+
branch: ${{ github.head_ref || github.ref_name }}
78+
jdk: 8
79+
secrets: inherit

.github/workflows/ci.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,3 @@ jobs:
3131
distribution: temurin
3232
- name: Run tests
3333
run: mvn -s .github/maven-ci-settings.xml -q clean verify -B -DskipDefault -P ${{ inputs.profile }}
34-
Deploy:
35-
name: Deploy to OSSRH
36-
if: ${{ inputs.deploy && github.repository_owner == 'eclipse-vertx' && (github.event_name == 'push' || github.event_name == 'schedule') }}
37-
needs: Test
38-
runs-on: ubuntu-latest
39-
env:
40-
VERTX_NEXUS_USERNAME: ${{ secrets.VERTX_NEXUS_USERNAME }}
41-
VERTX_NEXUS_PASSWORD: ${{ secrets.VERTX_NEXUS_PASSWORD }}
42-
steps:
43-
- name: Checkout
44-
uses: actions/checkout@v2
45-
with:
46-
ref: ${{ inputs.branch }}
47-
- name: Install JDK
48-
uses: actions/setup-java@v2
49-
with:
50-
java-version: 17
51-
distribution: temurin
52-
- name: Get project version
53-
run: echo "PROJECT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version -B | grep -v '\[')" >> $GITHUB_ENV
54-
- name: Maven deploy
55-
if: ${{ endsWith(env.PROJECT_VERSION, '-SNAPSHOT') }}
56-
run: mvn deploy -s .github/maven-cd-settings.xml -DskipTests -B

.github/workflows/deploy.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy
2+
on:
3+
workflow_call:
4+
inputs:
5+
branch:
6+
required: true
7+
type: string
8+
jdk:
9+
default: 8
10+
type: string
11+
jobs:
12+
Deploy:
13+
name: Deploy to OSSRH
14+
runs-on: ubuntu-latest
15+
env:
16+
VERTX_NEXUS_USERNAME: ${{ secrets.VERTX_NEXUS_USERNAME }}
17+
VERTX_NEXUS_PASSWORD: ${{ secrets.VERTX_NEXUS_PASSWORD }}
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
with:
22+
ref: ${{ inputs.branch }}
23+
- name: Install JDK
24+
uses: actions/setup-java@v2
25+
with:
26+
java-version: ${{ inputs.jdk }}
27+
distribution: temurin
28+
- name: Get project version
29+
run: echo "PROJECT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version -B | grep -v '\[')" >> $GITHUB_ENV
30+
- name: Maven deploy
31+
if: ${{ endsWith(env.PROJECT_VERSION, '-SNAPSHOT') }}
32+
run: mvn deploy -s .github/maven-cd-settings.xml -DskipTests -B

0 commit comments

Comments
 (0)