Skip to content

Commit 781c15d

Browse files
authored
Merge pull request #146 from xdev-software/develop
Release
2 parents 36e79a0 + f1735c3 commit 781c15d

File tree

7 files changed

+73
-39
lines changed

7 files changed

+73
-39
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
needs: [check-code]
5252
timeout-minutes: 10
5353
outputs:
54-
upload_url: ${{ steps.create_release.outputs.upload_url }}
54+
upload_url: ${{ steps.create-release.outputs.upload_url }}
5555
steps:
5656
- uses: actions/checkout@v4
5757

@@ -61,15 +61,7 @@ jobs:
6161
git config --global user.name "GitHub Actions"
6262
6363
- name: Un-SNAP
64-
run: |
65-
mvnwPath=$(readlink -f ./mvnw)
66-
modules=("") # root
67-
modules+=($(grep -oP '(?<=<module>)[^<]+' 'pom.xml'))
68-
for i in "${modules[@]}"
69-
do
70-
echo "Processing $i/pom.xml"
71-
(cd "$i" && $mvnwPath -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false)
72-
done
64+
run: ./mvnw -B versions:set -DremoveSnapshot -DprocessAllModules -DgenerateBackupPoms=false
7365

7466
- name: Get version
7567
id: version
@@ -88,7 +80,7 @@ jobs:
8880
git push origin --tags
8981
9082
- name: Create Release
91-
id: create_release
83+
id: create-release
9284
uses: shogo82148/actions-create-release@4661dc54f7b4b564074e9fbf73884d960de569a3 # v1
9385
with:
9486
tag_name: v${{ steps.version.outputs.release }}
@@ -112,6 +104,9 @@ jobs:
112104
runs-on: ubuntu-latest
113105
needs: [prepare-release]
114106
timeout-minutes: 60
107+
permissions:
108+
contents: read
109+
packages: write
115110
steps:
116111
- uses: actions/checkout@v4
117112

@@ -120,20 +115,34 @@ jobs:
120115
git config --global user.email "[email protected]"
121116
git config --global user.name "GitHub Actions"
122117
git pull
118+
119+
- name: Set up JDK
120+
uses: actions/setup-java@v4
121+
with: # running setup-java overwrites the settings.xml
122+
distribution: 'temurin'
123+
java-version: '17'
124+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
125+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once
123126

127+
- name: Publish to Central Portal
128+
run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github::https://maven.pkg.github.com/${{ github.repository }}
129+
env:
130+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
131+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
132+
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
133+
124134
- name: Set up JDK
125135
uses: actions/setup-java@v4
126136
with: # running setup-java again overwrites the settings.xml
127-
java-version: '17'
128137
distribution: 'temurin'
138+
java-version: '17'
129139
server-id: sonatype-central-portal
130140
server-username: MAVEN_CENTRAL_USERNAME
131141
server-password: MAVEN_CENTRAL_TOKEN
132142
gpg-passphrase: MAVEN_GPG_PASSPHRASE
133-
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
134143

135144
- name: Publish to Central Portal
136-
run: ../mvnw -B deploy -P publish-sonatype-central-portal -DskipTests
145+
run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal -DskipTests
137146
env:
138147
MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }}
139148
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }}
@@ -185,15 +194,7 @@ jobs:
185194
git pull
186195
187196
- name: Inc Version and SNAP
188-
run: |
189-
mvnwPath=$(readlink -f ./mvnw)
190-
modules=("") # root
191-
modules+=($(grep -oP '(?<=<module>)[^<]+' 'pom.xml'))
192-
for i in "${modules[@]}"
193-
do
194-
echo "Processing $i/pom.xml"
195-
(cd "$i" && $mvnwPath -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true -DupdateMatchingVersions=false)
196-
done
197+
run: ./mvnw -B versions:set -DnextSnapshot -DprocessAllModules -DgenerateBackupPoms=false
197198

198199
- name: Git Commit and Push
199200
run: |

.github/workflows/test-deploy.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,26 @@ jobs:
1010
publish-maven:
1111
runs-on: ubuntu-latest
1212
timeout-minutes: 60
13+
permissions:
14+
contents: read
15+
packages: write
1316
steps:
1417
- uses: actions/checkout@v4
18+
19+
- name: Set up JDK
20+
uses: actions/setup-java@v4
21+
with: # running setup-java overwrites the settings.xml
22+
distribution: 'temurin'
23+
java-version: '17'
24+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
25+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once
26+
27+
- name: Publish to GitHub Packages
28+
run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github::https://maven.pkg.github.com/${{ github.repository }}
29+
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
1533

1634
- name: Set up JDK
1735
uses: actions/setup-java@v4
@@ -22,10 +40,9 @@ jobs:
2240
server-username: MAVEN_CENTRAL_USERNAME
2341
server-password: MAVEN_CENTRAL_TOKEN
2442
gpg-passphrase: MAVEN_GPG_PASSPHRASE
25-
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
2643

2744
- name: Publish to Central Portal
28-
run: ../mvnw -B deploy -P publish-sonatype-central-portal -DskipTests
45+
run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal -DskipTests
2946
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
3047
env:
3148
MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 2.0.2
2+
* Don't try to pull reserved ``scratch`` image during build
3+
14
# 2.0.1
25
* Improve matching in ``DockerfileCOPYParentsEmulator`` #134
36
* Now should properly handle ``./``

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<dependency>
4747
<groupId>com.puppycrawl.tools</groupId>
4848
<artifactId>checkstyle</artifactId>
49-
<version>10.25.1</version>
49+
<version>10.26.1</version>
5050
</dependency>
5151
</dependencies>
5252
<configuration>
@@ -71,7 +71,7 @@
7171
<plugin>
7272
<groupId>org.apache.maven.plugins</groupId>
7373
<artifactId>maven-pmd-plugin</artifactId>
74-
<version>3.26.0</version>
74+
<version>3.27.0</version>
7575
<configuration>
7676
<includeTests>true</includeTests>
7777
<printFailingErrors>true</printFailingErrors>
@@ -83,12 +83,12 @@
8383
<dependency>
8484
<groupId>net.sourceforge.pmd</groupId>
8585
<artifactId>pmd-core</artifactId>
86-
<version>7.14.0</version>
86+
<version>7.15.0</version>
8787
</dependency>
8888
<dependency>
8989
<groupId>net.sourceforge.pmd</groupId>
9090
<artifactId>pmd-java</artifactId>
91-
<version>7.14.0</version>
91+
<version>7.15.0</version>
9292
</dependency>
9393
</dependencies>
9494
</plugin>

testcontainers-advanced-imagebuilder-dummy-app/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<dependency>
8383
<groupId>com.puppycrawl.tools</groupId>
8484
<artifactId>checkstyle</artifactId>
85-
<version>10.25.0</version>
85+
<version>10.26.1</version>
8686
</dependency>
8787
</dependencies>
8888
<configuration>

testcontainers-advanced-imagebuilder/pom.xml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<dependency>
5757
<groupId>org.testcontainers</groupId>
5858
<artifactId>testcontainers</artifactId>
59-
<version>1.21.2</version>
59+
<version>1.21.3</version>
6060
<exclusions>
6161
<!-- No JUnit 4 -->
6262
<exclusion>
@@ -81,7 +81,7 @@
8181
<dependency>
8282
<groupId>org.junit.jupiter</groupId>
8383
<artifactId>junit-jupiter</artifactId>
84-
<version>5.13.1</version>
84+
<version>5.13.3</version>
8585
<scope>test</scope>
8686
</dependency>
8787
<dependency>
@@ -199,7 +199,7 @@
199199
</properties>
200200
</profile>
201201
<profile>
202-
<id>publish-sonatype-central-portal</id>
202+
<id>publish</id>
203203
<build>
204204
<plugins>
205205
<plugin>
@@ -222,7 +222,7 @@
222222
<plugin>
223223
<groupId>org.apache.maven.plugins</groupId>
224224
<artifactId>maven-gpg-plugin</artifactId>
225-
<version>3.2.7</version>
225+
<version>3.2.8</version>
226226
<executions>
227227
<execution>
228228
<id>sign-artifacts</id>
@@ -241,7 +241,13 @@
241241
</execution>
242242
</executions>
243243
</plugin>
244-
244+
</plugins>
245+
</build>
246+
</profile>
247+
<profile>
248+
<id>publish-sonatype-central-portal</id>
249+
<build>
250+
<plugins>
245251
<plugin>
246252
<groupId>org.sonatype.central</groupId>
247253
<artifactId>central-publishing-maven-plugin</artifactId>
@@ -267,7 +273,7 @@
267273
<dependency>
268274
<groupId>com.puppycrawl.tools</groupId>
269275
<artifactId>checkstyle</artifactId>
270-
<version>10.25.1</version>
276+
<version>10.26.1</version>
271277
</dependency>
272278
</dependencies>
273279
<configuration>
@@ -292,7 +298,7 @@
292298
<plugin>
293299
<groupId>org.apache.maven.plugins</groupId>
294300
<artifactId>maven-pmd-plugin</artifactId>
295-
<version>3.26.0</version>
301+
<version>3.27.0</version>
296302
<configuration>
297303
<includeTests>true</includeTests>
298304
<printFailingErrors>true</printFailingErrors>
@@ -304,12 +310,12 @@
304310
<dependency>
305311
<groupId>net.sourceforge.pmd</groupId>
306312
<artifactId>pmd-core</artifactId>
307-
<version>7.14.0</version>
313+
<version>7.15.0</version>
308314
</dependency>
309315
<dependency>
310316
<groupId>net.sourceforge.pmd</groupId>
311317
<artifactId>pmd-java</artifactId>
312-
<version>7.14.0</version>
318+
<version>7.15.0</version>
313319
</dependency>
314320
</dependencies>
315321
</plugin>

testcontainers-advanced-imagebuilder/src/main/java/software/xdev/testcontainers/imagebuilder/AdvancedImageFromDockerFile.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ protected void prePullDependencyImages(final Set<String> imagesToPull)
448448
{
449449
imagesToPull
450450
.stream()
451+
.filter(this::canImageNameBePulled)
451452
.map(imageName -> CompletableFuture.runAsync(() -> {
452453
try
453454
{
@@ -472,6 +473,12 @@ protected void prePullDependencyImages(final Set<String> imagesToPull)
472473
.forEach(CompletableFuture::join);
473474
}
474475

476+
protected boolean canImageNameBePulled(final String imageName)
477+
{
478+
// scratch is reserved
479+
return !"scratch".equals(imageName);
480+
}
481+
475482
protected Logger log()
476483
{
477484
return LOGGER;

0 commit comments

Comments
 (0)