Skip to content

Commit 585e883

Browse files
committed
GH-1911 - Update CI builds for release preparation builds.
1 parent 2c0f748 commit 585e883

3 files changed

Lines changed: 59 additions & 36 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI Build (Internal)
2+
3+
on:
4+
push:
5+
branches: [ release/* ]
6+
7+
jobs:
8+
build:
9+
name: Build project
10+
runs-on: ubuntu22-2-8
11+
12+
steps:
13+
14+
- name: Check out sources
15+
uses: actions/checkout@v6
16+
17+
- name: Determine project version
18+
id: determine-version
19+
shell: bash
20+
run: |
21+
PROJECT_VERSION=$(python3 -c "import sys, xml.etree.ElementTree as ET; ns='{http://maven.apache.org/POM/4.0.0}'; r=ET.parse(sys.stdin).getroot(); print((r.findtext(ns+'version') or r.findtext(ns+'parent/'+ns+'version') or '').strip())" < pom.xml)
22+
if [[ -z "${PROJECT_VERSION}" ]]; then
23+
echo "::error::Unable to determine the project version from pom.xml"
24+
exit 1
25+
fi
26+
27+
if [[ "${PROJECT_VERSION}" == *-SNAPSHOT ]]; then
28+
IS_SNAPSHOT=true
29+
else
30+
IS_SNAPSHOT=false
31+
fi
32+
33+
echo "Project version: ${PROJECT_VERSION} (isSnapshot=${IS_SNAPSHOT}"
34+
echo "isSnapshot=${IS_SNAPSHOT}" >> "$GITHUB_OUTPUT"
35+
36+
if [[ "${IS_SNAPSHOT}" != true ]]; then
37+
echo "::notice::Project version ${PROJECT_VERSION} is not a snapshot, skipping build"
38+
fi
39+
40+
- name: Set up JDK 21
41+
if: steps.determine-version.outputs.isSnapshot == 'true'
42+
uses: actions/setup-java@v5
43+
with:
44+
distribution: 'temurin'
45+
java-version: 21
46+
cache: 'maven'
47+
48+
- name: Build & deploy internal snapshot
49+
if: steps.determine-version.outputs.isSnapshot == 'true'
50+
env:
51+
INTERNAL_REPOSITORY_USERNAME: ${{ secrets.COMMERCIAL_ARTIFACTORY_USERNAME }}
52+
INTERNAL_REPOSITORY_PASSWORD: ${{ secrets.COMMERCIAL_ARTIFACTORY_PASSWORD }}
53+
INTERNAL_REPOSITORY_URL: ${{ vars.INTERNAL_REPOSITORY_URL }}
54+
run: ./mvnw -B dependency:list clean deploy -Dsort --settings settings.xml --activate-profiles ci -DaltDeploymentRepository="internal::${{ vars.INTERNAL_REPOSITORY_URL }}"

‎.github/workflows/build.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: CI Build
1+
name: CI Build (Open Source)
22

33
on:
44
push:
5-
branches: [ main, 2.0.x, 1.4.x, 1.3.x, 1.2.x, feature/* ]
5+
branches: [ main, 2.1.x, 2.0.x, 1.4.x, feature/* ]
66

77
jobs:
88
build:

‎settings.xml‎

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,11 @@
1111
</server>
1212

1313
<server>
14-
<id>spring-enterprise-snapshot</id>
15-
<username>${env.COMMERCIAL_USERNAME}</username>
16-
<password>${env.COMMERCIAL_PASSWORD}</password>
17-
</server>
18-
19-
<server>
20-
<id>spring-enterprise-release</id>
21-
<username>${env.COMMERCIAL_USERNAME}</username>
22-
<password>${env.COMMERCIAL_PASSWORD}</password>
14+
<id>internal</id>
15+
<username>${env.INTERNAL_REPOSITORY_USERNAME}</username>
16+
<password>${env.INTERNAL_REPOSITORY_PASSWORD}</password>
2317
</server>
2418

2519
</servers>
2620

27-
<profiles>
28-
<profile>
29-
<id>spring-enterprise</id>
30-
<activation>
31-
<activeByDefault>true</activeByDefault>
32-
</activation>
33-
<repositories>
34-
<repository>
35-
<id>spring-enterprise-snapshot</id>
36-
<url>https://usw1.packages.broadcom.com/artifactory/spring-enterprise-maven-dev-local</url>
37-
<releases>
38-
<enabled>false</enabled>
39-
</releases>
40-
</repository>
41-
<repository>
42-
<id>spring-enterprise-release</id>
43-
<url>https://usw1.packages.broadcom.com/artifactory/spring-enterprise-maven-prod-local</url>
44-
<snapshots>
45-
<enabled>false</enabled>
46-
</snapshots>
47-
</repository>
48-
</repositories>
49-
</profile>
50-
</profiles>
51-
5221
</settings>

0 commit comments

Comments
 (0)