-
Notifications
You must be signed in to change notification settings - Fork 30
75 lines (60 loc) · 1.86 KB
/
ci.yml
File metadata and controls
75 lines (60 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
strategy:
matrix:
java-version: [8, 11, 17, 21, 25]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
cache: 'maven'
- name: Run tests
run: mvn -ntp test --file pom.xml
version:
needs: test
outputs:
version: ${{ steps.version.outputs.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 11
cache: 'maven'
- name: version
run: |
echo version=`mvn help:evaluate -Dexpression=project.version -q -DforceStdout` >> $GITHUB_OUTPUT
snapshot:
needs: [test, version]
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: set up Java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish package
run: mvn -ntp deploy
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
if: ${{ contains('SNAPSHOT', needs.version.outputs.version) && github.ref == 'refs/heads/master' && github.repository == 'jruby/jcodings' }}