Skip to content

Commit 83dc1e7

Browse files
authored
Merge pull request jruby#9317 from chadlwilson/jruby-10.0-mvnw-consistency
[10.0] build: improve build/maven consistency / bump github actions
2 parents 094907f + e0f9f09 commit 83dc1e7

22 files changed

Lines changed: 102 additions & 790 deletions

.github/workflows/ci.yml

Lines changed: 52 additions & 79 deletions
Large diffs are not rendered by default.

.github/workflows/dist-verification-ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@ jobs:
2222

2323
steps:
2424
- name: checkout
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v6
2626
- name: set up java 21
27-
uses: actions/setup-java@v3
27+
uses: actions/setup-java@v5
2828
with:
2929
distribution: 'zulu'
3030
java-version: 21
3131
cache: 'maven'
3232
- name: build dist archive
3333
run: |
34-
mvn -ntp clean package -Pdist
34+
./mvnw -ntp clean package -Pdist
3535
mv maven/jruby-dist/target/jruby-dist*-bin.tar.gz jruby-dist-bin.tar.gz
3636
- name: cache dist
37-
uses: actions/upload-artifact@v4
37+
uses: actions/upload-artifact@v7
3838
with:
39-
name: jruby-dist
4039
path: jruby-dist-bin.tar.gz
4140
retention-days: 1
41+
archive: false
4242

4343
rails-verification:
4444

@@ -56,18 +56,18 @@ jobs:
5656

5757
steps:
5858
- name: checkout
59-
uses: actions/checkout@v3
59+
uses: actions/checkout@v6
6060
with:
6161
path: jruby-src
6262
- name: set up java ${{ matrix.java-version }}
63-
uses: actions/setup-java@v3
63+
uses: actions/setup-java@v5
6464
with:
6565
distribution: 'zulu'
6666
java-version: ${{ matrix.java-version }}
6767
- name: download cached dist
68-
uses: actions/download-artifact@v5
68+
uses: actions/download-artifact@v8
6969
with:
70-
name: jruby-dist
70+
name: jruby-dist-bin.tar.gz
7171
- name: unpack dist
7272
run: tar xzf jruby-dist-bin.tar.gz --strip-components=1
7373
- name: dist verification (Windows)

.github/workflows/manual-snapshot-publish-21.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
publish:
99
permissions:
1010
contents: read
11-
uses: jruby/jruby/.github/workflows/snapshot-publish.yml@659a649a802bafb69c5d216f6fbc4160c749d454
11+
uses: ./.github/workflows/snapshot-publish.yml
1212
with:
1313
javaLevel: 21
1414
secrets:

.github/workflows/manual-snapshot-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
publish:
99
permissions:
1010
contents: read
11-
uses: jruby/jruby/.github/workflows/snapshot-publish.yml@659a649a802bafb69c5d216f6fbc4160c749d454
11+
uses: ./.github/workflows/snapshot-publish.yml
1212
with:
1313
javaLevel: 8
1414
secrets:

.github/workflows/nightly-snapshot-publish-21.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
permissions:
1616
contents: read
1717
if: ${{ github.ref == 'refs/heads/master' && github.repository == 'jruby/jruby' }}
18-
uses: jruby/jruby/.github/workflows/snapshot-publish.yml@659a649a802bafb69c5d216f6fbc4160c749d454
18+
uses: ./.github/workflows/snapshot-publish.yml
1919
with:
2020
javaLevel: 21
2121
secrets:

.github/workflows/nightly-snapshot-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
permissions:
1616
contents: read
1717
if: ${{ github.ref == 'refs/heads/jruby-9.4' && github.repository == 'jruby/jruby' }}
18-
uses: jruby/jruby/.github/workflows/snapshot-publish.yml@659a649a802bafb69c5d216f6fbc4160c749d454
18+
uses: ./.github/workflows/snapshot-publish.yml
1919
with:
2020
javaLevel: 8
2121
secrets:

.github/workflows/snapshot-publish.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,23 @@ jobs:
2323

2424
steps:
2525
- name: checkout
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@v6
2727
- name: set up Java
28-
uses: actions/setup-java@v2
28+
uses: actions/setup-java@v5
2929
with:
3030
distribution: 'zulu'
3131
java-version: ${{ inputs.javaLevel }}
3232
server-id: central
3333
server-username: MAVEN_USERNAME
3434
server-password: MAVEN_PASSWORD
3535
- name: Publish package
36-
run: ./mvnw -B clean deploy -Psnapshots
36+
run: ./mvnw -ntp clean deploy -Psnapshots
3737
env:
3838
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
3939
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
4040
- name: Archive non-Maven artifacts
41-
uses: actions/upload-artifact@v4
41+
uses: actions/upload-artifact@v7
4242
with:
43-
name: jruby-jars gem
44-
path: |
45-
maven/jruby-jars/pkg/jruby-jars-*.SNAPSHOT.gem
43+
path: maven/jruby-jars/pkg/jruby-jars-*.SNAPSHOT.gem
44+
archive: false
4645

BUILDING.md

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Prerequisites:
55

66
* A [Java 21-compatible (or higher) Java development kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index.html).
77
* If `JAVA_HOME` is not set on Mac OS X: `export JAVA_HOME=$(/usr/libexec/java_home)`
8-
* [Maven](https://maven.apache.org/download.cgi) 3.3.0+ (Maven Wrapper provided with `./mvnw`)
98

109
For running tests, you will need Ant:
1110

@@ -25,21 +24,19 @@ command to execute is:
2524
./mvnw
2625
```
2726

28-
This will run the default "install" goal (`mvn install`) and will do all of the following:
27+
This will run the default "install" goal (`./mvnw install`) and will do all of the following:
2928

3029
* Compile JRuby
3130
* Build `lib/jruby.jar`, needed for running at command line
3231
* It will install the default gems specifications `lib/pom.rb` and the ruby files of those gems in `lib/ruby/stdlib/`.
3332

3433
The environment is now suitable for running Ruby applications.
3534

36-
If you have Maven installed in your PATH, you can just use `mvn` instead of `./mvnw`.
37-
3835
Incremental Builds
3936
------------------
4037

4138
When working on JRuby sources, it is helpful to incrementally rebuild only the `lib/jruby.jar` file rather than also
42-
re-assembling the standard library. You can add `-Dcore` to the `mvn` command line to speed up incremental builds:
39+
re-assembling the standard library. You can add `-Dcore` to the `./mvnw` command line to speed up incremental builds:
4340

4441
```
4542
./mvnw -Dcore
@@ -92,7 +89,7 @@ environment. This will do the following:
9289
needed to run integration tests.
9390

9491
```
95-
mvn -Pbootstrap
92+
./mvnw -Pbootstrap
9693
```
9794

9895
In case there is a problem with installing the jruby-launcher (due to missing compiler or so) use
@@ -110,7 +107,7 @@ After changing Java code, you can recompile quickly by running one of the
110107
jar files by
111108

112109
```
113-
mvn -pl core
110+
./mvnw -pl core
114111
```
115112

116113
### Day to Day Testing
@@ -160,7 +157,7 @@ Most of the specs under the spec/ directory are written for rspec, and can be ru
160157

161158
The notable exception is the "Ruby specs" under spec/ruby, which are run with mspec as described later in this document.
162159

163-
rspec will be installed with `mvn package -Pbootstrap` or you can install it manually.
160+
rspec will be installed with `./mvnw package -Pbootstrap` or you can install it manually.
164161

165162
```
166163
./bin/jruby -S rspec spec/path/to/spec
@@ -193,17 +190,17 @@ If you are making changes that would affect JRuby's core runtime
193190
or embedding APIs, you should run JRuby's Java-based unit tests via
194191

195192
```
196-
mvn -Ptest
193+
./mvnw -Ptest
197194
```
198195

199196
#### Tests for other ways of deploying and packaging JRuby
200197

201198
There are some maven integration tests (i.e. consistency test if all gems are included, osgi test, etc) for the various distributions of JRuby which can be invoked with
202199

203200
```
204-
mvn -Pmain -Dinvoker.skip=false
205-
mvn -Pcomplete -Dinvoker.skip=false
206-
mvn -Pdist -Dinvoker.skip=false
201+
./mvnw -Pmain -Dinvoker.skip=false
202+
./mvnw -Pcomplete -Dinvoker.skip=false
203+
./mvnw -Pdist -Dinvoker.skip=false
207204
```
208205

209206
#### Just Like CI
@@ -224,18 +221,18 @@ maven/jruby-dist/src/it
224221
To trigger the tests with the build:
225222

226223
```
227-
mvn -Pmain -Dinvoker.skip=false
228-
mvn -Pcomplete -Dinvoker.skip=false
229-
mvn -Pdist -Dinvoker.skip=false
230-
mvn -Pjruby-jars -Dinvoker.skip=false
224+
./mvnw -Pmain -Dinvoker.skip=false
225+
./mvnw -Pcomplete -Dinvoker.skip=false
226+
./mvnw -Pdist -Dinvoker.skip=false
227+
./mvnw -Pjruby-jars -Dinvoker.skip=false
231228
```
232229

233230
To pick a particular test, add the name of the directory inside the respective *src/it* folder, like (wildcards are possible):
234231

235232
```
236-
mvn -Pmain -Dinvoker.skip=false -Dinvoker.test=integrity
237-
mvn -Pmain -Dinvoker.skip=false -Dinvoker.test=j2ee*
238-
mvn -Pmain -Dinvoker.skip=false -Dinvoker.test=osgi*
233+
./mvnw -Pmain -Dinvoker.skip=false -Dinvoker.test=integrity
234+
./mvnw -Pmain -Dinvoker.skip=false -Dinvoker.test=j2ee*
235+
./mvnw -Pmain -Dinvoker.skip=false -Dinvoker.test=osgi*
239236
```
240237

241238
Clean Build
@@ -244,7 +241,7 @@ Clean Build
244241
To clean the build it is important to use the same profile for the clean as what you want to build. The best way to clean build something is, i.e. jruby-jars
245242

246243
```
247-
mvn clean install -Pjruby-jars
244+
./mvnw clean install -Pjruby-jars
248245
```
249246

250247
This first cleans everything and then starts the new build in one go!
@@ -253,12 +250,12 @@ Cleaning the build may be necessary after switching to a different
253250
version of JRuby (for example, after switching git branches) to ensure
254251
that everything is rebuilt properly.
255252

256-
NOTE: `mvn clean` just cleans the **jruby-core** artifact and the **./lib/jruby.jar**!
253+
NOTE: `./mvnw clean` just cleans the **jruby-core** artifact and the **./lib/jruby.jar**!
257254

258255
Clean everything:
259256

260257
```
261-
mvn -Pclean
258+
./mvnw -Pclean
262259
```
263260

264261
Distribution Packages

0 commit comments

Comments
 (0)