Skip to content

Commit 24933b0

Browse files
committed
Update build/release workflows
1 parent 3d19069 commit 24933b0

File tree

3 files changed

+40
-60
lines changed

3 files changed

+40
-60
lines changed

.github/workflows/ci-pr.yml

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,20 @@ on:
55

66
jobs:
77
build:
8-
runs-on: ${{ matrix.os }}
9-
timeout-minutes: 15
10-
strategy:
11-
fail-fast: false
12-
matrix:
13-
include:
14-
- nickname: linux jdk17
15-
java: 17
16-
os: ubuntu-latest
17-
- nickname: macos jdk17
18-
java: 17
19-
os: macos-latest
20-
- nickname: windows jdk17
21-
java: 17
22-
os: windows-latest
23-
name: CI PR ${{ matrix.nickname }}
8+
runs-on: ubuntu-latest
9+
10+
name: PR Build
2411
steps:
25-
- uses: actions/checkout@v3
26-
- uses: actions/setup-java@v3
12+
- name: Checkout source code
13+
uses: actions/checkout@v4.2.2
14+
15+
- name: Set up JDK 17
16+
uses: actions/setup-java@v4.7.1
2717
with:
28-
distribution: adopt
29-
java-version: ${{ matrix.java }}
30-
cache: gradle
31-
- name: Build
32-
run: ./gradlew build
18+
java-version: '17'
19+
distribution: 'temurin'
20+
cache: 'maven'
21+
22+
- name: Build with Maven
23+
run: ./mvnw --no-transfer-progress --batch-mode --update-snapshots verify
24+

.github/workflows/ci.yml

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,25 @@ on:
1010

1111
jobs:
1212
build:
13-
runs-on: ${{ matrix.os }}
14-
strategy:
15-
fail-fast: false
16-
matrix:
17-
include:
18-
- nickname: linux jdk17
19-
java: 17
20-
os: ubuntu-latest
21-
- nickname: macos jdk17
22-
java: 17
23-
os: macos-latest
24-
- nickname: windows jdk17
25-
java: 17
26-
os: windows-latest
27-
name: CI Build ${{ matrix.nickname }}
28-
steps:
29-
- uses: actions/checkout@v4.2.2
30-
- name: Spring Gradle Build Action
31-
uses: spring-io/spring-gradle-build-action@v2
32-
with:
33-
java-version: '17'
34-
distribution: 'temurin'
35-
- name: Build with Gradle
36-
run: ./gradlew build
37-
publish:
38-
needs: build
3913
runs-on: ubuntu-latest
40-
if: github.repository_owner == 'spring-projects'
14+
15+
name: CI Build
4116
steps:
42-
- uses: actions/checkout@v4.2.2
43-
- name: Spring Gradle Build Action
44-
uses: spring-io/spring-gradle-build-action@v2
17+
- name: Checkout source code
18+
uses: actions/checkout@v4.2.2
19+
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@v4.7.1
4522
with:
4623
java-version: '17'
4724
distribution: 'temurin'
48-
- name: Build with Gradle
49-
run: ./gradlew -Dmaven.repo.local=$(pwd)/deployment-repository -x test build publishToMavenLocal
25+
cache: 'maven'
26+
27+
- name: Build with Maven
28+
run: ./mvnw -DaltDeploymentRepository=local::file:deployment-repository --no-transfer-progress --batch-mode --update-snapshots deploy
29+
5030
- name: Deploy to Artifactory
31+
if: ${{ github.repository == 'spring-projects/spring-batch' && github.ref_name == 'main' }}
5132
uses: spring-io/artifactory-deploy-action@v0.0.2
5233
with:
5334
uri: 'https://repo.spring.io'

.github/workflows/stage-release.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
inputs:
66
releaseVersion:
7-
description: "Version to stage, e.g. 3.4.1"
7+
description: "Version to stage"
88
required: true
99

1010
jobs:
@@ -15,14 +15,21 @@ jobs:
1515
- name: Checkout source code
1616
uses: actions/checkout@v4.2.2
1717

18-
- name: Spring Gradle Build Action
19-
uses: spring-io/spring-gradle-build-action@v2
18+
- name: Set up JDK 17
19+
uses: actions/setup-java@v4.7.1
2020
with:
2121
java-version: '17'
2222
distribution: 'temurin'
23+
cache: 'maven'
2324

24-
- name: Build with Gradle
25-
run: ./gradlew -Pversion=${{ github.event.inputs.releaseVersion }} -Dmaven.repo.local=$(pwd)/deployment-repository -x test build publishToMavenLocal
25+
- name: Update release version
26+
run: ./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.releaseVersion }}
27+
28+
- name: Enforce release rules
29+
run: ./mvnw org.apache.maven.plugins:maven-enforcer-plugin:enforce -Drules=requireReleaseDeps
30+
31+
- name: Build with Maven
32+
run: ./mvnw -DaltDeploymentRepository=local::file:deployment-repository --no-transfer-progress --batch-mode --update-snapshots deploy
2633

2734
- name: Deploy to Artifactory
2835
uses: spring-io/artifactory-deploy-action@v0.0.2

0 commit comments

Comments
 (0)